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>
This commit is contained in:
parent
1f8d6a163c
commit
867e801005
@ -242,13 +242,7 @@ static int adf_handle_vf2pf_msg(struct adf_accel_dev *accel_dev, u8 vf_nr,
|
||||
"VersionRequest received from VF%d (vers %d) to PF (vers %d)\n",
|
||||
vf_nr, vf_compat_ver, ADF_PFVF_COMPAT_THIS_VERSION);
|
||||
|
||||
if (vf_compat_ver == 0)
|
||||
compat = ADF_PF2VF_VF_INCOMPATIBLE;
|
||||
else if (vf_compat_ver <= ADF_PFVF_COMPAT_THIS_VERSION)
|
||||
compat = ADF_PF2VF_VF_COMPATIBLE;
|
||||
else
|
||||
compat = ADF_PF2VF_VF_COMPAT_UNKNOWN;
|
||||
|
||||
compat = adf_vf_compat_checker(vf_compat_ver);
|
||||
vf_info->vf_compat_ver = vf_compat_ver;
|
||||
|
||||
resp->type = ADF_PF2VF_MSGTYPE_VERSION_RESP;
|
||||
|
@ -28,4 +28,15 @@ u32 adf_pfvf_csr_msg_of(struct adf_accel_dev *accel_dev, struct pfvf_message msg
|
||||
struct pfvf_message adf_pfvf_message_of(struct adf_accel_dev *accel_dev, u32 raw_msg,
|
||||
const struct pfvf_csr_format *fmt);
|
||||
|
||||
static inline u8 adf_vf_compat_checker(u8 vf_compat_ver)
|
||||
{
|
||||
if (vf_compat_ver == 0)
|
||||
return ADF_PF2VF_VF_INCOMPATIBLE;
|
||||
|
||||
if (vf_compat_ver <= ADF_PFVF_COMPAT_THIS_VERSION)
|
||||
return ADF_PF2VF_VF_COMPATIBLE;
|
||||
|
||||
return ADF_PF2VF_VF_COMPAT_UNKNOWN;
|
||||
}
|
||||
|
||||
#endif /* ADF_PFVF_UTILS_H */
|
||||
|
Loading…
x
Reference in New Issue
Block a user