Skip to content

Commit 6e680f9

Browse files
intmcherbertx
authored andcommitted
crypto: qat - make pfvf send message direction agnostic
The functions adf_iov_putmsg() and __adf_iov_putmsg() are shared by both PF and VF. Any logging or documentation should not refer to any specific direction. Make comments and log messages direction agnostic by replacing PF2VF with PFVF. Also fix the wording for some related comments. Signed-off-by: Marco Chiappero <[email protected]> Co-developed-by: Giovanni Cabiddu <[email protected]> Signed-off-by: Giovanni Cabiddu <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent c3878a7 commit 6e680f9

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

drivers/crypto/qat/qat_common/adf_pf2vf_msg.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,19 @@ static int __adf_iov_putmsg(struct adf_accel_dev *accel_dev, u32 msg, u8 vf_nr)
7777

7878
mutex_lock(lock);
7979

80-
/* Check if PF2VF CSR is in use by remote function */
80+
/* Check if the PFVF CSR is in use by remote function */
8181
val = ADF_CSR_RD(pmisc_bar_addr, pf2vf_offset);
8282
if ((val & remote_in_use_mask) == remote_in_use_pattern) {
8383
dev_dbg(&GET_DEV(accel_dev),
84-
"PF2VF CSR in use by remote function\n");
84+
"PFVF CSR in use by remote function\n");
8585
ret = -EBUSY;
8686
goto out;
8787
}
8888

8989
msg &= ~local_in_use_mask;
9090
msg |= local_in_use_pattern;
9191

92-
/* Attempt to get ownership of the PF2VF CSR */
92+
/* Attempt to get ownership of the PFVF CSR */
9393
ADF_CSR_WR(pmisc_bar_addr, pf2vf_offset, msg | int_bit);
9494

9595
/* Wait for confirmation from remote func it received the message */
@@ -111,20 +111,21 @@ static int __adf_iov_putmsg(struct adf_accel_dev *accel_dev, u32 msg, u8 vf_nr)
111111
ret = -EIO;
112112
}
113113

114-
/* Finished with PF2VF CSR; relinquish it and leave msg in CSR */
114+
/* Finished with the PFVF CSR; relinquish it and leave msg in CSR */
115115
ADF_CSR_WR(pmisc_bar_addr, pf2vf_offset, val & ~local_in_use_mask);
116116
out:
117117
mutex_unlock(lock);
118118
return ret;
119119
}
120120

121121
/**
122-
* adf_iov_putmsg() - send PF2VF message
122+
* adf_iov_putmsg() - send PFVF message
123123
* @accel_dev: Pointer to acceleration device.
124124
* @msg: Message to send
125-
* @vf_nr: VF number to which the message will be sent
125+
* @vf_nr: VF number to which the message will be sent if on PF, ignored
126+
* otherwise
126127
*
127-
* Function sends a message from the PF to a VF
128+
* Function sends a message through the PFVF channel
128129
*
129130
* Return: 0 on success, error code otherwise.
130131
*/

0 commit comments

Comments
 (0)