Replies: 14 comments 27 replies
-
Hi, did you find out what the problem was? What did you end up doing? I am in the process of setting up new Debian 11 system and might need the QAT for compression, I will test with zstd algorithm to see how it goes first though... |
Beta Was this translation helpful? Give feedback.
-
Hi @AGI-chandler, No, I gave up. But a couple of fresh eyes on this discussion might bring some new ideas. Keep me informed, thanks! |
Beta Was this translation helpful? Give feedback.
-
As written in my first post, I used the following options:
I'm not sure what other options in this list would be needed... |
Beta Was this translation helpful? Give feedback.
-
Some details about my choices:
But anyway, the QAT part seems good, as I wrote more than a year ago:
About ZFS setup:
I export
Maybe there was some setup mistake on my ZFS pool? I hope this could help you move some steps ahead. Keep me informed. |
Beta Was this translation helpful? Give feedback.
-
After carefully re-reading your OP, I noticed:
That's a Debian version of the module. Plus you mentioned You need to download ZFS source, properly configure it, build it, build the debs, then install the debs. Before that, you need to export all your ZFS pools so they are unmounted/deactivated, uninstall the Debian zfs-dkms and any other related packages, and You'll also need the Debian I successfully did this a few years ago on CentOS and Debian, but am struggling to get it updated on the Debian machine, you can see my other issue here, I think I must have messed up the kernel source or something. In looking in my command history on the CentOS machine, it's hilarious. I must have wiped out the ZFS source tree a dozen times while I figured out the correct way to make everyone play together. Unfortunately, on the Debian machine, my history there is gone. But, in configuring ZFS, you'll at least want to use |
Beta Was this translation helpful? Give feedback.
-
Hi, I found nothing about Debian disabling compression with ZFS/QAT. At least, there's no Debian patch in the zfs-linux package (from which the zfs-dkms is built): https://salsa.debian.org/zfsonlinux-team/zfs/-/tree/master/debian/patches. I would be interested about any pointer about that... It could be useful to improve ZFS doc around QAT/Debian with such info. Moreover, I suppose there should be some public discussions about this on the Debian side... I'll give your suggestion a try anyway. Mor than a year has spend since my last try anyway, the versions are different now, so who knows? I subscribed to your other issue to follow your adventure with ZFS/QAT :) Thank you very much for your feedback and suggestion. |
Beta Was this translation helpful? Give feedback.
-
Yo @ioguix! I'm happy to report I finally got things working on my end! and your idea was right! The Debian What ended up working for me was adding to the kernel command I notice in your initial are you using this computer for virtualization tasks? If not, then try turning those options off. From my understanding, the QAT can only be used for virtual tasks (by guest services) or physical tasks (by host services), but not both. That's why I had to add Also might want to drop |
Beta Was this translation helpful? Give feedback.
-
Well @ioguix the fun continues. After rebooting the computer, ZFS would NOT integrate with the QAT any longer. I spent all afternoon trying to figure out why. I think it had to do with the ZFS module loading before the QAT was initialized and could load its module. I tried the systemd override you mentioned in your OP but it was not good enough. Nothing was. I must have tried 10 different things, various other overrides, adding the QAT modules to /etc/modules, blacklisting zfs modules, adding the QAT modules to the initramfs, and so on. No matter what I did that sneaky ZFS module would always insert itself before the QAT was ready, even before the systemd "Load the ZFS modules" service had started. For example a message like this would always show up: So I went back to the source and tried again and finally was able to get that running, hopefully it survives a reboot! Here are the commands I used that worked in case you want to try:
|
Beta Was this translation helpful? Give feedback.
-
Hi @AGI-chandler , I've got my hands dirty tonight, messing with this issue. It's not finished yet, but bellow my thoughts. kernel spaceSo, it seems the motherboard capability AND features enabled in the kernel have some kind of influence about how the QAT module are build and/or setup by default. Deactivating the MB capabilities was not enough, I had to rebuild the QAT module after reboot. The sample code module wasn't working after disabling After adding the kernel parameter export ICP_ROOT=/root/qat-4.20/
cd $ICP_ROOT
make -j4 samples-install
insmod /usr/local/bin/cpa_sample_code.ko runTests=1
journalctl -k # should show various test and benchmarks
rmmod cpa_sample_code Here is a sample of the log written by the sample module:
So, at this point, I know the QAT module is working fine from the kernel space API now. I rebuilt the ZFS module, but the counters in May I ask what is your checksum and encryption setup for ZFS ? root=> zfs get checksum tank/data
NAME PROPERTY VALUE SOURCE
tank/data checksum sha256 local
root=> zfs get encryption tank/data
NAME PROPERTY VALUE SOURCE
tank/data encryption aes-256-gcm - User landIn fact, the qat counters in What surprise me is that this activity is quite CPU intensive, with a high load, no matter what... Worse: testing with root=> service qat_service stop
root=> cryptsetup benchmark
# Tests are approximate using memory only (no storage IO).
PBKDF2-sha1 836185 iterations per second for 256-bit key
PBKDF2-sha256 1281877 iterations per second for 256-bit key
PBKDF2-sha512 432580 iterations per second for 256-bit key
PBKDF2-ripemd160 376103 iterations per second for 256-bit key
PBKDF2-whirlpool 205442 iterations per second for 256-bit key
argon2i 4 iterations, 795418 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
argon2id 4 iterations, 706485 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
# Algorithm | Key | Encryption | Decryption
aes-cbc 128b 442.1 MiB/s 920.6 MiB/s
serpent-cbc 128b 43.5 MiB/s 102.1 MiB/s
twofish-cbc 128b 91.3 MiB/s 104.9 MiB/s
aes-cbc 256b 336.1 MiB/s 754.7 MiB/s
serpent-cbc 256b 43.5 MiB/s 102.1 MiB/s
twofish-cbc 256b 91.2 MiB/s 104.9 MiB/s
aes-xts 256b 809.0 MiB/s 808.4 MiB/s
serpent-xts 256b 97.9 MiB/s 98.0 MiB/s
twofish-xts 256b 100.0 MiB/s 100.0 MiB/s
aes-xts 512b 675.1 MiB/s 674.8 MiB/s
serpent-xts 512b 97.9 MiB/s 98.0 MiB/s
twofish-xts 512b 100.0 MiB/s 100.0 MiB/s
root=> service qat_service start
root=> cat /sys/kernel/debug/qat_c3xxx_0000\:01\:00.0/fw_counters
+------------------------------------------------+
| FW Statistics for Qat Device |
+------------------------------------------------+
| Firmware Requests [AE 0]: 205 |
| Firmware Responses[AE 0]: 205 |
| RAS Events [AE 0]: 0 |
+------------------------------------------------+
| Firmware Requests [AE 1]: 0 |
| Firmware Responses[AE 1]: 0 |
| RAS Events [AE 1]: 0 |
+------------------------------------------------+
| Firmware Requests [AE 2]: 0 |
| Firmware Responses[AE 2]: 0 |
| RAS Events [AE 2]: 0 |
+------------------------------------------------+
| Firmware Requests [AE 3]: 204 |
| Firmware Responses[AE 3]: 204 |
| RAS Events [AE 3]: 0 |
+------------------------------------------------+
| Firmware Requests [AE 4]: 0 |
| Firmware Responses[AE 4]: 0 |
| RAS Events [AE 4]: 0 |
+------------------------------------------------+
| Firmware Requests [AE 5]: 0 |
| Firmware Responses[AE 5]: 0 |
| RAS Events [AE 5]: 0 |
+------------------------------------------------+
root=> cryptsetup benchmark
# Tests are approximate using memory only (no storage IO).
PBKDF2-sha1 826952 iterations per second for 256-bit key
PBKDF2-sha256 1274089 iterations per second for 256-bit key
PBKDF2-sha512 432580 iterations per second for 256-bit key
PBKDF2-ripemd160 372893 iterations per second for 256-bit key
PBKDF2-whirlpool 205120 iterations per second for 256-bit key
argon2i 4 iterations, 786472 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
argon2id 4 iterations, 798208 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
# Algorithm | Key | Encryption | Decryption
aes-cbc 128b 322.5 MiB/s 323.0 MiB/s
serpent-cbc 128b 43.5 MiB/s 102.0 MiB/s
twofish-cbc 128b 91.2 MiB/s 104.9 MiB/s
aes-cbc 256b 254.7 MiB/s 255.2 MiB/s
serpent-cbc 256b 43.5 MiB/s 102.1 MiB/s
twofish-cbc 256b 91.2 MiB/s 104.9 MiB/s
aes-xts 256b 322.5 MiB/s 322.5 MiB/s
serpent-xts 256b 97.9 MiB/s 98.0 MiB/s
twofish-xts 256b 100.0 MiB/s 100.1 MiB/s
aes-xts 512b 255.7 MiB/s 255.6 MiB/s
serpent-xts 512b 97.9 MiB/s 98.0 MiB/s
twofish-xts 512b 100.0 MiB/s 100.0 MiB/s
root=> cat /sys/kernel/debug/qat_c3xxx_0000\:01\:00.0/fw_counters
+------------------------------------------------+
| FW Statistics for Qat Device |
+------------------------------------------------+
| Firmware Requests [AE 0]: 18669 |
| Firmware Responses[AE 0]: 18669 |
| RAS Events [AE 0]: 0 |
+------------------------------------------------+
| Firmware Requests [AE 1]: 0 |
| Firmware Responses[AE 1]: 0 |
| RAS Events [AE 1]: 0 |
+------------------------------------------------+
| Firmware Requests [AE 2]: 0 |
| Firmware Responses[AE 2]: 0 |
| RAS Events [AE 2]: 0 |
+------------------------------------------------+
| Firmware Requests [AE 3]: 18668 |
| Firmware Responses[AE 3]: 18668 |
| RAS Events [AE 3]: 0 |
+------------------------------------------------+
| Firmware Requests [AE 4]: 0 |
| Firmware Responses[AE 4]: 0 |
| RAS Events [AE 4]: 0 |
+------------------------------------------------+
| Firmware Requests [AE 5]: 0 |
| Firmware Responses[AE 5]: 0 |
| RAS Events [AE 5]: 0 |
+------------------------------------------------+ Maybe this benchmark is not the best suited to test the QAT performance/load impact (I don't know if it's parallelized)... root=> /usr/local/bin/cpa_sample_code runTests=1
[...]
Cipher AES128-CBC
Direction Encrypt
API Traditional
Packet Size 4096
Number of Threads 6
Total Submissions 600000
Total Responses 600000
Total Retries 954978
CPU Frequency(kHz) 2200076
Throughput(Mbps) 19200
[...] Do you have some similar results? |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for the discussion/documentation, helped tremendiously during setup. |
Beta Was this translation helpful? Give feedback.
-
Hi @volkermauel ! Thanks for your feedback, nice beefy disk setup. Having numbers without QAT enabled, especially about CPU load, would be very interesting. I'll try to do some benchmark using fio on my little setup with encryption, but so far I had no luck with QAT :/ |
Beta Was this translation helpful? Give feedback.
-
I am trying to get QAT working on debian 11, this time on arm64. Is there any way to have ZFS use the built-in drivers instead of the rather old source-code? At least the built-in drivers build fine on arm64. My priority is getting crypto acceleration working as I have another accelerator for (de)compression. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Since QAT limits the level of gzip compression, compare its achievable compression ratio with zstd or lz4. There's no significant difference between |
Beta Was this translation helpful? Give feedback.
-
Hi,
During a (borg) backup reading a whole ZFS encrypted file system, I noticed the
z_rd_int
threads were eating 30-50 of %sys CPU. Theperf top
command was showing a gcm function (I did not record the exact name) on top of the list.I was using LVM pool on Luks for this partition on the same server in the past, and never experienced such a load. The disk is now 100% ZFS without Luks beneath it.
I was expecting some more load when moving to ZFS, and I'm not sure how large it was supposed to be, but I wonder if I missed something on the way. Since then, I try to enable QAT for ZFS with no success.
The OS is Debian 11 bullseye.
Here are some details about my kernel, CPU and its QAT:
I compiled and installed QAT 4.15 using:
So QAT is available from kernel space and the kernel crypto framework.
It looks to work fine from the crypto side. The kernel module expose various algos, and the QAT counters are moving when using
cryptsetup benchmark
:The
ICP_ROOT
environment variable has been exported before compiling the ZFS module using dkms (apt-get install zfs-dkms
ordpkg-reconfigure zfs-dkms
).The ZFS module seems to have QAT enabled, it detects it (no
*disabled
parameters enabled), but the QAT counters are not moving at all:I added a service drop-in file to make sure the ZFS module is loaded after qat_service is started:
Here is my ZFS setup:
I tried to enable gzip compression on
tank/data
and wrote some data, but no more luck with compression, nothing moves.Also, I started from zfs 2.0.3 available on Debian repos and just upgraded to 2.0.6 available from Debian backports since a few days.
Do I miss something in my setup? Should I report anything else to help with some more diagnostics?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions