net/ice: fix get link status timeout

Message ID 20230206062239.1042172-1-mingjinx.ye@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series net/ice: fix get link status timeout |

Checks

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

Commit Message

Mingjin Ye Feb. 6, 2023, 6:22 a.m. UTC
  When hw is just started, it will immediately obtain the link status, and
the longest attempt is 1 second. Some NICs are slow to initialize, which
make it fails to obtain the link status.

The patch fixes this issue by modifying the longest attempt to 5 seconds.

Fixes: cf911d90e366 ("net/ice: support link update")
Cc: stable@dpdk.org

Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon Feb. 6, 2023, 7:23 a.m. UTC | #1
06/02/2023 07:22, Mingjin Ye:
> When hw is just started, it will immediately obtain the link status, and
> the longest attempt is 1 second. Some NICs are slow to initialize, which
> make it fails to obtain the link status.
> 
> The patch fixes this issue by modifying the longest attempt to 5 seconds.

What is the consequence?
In which case, DPDK application would be blocked during 5 seconds?
  
Mingjin Ye Feb. 6, 2023, 8:14 a.m. UTC | #2
> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: 2023年2月6日 15:23
> To: Ye, MingjinX <mingjinx.ye@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org; Zhou, YidingX
> <yidingx.zhou@intel.com>; Yang, Qiming <qiming.yang@intel.com>; Zhang,
> Qi Z <qi.z.zhang@intel.com>; Ye, MingjinX <mingjinx.ye@intel.com>;
> david.marchand@redhat.com; ferruh.yigit@amd.com
> Subject: Re: [PATCH] net/ice: fix get link status timeout
> 
> 06/02/2023 07:22, Mingjin Ye:
> > When hw is just started, it will immediately obtain the link status,
> > and the longest attempt is 1 second. Some NICs are slow to initialize,
> > which make it fails to obtain the link status.
> >
> > The patch fixes this issue by modifying the longest attempt to 5 seconds.
> 
> What is the consequence?
DPDK could not get link status. At this point, the link status obtained through
the pmd API is wrong.

> In which case, DPDK application would be blocked during 5 seconds?
When the dpdk application startup port is used, it will be blocked for up
to 5 seconds to ensure that the connection status can be obtained.
>
  
Thomas Monjalon Feb. 6, 2023, 9:15 a.m. UTC | #3
06/02/2023 09:14, Ye, MingjinX:
> From: Thomas Monjalon <thomas@monjalon.net>
> > 06/02/2023 07:22, Mingjin Ye:
> > > When hw is just started, it will immediately obtain the link status,
> > > and the longest attempt is 1 second. Some NICs are slow to initialize,
> > > which make it fails to obtain the link status.
> > >
> > > The patch fixes this issue by modifying the longest attempt to 5 seconds.
> > 
> > What is the consequence?
> 
> DPDK could not get link status. At this point, the link status obtained through
> the pmd API is wrong.
> 
> > In which case, DPDK application would be blocked during 5 seconds?
> 
> When the dpdk application startup port is used, it will be blocked for up
> to 5 seconds to ensure that the connection status can be obtained.

I mean what is the consequence of the increase?
For example, if the port is not connected (no wire),
are we going to wait 5 seconds?

I guess it's OK because it won't wait at all if using rte_eth_link_get_nowait.
It may be interesting to note in the commit message.
  
Mingjin Ye Feb. 6, 2023, 10:06 a.m. UTC | #4
> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: 2023年2月6日 17:16
> To: Ye, MingjinX <mingjinx.ye@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org; Zhou, YidingX
> <yidingx.zhou@intel.com>; Yang, Qiming <qiming.yang@intel.com>; Zhang,
> Qi Z <qi.z.zhang@intel.com>; david.marchand@redhat.com;
> ferruh.yigit@amd.com
> Subject: Re: [PATCH] net/ice: fix get link status timeout
> 
> 06/02/2023 09:14, Ye, MingjinX:
> > From: Thomas Monjalon <thomas@monjalon.net>
> > > 06/02/2023 07:22, Mingjin Ye:
> > > > When hw is just started, it will immediately obtain the link
> > > > status, and the longest attempt is 1 second. Some NICs are slow to
> > > > initialize, which make it fails to obtain the link status.
> > > >
> > > > The patch fixes this issue by modifying the longest attempt to 5 seconds.
> > >
> > > What is the consequence?
> >
> > DPDK could not get link status. At this point, the link status
> > obtained through the pmd API is wrong.
> >
> > > In which case, DPDK application would be blocked during 5 seconds?
> >
> > When the dpdk application startup port is used, it will be blocked for
> > up to 5 seconds to ensure that the connection status can be obtained.
> 
> I mean what is the consequence of the increase?
There will be no side effects. 

> For example, if the port is not connected (no wire), are we going to wait 5
> seconds?
This will cause a wait of up to 5 seconds.
> 
> I guess it's OK because it won't wait at all if using rte_eth_link_get_nowait.
> It may be interesting to note in the commit message.
The reason for pushing this patch is that the E823 NIC needs about 2 seconds
to get the link up state when the port is started, so the waiting time needs to
be extended. 
Modified to 5 seconds, consistent with other timeouts of DPDK.
>
  

Patch

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 0bc739daf0..eaa556f45c 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -3927,7 +3927,7 @@  static int
 ice_link_update(struct rte_eth_dev *dev, int wait_to_complete)
 {
 #define CHECK_INTERVAL 100  /* 100ms */
-#define MAX_REPEAT_TIME 10  /* 1s (10 * 100ms) in total */
+#define MAX_REPEAT_TIME 50  /* 5s (50 * 100ms) in total */
 	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct ice_link_status link_status;
 	struct rte_eth_link link, old;