common/qat: fix vf2pf answer

Message ID 20220729074731.5641-1-arkadiuszx.kusztal@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series common/qat: fix vf2pf answer |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/github-robot: build success github build: passed
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS

Commit Message

Arkadiusz Kusztal July 29, 2022, 7:47 a.m. UTC
  This commit fixes answer sent to physical device in
vf2pf communication.

Fixes: b17d16fb47b4 ("common/qat: add PF to VF communication")
Cc: stable@dpdk.org

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
 drivers/common/qat/qat_pf2vf.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Fan Zhang Aug. 9, 2022, 9:34 a.m. UTC | #1
> -----Original Message-----
> From: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>
> Sent: Friday, July 29, 2022 8:48 AM
> To: dev@dpdk.org
> Cc: gakhil@marvell.com; Zhang, Roy Fan <roy.fan.zhang@intel.com>; Kusztal,
> ArkadiuszX <arkadiuszx.kusztal@intel.com>; stable@dpdk.org
> Subject: [PATCH] common/qat: fix vf2pf answer
> 
> This commit fixes answer sent to physical device in
> vf2pf communication.
> 
> Fixes: b17d16fb47b4 ("common/qat: add PF to VF communication")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> ---
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
  
Akhil Goyal Aug. 28, 2022, 9:29 a.m. UTC | #2
> > Subject: [PATCH] common/qat: fix vf2pf answer
> >
> > This commit fixes answer sent to physical device in
> > vf2pf communication.
> >
> > Fixes: b17d16fb47b4 ("common/qat: add PF to VF communication")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> > ---
> Acked-by: Fan Zhang <roy.fan.zhang@intel.com>

Applied to dpdk-next-crypto
  

Patch

diff --git a/drivers/common/qat/qat_pf2vf.c b/drivers/common/qat/qat_pf2vf.c
index 4e9ffc72fc..621f12fce2 100644
--- a/drivers/common/qat/qat_pf2vf.c
+++ b/drivers/common/qat/qat_pf2vf.c
@@ -59,7 +59,7 @@  int qat_pf2vf_exch_msg(struct qat_pci_device *qat_dev,
 		 * the message
 		 */
 		do {
-			rte_delay_us_sleep(5);
+			rte_delay_us_sleep(ADF_IOV_MSG_ACK_DELAY_US * 2);
 			val = ADF_CSR_RD(pmisc_bar_addr, vf_csr_off);
 		} while ((val & ADF_PFVF_INT) &&
 			(++count < ADF_IOV_MSG_ACK_MAX_RETRY));
@@ -70,6 +70,8 @@  int qat_pf2vf_exch_msg(struct qat_pci_device *qat_dev,
 		}
 
 		uint32_t pf_val = ADF_CSR_RD(pmisc_bar_addr, pf_csr_off);
+		msg &= ~ADF_PFVF_INT;
+		ADF_CSR_WR(pmisc_bar_addr, pf_csr_off, msg);
 
 		*(ret + i) = (uint8_t)(pf_val >> (pf2vf_msg.block_hdr > 0 ?
 				10 : 8) & 0xff);