OSDN Git Service

crypto: qat - make PFVF send and receive direction agnostic
authorMarco Chiappero <marco.chiappero@intel.com>
Thu, 16 Dec 2021 09:13:18 +0000 (09:13 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 24 Dec 2021 03:18:24 +0000 (14:18 +1100)
commit028042856802c4731c6afebe15d95fed4d39a614
treed89ea0592c79d4782efb144042c3a5f7f57c21c1
parent6ed942ed3c47b3ebb4e8de3ff10e761cdf82ba74
crypto: qat - make PFVF send and receive direction agnostic

Currently PF and VF share the same send and receive logic for the PFVF
protocol. However, the inner behaviour still depends on the specific
direction, requiring a test to determine the if the sender is a PF or a
VF. Moreover the vf_nr parameter is only required for PF2VF messages and
ignored for the opposite direction.

Make the GEN2 send and recv completely direction agnostic, by calculating
and determining any direction specific input in the caller instead, and
feeding the send and the receive functions with the same arguments for
both PF and VF. In order to accommodate for this change, the API of the
pfvf_ops send and recv has been modified to remove any reference to vf_nr.

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_accel_devices.h
drivers/crypto/qat/qat_common/adf_gen2_pfvf.c
drivers/crypto/qat/qat_common/adf_pfvf_pf_proto.c
drivers/crypto/qat/qat_common/adf_pfvf_vf_proto.c