DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: Shuang Han <hanshuang87@gmail.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Yang, Qiming" <qiming.yang@intel.com>
Subject: RE: [PATCH] net/ice: fix link status error when dev start
Date: Tue, 13 Dec 2022 01:50:52 +0000	[thread overview]
Message-ID: <DM4PR11MB5994BB69D65B2DCB4CA35197D7E39@DM4PR11MB5994.namprd11.prod.outlook.com> (raw)
In-Reply-To: <1669207333-8769-1-git-send-email-hanshuang87@gmail.com>



> -----Original Message-----
> From: Shuang Han <hanshuang87@gmail.com>
> Sent: Wednesday, November 23, 2022 8:42 PM
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Shuang Han <hanshuang87@gmail.com>
> Subject: [PATCH] net/ice: fix link status error when dev start
> 
> ice_link_update get port link status and wait for one second when dev start.
> If the device need almost one second for link up, ice_link_update will enter
> the last rte_delay_ms(CHECK_INTERVAL) with link down, in the meantime
> link interrupt raised, the interrupt handler update dev->data->dev_link to up.
> After a while the rte_delay_ms(CHECK_INTERVAL) finished and update dev-
> >data->dev_link to down.
> 
> Signed-off-by: Shuang Han <hanshuang87@gmail.com>
> ---
>  drivers/net/ice/ice_ethdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index
> 0bc739d..316ba5a 100644
> --- a/drivers/net/ice/ice_ethdev.c
> +++ b/drivers/net/ice/ice_ethdev.c
> @@ -4013,9 +4013,9 @@ static int ice_init_rss(struct ice_pf *pf)
>  			      RTE_ETH_LINK_SPEED_FIXED);
> 
>  out:
> -	ice_atomic_write_link_status(dev, &link);
>  	if (link.link_status == old.link_status)
>  		return -1;
> +	ice_atomic_write_link_status(dev, &link);

This looks like a workaround, I think we may need some lock to prevent ice_link_update be re-entered from different thread at same time.

> 
>  	return 0;
>  }
> --
> 1.8.3.1


  reply	other threads:[~2022-12-13  1:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23 12:42 Shuang Han
2022-12-13  1:50 ` Zhang, Qi Z [this message]
2022-12-13  3:12   ` Shuang Han

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=DM4PR11MB5994BB69D65B2DCB4CA35197D7E39@DM4PR11MB5994.namprd11.prod.outlook.com \
    --to=qi.z.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=hanshuang87@gmail.com \
    --cc=qiming.yang@intel.com \
    /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).