-
Notifications
You must be signed in to change notification settings - Fork 60
providers/base : add tests for Intel QAT (New) #1795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
c762ecf
to
6cacc6d
Compare
076bda5
to
5650fda
Compare
I made a couple inline comments... I'm interested in including this in the server suite. Mostly my questions are around the dependency on the detect job, which simply checks that someone ticked Y on a manifest entry (server suite doesn't use manifests, it uses resources). Would it be reasonable for the detect job to pass if either condition is there (e.g. the resource job returns a and add that extra bit to the resource similar to other resource constraints in use? so... something like this for the detect job:
And keep the rest of it as-is with the dependency on the detect job? |
8432a90
to
a889a1d
Compare
Thanks @bladernr for your feedback ! Based on your comments, I re-designed the tests, please take a look and let me know things you would want to be improved. |
a889a1d
to
d462f2b
Compare
QAT (Intel QuickAssist Technology) is an accelerator for crypto/compression operations. The hardward is available on recent Intel Xeon processors.
d462f2b
to
0561f5c
Compare
@bladernr I just saw your previous comment :
Manifest entries can be entered manually when running Checkbox, but they can also be pre-filled (it's just a filke stored in Also, manifest entries and resources do not serve exactly the same purpose. With a manifest, you tell Checkbox that this device does have a given piece of hardware, or a specific feature enabled. Resources retrieve the information automatically from the system, which may lead in jobs being skipped if the resource script fails, or if the driver is not properly loaded and therefore the feature is not exposed to the user. A typical example is The tutorial has a whole page about how manifests work, you can check it out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the long time to provide feedback! Please check my comments to see if they make sense.
@@ -0,0 +1,3 @@ | |||
unit: category | |||
id: intel-qat | |||
_name: Intel Quick-Assist Technology |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_name: Intel Quick-Assist Technology | |
_name: Intel QuickAssist Technology |
As per the Intel page.
command: | ||
PFS=$(qatctl.py list --short | wc -l) | ||
if [ "${PFS}" -le 0 ]; then | ||
echo "manifest.has_intel_qat is set to True but no device found !" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo "manifest.has_intel_qat is set to True but no device found !" | |
echo "This system is supposed to support Intel QuickAssist Technology, but no Intel QAT device were found!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you provide unit tests for this file?
unit: template | ||
template-resource: qat | ||
template-engine: jinja2 | ||
template-unit: job | ||
id: intel-qat-common/{{ available }}-attach-devices |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unit: template | |
template-resource: qat | |
template-engine: jinja2 | |
template-unit: job | |
id: intel-qat-common/{{ available }}-attach-devices | |
unit: template | |
template-resource: qat | |
template-unit: job | |
id: intel-qat-common/{available}-attach-devices |
Template jobs use python string formatting by default. I don't think jinja2 is needed here (nor in any of the following template jobs in this file).
package.name == 'qatlib-examples' | ||
package.name == 'qatlib-service' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are these package made available on the system? Is it a package to pull from the official repos? Is it something that needs building?
# switch all devices to crypto sym mode | ||
printf "POLICY=0\nServicesEnabled=sym\n" | tee /etc/sysconfig/qat | ||
systemctl restart qat | ||
cpa_sample_code runTests=1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is cpa_sample_code
made available? (I assume it's part of the packages mentioned above?)
rmmod vfio-pci || true | ||
nb_vfio=$(qatctl.py status --devices {{ pf }} --vfio | wc -l) | ||
[ "$nb_vfio" -le 0 ] || (echo "nb vfio devices should be <= 0" && exit 1) | ||
# we have to pass the VF device ids | ||
modprobe vfio-pci ids=8086:4941,8086:4943,8086:4945,8086:4947 | ||
nb_vfio=$(qatctl.py status --devices {{ pf }} --vfio | wc -l) | ||
[ "$nb_vfio" -gt 0 ] || (echo "nb vfio devices should be > 0" && exit 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several suggestions (some apply to other jobs in this PR too):
- Put these into a separate bash script in
bin/
, and start it withset -e
so that it fails as soon as possible if anything goes wrong. - a
check
flag could be added to theqatctl.py
script to avoid relying on additional bash commands (such as[ "$nb_vfio" -le 0 ] || (echo "nb vfio devices should be <= 0" && exit 1)
) - maybe this test could be split in 2 (the second test would depend on the first):
- check that no VFIO files are present if the
vfio-pci
module is removed - check that VFIO are there when the module is reloaded
- if something goes wrong before you reload the
vfio-pci
module, all the tests running after will fail, so you probably have to make sure the modules are reloaded regardless of the outcome.
@@ -0,0 +1,4 @@ | |||
unit: manifest entry | |||
id: has_intel_qat | |||
_name: A Intel Quick-Assist Technology (QAT) device |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_name: A Intel Quick-Assist Technology (QAT) device | |
_name: An Intel QuickAssist Technology (QAT) device |
for pf in ${PFS}; do | ||
driver_path=$(readlink /sys/bus/pci/devices/0000:"${pf}"/driver) | ||
driver=$(basename "${driver_path}") | ||
if [ "${driver}" == "4xxx" ] || [ "${driver}" == "420xx" ]; then | ||
echo "pf: ${pf}" | ||
echo "driver: ${driver}" | ||
echo "available: qat" | ||
echo "" | ||
break | ||
fi | ||
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be put into the python script directly (maybe as a qatctl.py resource
command). Easier to test and to maintain.
# Hector Cao <[email protected]> | ||
|
||
unit: job | ||
id: qat_pf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This resource job looks like it's doing exactly the same thing as qat
below, except it doesn't add the available
field. Consider removing this and rely on qat
only.
Description
This MR adds tests for Intel Intel QuickAssist Technology (QAT) devices. QAT is an accelerator for crypto/compression operations, available on Intel server-class hardware equipped with XEON processors.
Resolved issues
Documentation
Tests
I run these tests on Intel hardwares with/without QAT devices.
On hardware without QAT support, no test will be run (just 1 test is skipped, no tests are generated from the job templates).
On a machine with
402xx
QAT device (402xx
driver), here is the sample output of the results: