Intel QAT 8970 accel card on ARM Ampere Server

David Marchand david.marchand at redhat.com
Wed Oct 11 13:51:32 CEST 2023


On Tue, Oct 10, 2023 at 6:00 PM Patrick Robb <probb at iol.unh.edu> wrote:
> On Mon, Oct 9, 2023 at 11:56 PM Dharmik Jayesh Thakkar <DharmikJayesh.Thakkar at arm.com> wrote:
>>
>> Hi Patrick,
>>
>>
>>
>> Can you provide the grub settings? Is iommu.passthrough=1 included?
>
>
> Sure. I'm not sure if you just wanted the kernel cmdline options or the whole grub config, but I assume you just meant kernel cmdline. Let me know if you meant more.
>
> GRUB_CMDLINE_LINUX_DEFAULT="default_hugepagesz=1G hugepagesz=1G hugepages=32 iommu=pt intel_iommu=on isolcpus=39-79 nohz_full=39-79 rcu_nocbs=39-79 processor.max_cstate=1 intel_pstate=disable console=ttyS0,115200 console=tty0"
>
> But, iommu.passthrough=1 is not included, so I can add that if we need to. Do you know that this won't have any bad implications for the (intel, nvidia, broadcom) NICs which we test on this server?
>
>>
>>
>>
>> Also, is qat_c62xvf loaded as well?
>
> qat_c62xvf is built in to the kernel also.
>
>>
>>
>>
>>
>>
>> Finally, a few guidelines on the vfio driver:
>>
>> At times, we need to configure the vfio driver.
>>
>> On kernel vers. 5.9+ we need to load the vfio-pci driver with the additional parameter disable_denylist=1
>>
>> Unload the vfio-pci driver if it is already loaded so that we can reload it with the correct parameters :
>> sudo modprobe -r vfio_iommu_type1; sudo modprobe -r vfio_pci; sudo modprobe -r vfio_virqfd; sudo modprobe -r vfio
>>
>> If you can't unload the vfio driver because it's been built into the kernel, you'll have to find another way to change VFIO parameters, or to rebuild your kernel with VFIO_PCI set as a module. Failing to do that, you might encounter issues later on when you try to bind the VFs to VFIO.
>>
>> Load the vfio-pci driver and bind it to QAT VFs device ids:
>> sudo modprobe vfio-pci disable_denylist=1 enable_sriov=1 vfio-pci.ids=8086:37c9
>>
>> Enable no-iommu-mode:
>> echo "1" | sudo tee /sys/module/vfio/parameters/enable_unsafe_noiommu_mode
>>
>>  /sys/module/vfio/parameter is missing ?
>>
>> If /sys/module/vfio/parameters does not exist, you might be missing the kernel module VFIO_NOIOMMU
>>
>>
>>
>> Automatically set VFIO params on boot
>>
>> It's possible to set these parameters automatically on boot by creating a /etc/modprobe.d/vfio-pci.conf file with the parameters :
>> cat /etc/modprobe.d/vfio-pci.conf
>> options vfio enable_unsafe_noiommu_mode=1
>> options vfio-pci disable_denylist=1 enable_sriov=1 vfio-pci.ids=8086:37c9
>>
>>
>>
>> We haven’t encountered this issue in the past, so just making sure the configuration is correct. I don’t think having the driver static/loadable should make a difference, I will try with building statically on my setup.
>>
>>
>>
>> Thank you!
>>
>>
> Okay, this should be fine. Like I said, we are also running tests on NICs on this server. So, in our Jenkinsfiles scripts for running the testing, I will add a preliminary step only for QAT tests which runs:
> sudo modprobe -r vfio_iommu_type1; sudo modprobe -r vfio_pci; sudo modprobe -r vfio_virqfd; sudo modprobe -r vfio

- I thought vfio_iommu_type1 was a x86 thing. So it would work for x86
(Intel/AMD) systems, but fail on other arches.. ?
If you tested this on ARM, it is probably ok as is.


> sudo modprobe vfio-pci disable_denylist=1 enable_sriov=1 vfio-pci.ids=8086:37c9

- Speaking to myself, too bad the disable_denylist param value is only
read once, when loading the vfio-pci kernel module...
So ok, I get why you need to reload the whole chain of kmods.

However, I don't think the vfio-pci.ids syntax works for passing parameters.
And in any case, why do you need to set this initial list?
Binding devices (using either driverctl or dpdk-devbind.py) to
vfio-pci should be done the "usual" way, or is there some special case
again for QAT?


- Besides, from what I understood so far, there are two parts specific
to this QAT test:
* enabling SRIOV so that creating VF is possible with a PF bound to
vfio-pci (option enable_sriov=1),
* for a list of PCI QAT cards, forcing the disable_denylist is needed
(option disable_denylist=1),

For the latter point, at this step of the test setup, do you know
which QAT devices will be used?
If so, the commandline params could be constructed to enable
disable_denylist only for known-broken QAT devices (the list is
available in the kernel commit Dharmik provided earlier).


> echo "1" | sudo tee /sys/module/vfio/parameters/enable_unsafe_noiommu_mode
> (then run QAT tests)
>
> And if running on NICs, have a preliminary step which runs
> sudo modprobe -r vfio_iommu_type1; sudo modprobe -r vfio_pci; sudo modprobe -r vfio_virqfd; sudo modprobe -r vfio
> sudo modprobe vfio

Given that vfio_iommu_type1 is ok on other arch, this lgtm.


-- 
David Marchand



More information about the ci mailing list