Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: qat - move PFVF compat checker to a function

Move the code that implements VF version compatibility on the PF side to
a separate function so that it can be reused when doing VM live
migration.

This does not introduce any functional change.

Signed-off-by: Xin Zeng <xin.zeng@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Xin Zeng and committed by
Herbert Xu
867e8010 1f8d6a16

+12 -7
+1 -7
drivers/crypto/intel/qat/qat_common/adf_pfvf_pf_proto.c
··· 242 242 "VersionRequest received from VF%d (vers %d) to PF (vers %d)\n", 243 243 vf_nr, vf_compat_ver, ADF_PFVF_COMPAT_THIS_VERSION); 244 244 245 - if (vf_compat_ver == 0) 246 - compat = ADF_PF2VF_VF_INCOMPATIBLE; 247 - else if (vf_compat_ver <= ADF_PFVF_COMPAT_THIS_VERSION) 248 - compat = ADF_PF2VF_VF_COMPATIBLE; 249 - else 250 - compat = ADF_PF2VF_VF_COMPAT_UNKNOWN; 251 - 245 + compat = adf_vf_compat_checker(vf_compat_ver); 252 246 vf_info->vf_compat_ver = vf_compat_ver; 253 247 254 248 resp->type = ADF_PF2VF_MSGTYPE_VERSION_RESP;
+11
drivers/crypto/intel/qat/qat_common/adf_pfvf_utils.h
··· 28 28 struct pfvf_message adf_pfvf_message_of(struct adf_accel_dev *accel_dev, u32 raw_msg, 29 29 const struct pfvf_csr_format *fmt); 30 30 31 + static inline u8 adf_vf_compat_checker(u8 vf_compat_ver) 32 + { 33 + if (vf_compat_ver == 0) 34 + return ADF_PF2VF_VF_INCOMPATIBLE; 35 + 36 + if (vf_compat_ver <= ADF_PFVF_COMPAT_THIS_VERSION) 37 + return ADF_PF2VF_VF_COMPATIBLE; 38 + 39 + return ADF_PF2VF_VF_COMPAT_UNKNOWN; 40 + } 41 + 31 42 #endif /* ADF_PFVF_UTILS_H */