patches for DPDK stable branches
 help / color / mirror / Atom feed
* Re: [PATCH] net/ixgbe: do not update link status in secondary process
       [not found] ` <20240320173407.216307-1-stephen@networkplumber.org>
@ 2024-04-04 14:56   ` Bruce Richardson
  0 siblings, 0 replies; only message in thread
From: Bruce Richardson @ 2024-04-04 14:56 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev, junwang01, stable

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@dpdk.org

> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> Reported-by: Jun Wang <junwang01@cestc.cn>

Acked-by: Bruce Richardson <bruce.richardson@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
> 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-04 14:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1710865092-2796-1-git-send-email-junwang01@cestc.cn>
     [not found] ` <20240320173407.216307-1-stephen@networkplumber.org>
2024-04-04 14:56   ` [PATCH] net/ixgbe: do not update link status in secondary process Bruce Richardson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).