Skip to content

Commit 7fc587d

Browse files
committed
crypto: qat - fix recovery flow for VFs
JIRA: https://issues.redhat.com/browse/RHEL-52749 Upstream Status: merged into the linux.git commit 6f1b523 Author: Michal Witwicki <michal.witwicki@intel.com> Date: Wed Jul 17 07:44:58 2024 -0400 crypto: qat - fix recovery flow for VFs When the PFVF protocol was updated to support version 5, i.e. ADF_PFVF_COMPAT_FALLBACK, the compatibility version for the VF was updated without supporting the message RESTARTING_COMPLETE required for such version. Add support for the ADF_VF2PF_MSGTYPE_RESTARTING_COMPLETE message in the VF drivers. This message is sent by the VF driver to the PF to notify the completion of the shutdown flow. Fixes: ec26f8e ("crypto: qat - update PFVF protocol for recovery") Signed-off-by: Michal Witwicki <michal.witwicki@intel.com> Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Vladis Dronov <vdronov@redhat.com>
1 parent f765fef commit 7fc587d

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

drivers/crypto/intel/qat/qat_common/adf_pfvf_vf_msg.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,20 @@ void adf_vf2pf_notify_shutdown(struct adf_accel_dev *accel_dev)
4848
}
4949
EXPORT_SYMBOL_GPL(adf_vf2pf_notify_shutdown);
5050

51+
void adf_vf2pf_notify_restart_complete(struct adf_accel_dev *accel_dev)
52+
{
53+
struct pfvf_message msg = { .type = ADF_VF2PF_MSGTYPE_RESTARTING_COMPLETE };
54+
55+
/* Check compatibility version */
56+
if (accel_dev->vf.pf_compat_ver < ADF_PFVF_COMPAT_FALLBACK)
57+
return;
58+
59+
if (adf_send_vf2pf_msg(accel_dev, msg))
60+
dev_err(&GET_DEV(accel_dev),
61+
"Failed to send Restarting complete event to PF\n");
62+
}
63+
EXPORT_SYMBOL_GPL(adf_vf2pf_notify_restart_complete);
64+
5165
int adf_vf2pf_request_version(struct adf_accel_dev *accel_dev)
5266
{
5367
u8 pf_version;

drivers/crypto/intel/qat/qat_common/adf_pfvf_vf_msg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#if defined(CONFIG_PCI_IOV)
77
int adf_vf2pf_notify_init(struct adf_accel_dev *accel_dev);
88
void adf_vf2pf_notify_shutdown(struct adf_accel_dev *accel_dev);
9+
void adf_vf2pf_notify_restart_complete(struct adf_accel_dev *accel_dev);
910
int adf_vf2pf_request_version(struct adf_accel_dev *accel_dev);
1011
int adf_vf2pf_get_capabilities(struct adf_accel_dev *accel_dev);
1112
int adf_vf2pf_get_ring_to_svc(struct adf_accel_dev *accel_dev);

drivers/crypto/intel/qat/qat_common/adf_vf_isr.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "adf_cfg.h"
1414
#include "adf_cfg_strings.h"
1515
#include "adf_cfg_common.h"
16+
#include "adf_pfvf_vf_msg.h"
1617
#include "adf_transport_access_macros.h"
1718
#include "adf_transport_internal.h"
1819

@@ -75,6 +76,7 @@ static void adf_dev_stop_async(struct work_struct *work)
7576

7677
/* Re-enable PF2VF interrupts */
7778
adf_enable_pf2vf_interrupts(accel_dev);
79+
adf_vf2pf_notify_restart_complete(accel_dev);
7880
kfree(stop_data);
7981
}
8082

0 commit comments

Comments
 (0)