DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "junwang01@cestc.cn" <junwang01@cestc.cn>
Cc: dev <dev@dpdk.org>
Subject: Re: dumpcap coredump for 82599 NIC
Date: Mon, 18 Mar 2024 08:06:07 -0700	[thread overview]
Message-ID: <20240318080607.0f277b96@hermes.local> (raw)
In-Reply-To: <2024031810480057847316@cestc.cn>

On Mon, 18 Mar 2024 10:48:03 +0800
"junwang01@cestc.cn" <junwang01@cestc.cn> wrote:

> The issue indeed lies with the ixgbe driver. After making the following modifications, dpdk-dumpcap is now functioning properly.
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index d6cf00317e77b64f9822c155115f388ae62241eb..99b26f3c758b3c7ced5d59c6b27f305efe6cc33c 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -4301,48 +4301,50 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
>  	wait = 1;
>  #endif
>  
> -	if (vf)
> -		diag = ixgbevf_check_link(hw, &link_speed, &link_up, wait);
> -	else
> -		diag = ixgbe_check_link(hw, &link_speed, &link_up, wait);
> +	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
> +		if (vf)
> +			diag = ixgbevf_check_link(hw, &link_speed, &link_up, wait);
> +		else
> +			diag = ixgbe_check_link(hw, &link_speed, &link_up, wait);
>  
> -	if (diag != 0) {
> -		link.link_speed = RTE_ETH_SPEED_NUM_100M;
> -		link.link_duplex = RTE_ETH_LINK_FULL_DUPLEX;
> -		return rte_eth_linkstatus_set(dev, &link);
> -	}
> +		if (diag != 0) {
> +			link.link_speed = RTE_ETH_SPEED_NUM_100M;
> +			link.link_duplex = RTE_ETH_LINK_FULL_DUPLEX;
> +			return rte_eth_linkstatus_set(dev, &link);
> +		}
> +
> +		if (ixgbe_get_media_type(hw) == ixgbe_media_type_fiber &&
> +		    !ad->sdp3_no_tx_disable) {
> +			esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP);
> +			if ((esdp_reg & IXGBE_ESDP_SDP3))
> +				link_up = 0;
> +		}
>  
> -	if (ixgbe_get_media_type(hw) == ixgbe_media_type_fiber &&
> -	    !ad->sdp3_no_tx_disable) {
> -		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) {
> -			ixgbe_dev_wait_setup_link_complete(dev, 0);
> -			/* NOTE: review for potential ordering optimization */
> -			if (!__atomic_test_and_set(&ad->link_thread_running, __ATOMIC_SEQ_CST)) {
> -				/* To avoid race condition between threads, set
> -				 * the IXGBE_FLAG_NEED_LINK_CONFIG flag only
> -				 * when there is no link thread running.
> -				 */
> -				intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG;
> -				if (rte_thread_create_internal_control(&ad->link_thread_tid,
> -						"ixgbe-link",
> -						ixgbe_dev_setup_link_thread_handler, dev) < 0) {
> +		if (link_up == 0) {
> +			if (ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) {
> +				ixgbe_dev_wait_setup_link_complete(dev, 0);
> +				/* NOTE: review for potential ordering optimization */
> +				if (!__atomic_test_and_set(&ad->link_thread_running, __ATOMIC_SEQ_CST)) {
> +					/* To avoid race condition between threads, set
> +					 * the IXGBE_FLAG_NEED_LINK_CONFIG flag only
> +					 * when there is no link thread running.
> +					 */
> +					intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG;
> +					if (rte_thread_create_internal_control(&ad->link_thread_tid,
> +							"ixgbe-link",
> +							ixgbe_dev_setup_link_thread_handler, dev) < 0) {
> +						PMD_DRV_LOG(ERR,
> +							"Create link thread failed!");
> +						/* NOTE: review for potential ordering optimization */
> +						__atomic_clear(&ad->link_thread_running, __ATOMIC_SEQ_CST);
> +					}
> +				} else {
>  					PMD_DRV_LOG(ERR,
> -						"Create link thread failed!");
> -					/* NOTE: review for potential ordering optimization */
> -					__atomic_clear(&ad->link_thread_running, __ATOMIC_SEQ_CST);
> +						"Other link thread is running now!");
>  				}
> -			} else {
> -				PMD_DRV_LOG(ERR,
> -					"Other link thread is running now!");
>  			}
> +			return rte_eth_linkstatus_set(dev, &link);
>  		}
> -		return rte_eth_linkstatus_set(dev, &link);
>  	}
>  
>  	link.link_status = RTE_ETH_LINK_UP;
> 
>

Please send this to mailing list.
Ideally it would go to Ixgbe maintainer but there doesn't appear to be one right now.


      reply	other threads:[~2024-03-18 15:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13  2:00 junwang01
2024-03-13 16:29 ` Stephen Hemminger
2024-03-14  9:22   ` junwang01
2024-03-18  2:48     ` junwang01
2024-03-18 15:06       ` Stephen Hemminger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240318080607.0f277b96@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=junwang01@cestc.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).