In the current version of ZFS QAT offload is only possible with GZIP and will offload to Software/CPU GZIP when failed.
However, considering CEPH already does this, It should be possible to make it offload with multiple algorithms or even make it algorith independent. For example CEPH already enables offload for LZ4.
Byond combining it with current algorithms future use of such a feature might be:
Perhaps @wli5 can comment on the feasibility of this. But it's my understanding that the current generation of QAT hardware does not support LZ4 offload. The limitations of the user space QATzip library used by Ceph may be different.
@behlendorf
I didn't say I wanted LZ4 offload support, (CEPH also doesn't support that), I asked to support other compression algorithms as fallback.
Currently if QAT fails, it falls back to CPU GZIP on zfs.
How CEPH supports QAT with LZ4 is just falling back to $insert-other-algorithm
CEPH doesn't support LZ4, it just falls back to lz4...
Reading both the code from CEPH and ZFS, it looks like the fallback algorithm doesn't have to be GZIP at all.
If you would be able to select lz4 with QAT (as I requested), it would mean it would use QAT (GZIP) and fall back to LZ4 if QAT fails.
Currently in ZFS, QAT is under GZIP compression method, to support your request we need to create a new "qat" compression method, e.g., "zfs set compression=qat tank", with this new compression method, everything (offloading, fallback, etc.) will be handled by qat API. In theory we can do it, but for now I'd prefer to keep current design, it is clean, simple and compatible with SW.
@wli5 Okey, understandable, could you explain how common fallback to cpu/software actually is in practice?
(If it is uncommon, changing the offload algorithm is less/not needed ofcourse)
@Ornias1993 it is not common, the fallback happens when the QAT hardware has failure when compress a block of data.
@wli5 Thanks for the info. So other fallback has close to zero priority :)
Closing..
Most helpful comment
Currently in ZFS, QAT is under GZIP compression method, to support your request we need to create a new "qat" compression method, e.g., "zfs set compression=qat tank", with this new compression method, everything (offloading, fallback, etc.) will be handled by qat API. In theory we can do it, but for now I'd prefer to keep current design, it is clean, simple and compatible with SW.