[dpdk-stable] [dpdk-dev] [PATCH v2] net/ixgbe: fix link status

Cui, LunyuanX lunyuanx.cui at intel.com
Thu Nov 14 04:45:53 CET 2019


Hi, Ilya Maximets

Before my patch, original treatment is as follows:
	esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP);
	if ((esdp_reg & IXGBE_ESDP_SDP3))
		link_up = 0;

	if (link_up == 0) {
		if (ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) {
			intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG;
			rte_eal_alarm_set(10,
				ixgbe_dev_setup_link_alarm_handler, dev);
		}
		return rte_eth_linkstatus_set(dev, &link);
	}

ixgbe_dev_setup_link_alarm_handler() can cause link status change from down to up.
When port stops, link status should always be down. When bug which you fixed occur, link status is down.
But this treatment can't confirm whether the reason is. I thank port status should be used as judgment.
If port stops, we don’t need to ensure link status is updated.

If I change patch like this, will it affect your bug?

Looking forward to your reply.
Thanks
Lunyuan.

> -----Original Message-----
> From: Ilya Maximets [mailto:i.maximets at ovn.org]
> Sent: Wednesday, November 13, 2019 11:07 PM
> To: Cui, LunyuanX <lunyuanx.cui at intel.com>; dev at dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu at intel.com>; Yang, Qiming
> <qiming.yang at intel.com>; stable at dpdk.org; Laurent Hardy
> <laurent.hardy at 6wind.com>; Wei Dai <wei.dai at intel.com>; Ye, Xiaolong
> <xiaolong.ye at intel.com>
> Subject: Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix link status
> 
> On 13.11.2019 17:34, Cui LunyuanX wrote:
> > After ports reset, tx laser register will be reset. The link status
> > for 82599eb got from link status register was not correct.
> > Set tx laser disabled after ports reset.
> >
> > ixgbe_dev_setup_link_alarm_handler() will set tx laser enabled when
> > show port information. The purpose of the function has already
> > implemented in ixgbe_dev_start(). There is no need to reuse it in
> > ixgbe_dev_link_update_share().
> 
> The reason why the alarm handler stays there is the one described in
> following commit:
> 
> commit c12d22f65b132c56db7b4fdbfd5ddce27d1e9572
> Author: Laurent Hardy <laurent.hardy at 6wind.com>
> Date:   Thu Apr 27 17:03:42 2017 +0200
> 
>     net/ixgbe: ensure link status is updated
> 
>     In case of fiber and link speed set to 1Gb at peer side (with autoneg
>     or with defined speed), link status could be not properly updated at
>     time cable is plugged-in.
>     Indeed if cable was not plugged when device has been configured and
>     started then link status will not be updated properly with new speed
>     as no link setup will be triggered.
> 
>     To avoid this issue, IXGBE_FLAG_NEED_LINK_CONFIG is set to try a link
>     setup each time link_update() is triggered and current link status is
>     down. When cable is plugged-in, link setup will be performed via
>     ixgbe_setup_link().
> 
>     Signed-off-by: Laurent Hardy <laurent.hardy at 6wind.com>
>     Acked-by: Wei Dai <wei.dai at intel.com>
> 
> Does it fixed?
> If not, you should not touch the alarm handler or implement a different
> workaround.
> 
> Best regards, Ilya Maximets.


More information about the stable mailing list