On 14.11.2019 4:45, Cui, LunyuanX wrote: > 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?
At first, your 'Fixes' tag is not correct because patch 0408f47ba4d6 only changed direct ixgbe_setup_link() call to delayed alarm handler. You may add some more conditions in order to not schedule the handler if adapter is stopped, but don't remove the workaround completely. Best regards, Ilya Maximets. > > Looking forward to your reply. > Thanks > Lunyuan. > >> -----Original Message----- >> From: Ilya Maximets [mailto:i.maxim...@ovn.org] >> Sent: Wednesday, November 13, 2019 11:07 PM >> To: Cui, LunyuanX <lunyuanx....@intel.com>; dev@dpdk.org >> Cc: Lu, Wenzhuo <wenzhuo...@intel.com>; Yang, Qiming >> <qiming.y...@intel.com>; sta...@dpdk.org; Laurent Hardy >> <laurent.ha...@6wind.com>; Wei Dai <wei....@intel.com>; Ye, Xiaolong >> <xiaolong...@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.ha...@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.ha...@6wind.com> >> Acked-by: Wei Dai <wei....@intel.com> >> >> Does it fixed? >> If not, you should not touch the alarm handler or implement a different >> workaround. >> >> Best regards, Ilya Maximets.