mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 22:52:19 +02:00
crypto: qat - set PFVF_MSGORIGIN just before sending
In this implementation of the PFVF protocol every egressing message must include the ADF_PFVF_MSGORIGIN_SYSTEM flag. However, this flag can be set on all the outbound messages just before sending them rather than at message build time, as currently done. Remove the unnecessary code duplication by setting the ADF_PFVF_MSGORIGIN_SYSTEM flag only once at send time in adf_gen2_pfvf_send(). 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>
This commit is contained in:
parent
0280428568
commit
0aeda694f1
|
|
@ -149,6 +149,7 @@ static int adf_gen2_pfvf_send(struct adf_accel_dev *accel_dev, u32 msg,
|
|||
/* Pre-calculate message, shifting it in place and setting
|
||||
* the in use pattern
|
||||
*/
|
||||
msg |= ADF_PFVF_MSGORIGIN_SYSTEM;
|
||||
msg = gen2_csr_msg_to_position(msg, local_offset);
|
||||
gen2_csr_set_in_use(&msg, remote_offset);
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,7 @@
|
|||
void adf_pf2vf_notify_restarting(struct adf_accel_dev *accel_dev)
|
||||
{
|
||||
struct adf_accel_vf_info *vf;
|
||||
u32 msg = (ADF_PFVF_MSGORIGIN_SYSTEM |
|
||||
(ADF_PF2VF_MSGTYPE_RESTARTING << ADF_PFVF_MSGTYPE_SHIFT));
|
||||
u32 msg = ADF_PF2VF_MSGTYPE_RESTARTING << ADF_PFVF_MSGTYPE_SHIFT;
|
||||
int i, num_vfs = pci_num_vf(accel_to_pci_dev(accel_dev));
|
||||
|
||||
for (i = 0, vf = accel_dev->pf.vf_info; i < num_vfs; i++, vf++) {
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@ static int adf_handle_vf2pf_msg(struct adf_accel_dev *accel_dev, u32 vf_nr,
|
|||
else
|
||||
compat = ADF_PF2VF_VF_COMPAT_UNKNOWN;
|
||||
|
||||
resp = ADF_PFVF_MSGORIGIN_SYSTEM;
|
||||
resp |= ADF_PF2VF_MSGTYPE_VERSION_RESP <<
|
||||
ADF_PFVF_MSGTYPE_SHIFT;
|
||||
resp |= ADF_PFVF_COMPAT_THIS_VERSION <<
|
||||
|
|
@ -83,7 +82,6 @@ static int adf_handle_vf2pf_msg(struct adf_accel_dev *accel_dev, u32 vf_nr,
|
|||
/* PF always newer than legacy VF */
|
||||
compat = ADF_PF2VF_VF_COMPATIBLE;
|
||||
|
||||
resp = ADF_PFVF_MSGORIGIN_SYSTEM;
|
||||
resp |= ADF_PF2VF_MSGTYPE_VERSION_RESP <<
|
||||
ADF_PFVF_MSGTYPE_SHIFT;
|
||||
/* Set legacy major and minor version num */
|
||||
|
|
|
|||
|
|
@ -16,8 +16,7 @@
|
|||
*/
|
||||
int adf_vf2pf_notify_init(struct adf_accel_dev *accel_dev)
|
||||
{
|
||||
u32 msg = (ADF_PFVF_MSGORIGIN_SYSTEM |
|
||||
(ADF_VF2PF_MSGTYPE_INIT << ADF_PFVF_MSGTYPE_SHIFT));
|
||||
u32 msg = ADF_VF2PF_MSGTYPE_INIT << ADF_PFVF_MSGTYPE_SHIFT;
|
||||
|
||||
if (adf_send_vf2pf_msg(accel_dev, msg)) {
|
||||
dev_err(&GET_DEV(accel_dev),
|
||||
|
|
@ -39,8 +38,7 @@ EXPORT_SYMBOL_GPL(adf_vf2pf_notify_init);
|
|||
*/
|
||||
void adf_vf2pf_notify_shutdown(struct adf_accel_dev *accel_dev)
|
||||
{
|
||||
u32 msg = (ADF_PFVF_MSGORIGIN_SYSTEM |
|
||||
(ADF_VF2PF_MSGTYPE_SHUTDOWN << ADF_PFVF_MSGTYPE_SHIFT));
|
||||
u32 msg = ADF_VF2PF_MSGTYPE_SHUTDOWN << ADF_PFVF_MSGTYPE_SHIFT;
|
||||
|
||||
if (test_bit(ADF_STATUS_PF_RUNNING, &accel_dev->status))
|
||||
if (adf_send_vf2pf_msg(accel_dev, msg))
|
||||
|
|
@ -57,9 +55,9 @@ int adf_vf2pf_request_version(struct adf_accel_dev *accel_dev)
|
|||
u32 resp;
|
||||
int ret;
|
||||
|
||||
msg = ADF_PFVF_MSGORIGIN_SYSTEM;
|
||||
msg |= ADF_VF2PF_MSGTYPE_COMPAT_VER_REQ << ADF_PFVF_MSGTYPE_SHIFT;
|
||||
msg |= ADF_PFVF_COMPAT_THIS_VERSION << ADF_VF2PF_COMPAT_VER_REQ_SHIFT;
|
||||
msg = ADF_VF2PF_MSGTYPE_COMPAT_VER_REQ << ADF_PFVF_MSGTYPE_SHIFT |
|
||||
ADF_PFVF_COMPAT_THIS_VERSION << ADF_VF2PF_COMPAT_VER_REQ_SHIFT;
|
||||
|
||||
BUILD_BUG_ON(ADF_PFVF_COMPAT_THIS_VERSION > 255);
|
||||
|
||||
ret = adf_send_vf2pf_req(accel_dev, msg, &resp);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user