[PATCH] net/ixgbe: do not update link status in secondary process
Bruce Richardson
bruce.richardson at intel.com
Thu Apr 4 16:56:10 CEST 2024
On Wed, Mar 20, 2024 at 10:33:04AM -0700, Stephen Hemminger wrote:
> The code to update link status is not safe in secondary process.
> If called from secondary it will crash, example from dumpcap:
> ixgbe_dev_link_update_share()
> ixgbe_dev_link_update()
> rte_eth_link_get()
>
Fixes: af75078fece3 ("first public release")
Cc: stable at dpdk.org
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
> Reported-by: Jun Wang <junwang01 at cestc.cn>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
Applied to dpdk-next-net-intel.
Thanks,
/Bruce
> ---
> Simpler version of earlier patch, and add explanation.
>
> drivers/net/ixgbe/ixgbe_ethdev.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index c61c52b2966b..86ccbdd78292 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -4293,6 +4293,9 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
> int wait = 1;
> u32 esdp_reg;
>
> + if (rte_eal_process_type() != RTE_PROC_PRIMARY)
> + return -1;
> +
> memset(&link, 0, sizeof(link));
> link.link_status = RTE_ETH_LINK_DOWN;
> link.link_speed = RTE_ETH_SPEED_NUM_NONE;
> --
> 2.43.0
>
More information about the stable
mailing list