[PATCH] net/txgbe: fix blocking system events

Ferruh Yigit ferruh.yigit at amd.com
Thu Jun 29 16:20:26 CEST 2023


On 6/29/2023 11:07 AM, Jiawen Wu wrote:
> Refer to commit 819d0d1d57f1 ("net/ixgbe: fix blocking system events").
> Fix the same issue as ixgbe.
> 

Can you please describe the problem in this commit log, it is OK to keep
reference to the ixgbe too, but better to describe problem here.

> Replace rte alarm thread with an independent thread.
> 
> Fixes: 0c061eadec59 ("net/txgbe: add link status change")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Jiawen Wu <jiawenwu at trustnetic.com>

<...>

> +static uint32_t
> +txgbe_dev_setup_link_thread_handler(void *param)
> +{
> +	struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
> +	struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
> +	struct txgbe_interrupt *intr = TXGBE_DEV_INTR(dev);
> +	struct txgbe_adapter *ad = TXGBE_DEV_ADAPTER(dev);
> +	u32 speed;
> +	bool autoneg = false;
> +
> +	rte_thread_detach(rte_thread_self());
> +	speed = hw->phy.autoneg_advertised;
> +	if (!speed)
> +		hw->mac.get_link_capabilities(hw, &speed, &autoneg);
> +
> +	hw->mac.setup_link(hw, speed, true);
> +
> +	intr->flags &= ~TXGBE_FLAG_NEED_LINK_CONFIG;
> +	__atomic_clear(&ad->link_thread_running, __ATOMIC_SEQ_CST);
> +	return 0;
> +}
> +

'txgbe_dev_setup_link_alarm_handler()' and above new
'txgbe_dev_setup_link_thread_handler()' are smilar and share common
code, what do you think to extract common code to a function?




More information about the dev mailing list