[v5] net/i40e: extend VF reset waiting time

Message ID 20210429082724.1157163-1-wenjun1.wu@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series [v5] net/i40e: extend VF reset waiting time |

Checks

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

Commit Message

Wenjun Wu April 29, 2021, 8:27 a.m. UTC
  When starting VF, VF will issue reset command to PF, wait a fixed
amount of time, and assume VF reset is done on PF side. However,
compared with kernel PF, DPDK PF needs more time to setup. If we
run DPDK PF to support DPDK VF, the original delay will not be
enough. When we first start VF after PF is launched, the execution
time of the statement info.msg_buf = rte_zmalloc("msg_buffer",
info.buf_len, 0); in the function i40e_dev_handle_aq_msg is more
than 200ms. It may cause VF start error.

Since iavf can hardly triggle this issue and i40evf will be replaced
by iavf in future DPDK versions, this patch provide a workaround.
We extend VF reset waiting time from 200ms to 500ms so that
VF can start normally when using DPDK PF and DPDK VF in most cases.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>

---
v2: change the delay to 500ms because it can cover most cases.
v3: perfect the commit message.
v4: correct spelling mistakes.
v5: modify the commit message to mention this a workaround.
---
 drivers/net/i40e/i40e_ethdev_vf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Qi Zhang April 29, 2021, 11:04 a.m. UTC | #1
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Wenjun Wu
> Sent: Thursday, April 29, 2021 4:27 PM
> To: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>
> Cc: Wu, Wenjun1 <wenjun1.wu@intel.com>
> Subject: [dpdk-dev] [PATCH v5] net/i40e: extend VF reset waiting time
> 
> When starting VF, VF will issue reset command to PF, wait a fixed amount of
> time, and assume VF reset is done on PF side. However, compared with kernel
> PF, DPDK PF needs more time to setup. If we run DPDK PF to support DPDK VF,
> the original delay will not be enough. When we first start VF after PF is
> launched, the execution time of the statement info.msg_buf =
> rte_zmalloc("msg_buffer", info.buf_len, 0); in the function
> i40e_dev_handle_aq_msg is more than 200ms. It may cause VF start error.
> 
> Since iavf can hardly triggle this issue and i40evf will be replaced by iavf in
> future DPDK versions, this patch provide a workaround.
> We extend VF reset waiting time from 200ms to 500ms so that VF can start
> normally when using DPDK PF and DPDK VF in most cases.
> 
> Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
  

Patch

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 3c258ba7cf..aeb6816b9f 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1236,7 +1236,7 @@  i40evf_reset_vf(struct rte_eth_dev *dev)
 	  * it to ACTIVE. In this duration, vf may not catch the moment that
 	  * COMPLETE is set. So, for vf, we'll try to wait a long time.
 	  */
-	rte_delay_ms(200);
+	rte_delay_ms(500);
 
 	ret = i40evf_check_vf_reset_done(dev);
 	if (ret) {