crypto: qat - make PFVF message construction direction agnostic
authorMarco Chiappero <marco.chiappero@intel.com>
Thu, 16 Dec 2021 09:13:17 +0000 (09:13 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 24 Dec 2021 03:18:24 +0000 (14:18 +1100)
commit6ed942ed3c47b3ebb4e8de3ff10e761cdf82ba74
tree3cfd6458322ff26422850ea2748312682d32828d
parent448588adcdf4a025b0b5517a5c9557b036b3cf79
crypto: qat - make PFVF message construction direction agnostic

Currently PFVF messages are created upfront in the CSR format, that is
PF2VF messages starting from bit 0 and VF2PF from bit 16, and passed
along unmodified to the PFVF send function.

Refactor the code to allow the VF2PF messages to be built starting from
bit 0, as for the PF2VF messages. Shift the VF to PF messages just
before sending them, and refactor the send logic to handle messages
properly depending on the direction.

As a result all the messages are composed the same way regardless of
the direction.

Signed-off-by: Marco Chiappero <marco.chiappero@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/qat/qat_common/adf_gen2_pfvf.c
drivers/crypto/qat/qat_common/adf_pfvf_msg.h
drivers/crypto/qat/qat_common/adf_pfvf_pf_msg.c
drivers/crypto/qat/qat_common/adf_pfvf_pf_proto.c
drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c
drivers/crypto/qat/qat_common/adf_pfvf_vf_proto.c