Took
zfs() out of the question as it seemed to be using
geli() under the hood, so just focused on
geli() performance and found the issue after some extensive testing.
The QAT 8950 card has three device services available:
- Symetric encryption (sym)
- Asymetric encryption (asym)
- Compression (dc)
But the Intel QAT 8955 (dh8950) card I have can only have two engines running at once, so only two of the three services can be used at anyone time; 8955 only has two device engines, but three services are loadable from the firmware.
FreeBSD
qat() kernel module defaults to "sym;dc" when one card is installed (as seen in
sysctl dev.qat.0.cfg_services); I guess zero is considered both odd and even in this context, and the "dc" engine overrides the position for the "asym" service by default when only using a single card.
With the QAT configured for both sym and asym, I am seeing a 34% read and 30% write performance increase compared to AES-NI with
geli for a HMAC/SHA256, AES-XTS-256 workload, which seems to be the cards sweet spot in assisting.
/boot/loader.conf
Code:
#default with only one Intel QAT 8950: dev.qat.0.cfg_services = "sym;dc"
dev.qat.0.cfg_services = "sym;asym"
qat_dh895xcc_fw_load="YES"
qat_load="YES"
cryptodev_load="YES"
geli init -P -a "HMAC/SHA256" -e "AES-XTS" -l 256 -s 4096 -K ~/throwaway.key -B plaintext.eli gpt/ciphertext
Note:
It seems that the exposed
qat services can only be set before the
qat kernel module loads, so they have to be in
/boot/loader.conf and cannot be altered at runtime with
sysctl dev.qat.0.cfg_services="sym;asym".
Note 2:
The dh8950cc (8955) card performs best using HMAC/SHA2 and either AES-XTS-256 or AES-CBC-256.
Warning:
It does not assist at all with Camellia-CBC-128/256 compared to AES-NI alone, and even introduces a write performance reduction of between -4% and -11% when
geli() is running a HMAC/SHA1 with AES-CBC-256, or HMAC/SHA1 with Camellia-CBC-128 workload respectively.