patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Shahaf Shuler <shahafs@mellanox.com>
To: "Nélio Laranjeiro" <nelio.laranjeiro@6wind.com>,
	"Yuanhan Liu" <yliu@fridaylinux.org>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	Adrien Mazarguil <adrien.mazarguil@6wind.com>,
	Yongseok Koh <yskoh@mellanox.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [PATCH] net/mlx5: fix link speed
Date: Mon, 5 Feb 2018 13:39:26 +0000	[thread overview]
Message-ID: <VI1PR05MB314957E3E825C16B50053E9BC3FE0@VI1PR05MB3149.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <20180205122837.g62yquxw6uzgh2mu@laranjeiro-vm.dev.6wind.com>

Monday, February 5, 2018 2:29 PM, Nélio Laranjeiro:
> Subject: Re: [PATCH] net/mlx5: fix link speed
> 
> On Mon, Feb 05, 2018 at 08:01:44PM +0800, Yuanhan Liu wrote:
> > When the link is down, mlx5 kernel driver reports the link speed as -1
> > (UNKNOWN_SPEED). We need turn it to 0 for such case, otherwise, it
> > will be re-queried again due to the link_speed is not 0, due to
> > following
> > code:
> >
> >   1201   if (((link->link_speed == 0) && link->link_status) ||
> >   1202           ((link->link_speed != 0) && !link->link_status)) {
> >   1203           /*
> >   1204            * Inconsistent status. Event likely occurred before the
> >   1205            * kernel netdevice exposes the new status.
> >   1206            */
> >
> > Fixes: 188408719888 ("net/mlx5: fix support for newer link speeds")
> >
> > Cc: stable@dpdk.org
> > Signed-off-by: Yuanhan Liu <yliu@fridaylinux.org>
> 
> Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> 
> > ---
> >  drivers/net/mlx5/mlx5_ethdev.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/net/mlx5/mlx5_ethdev.c
> > b/drivers/net/mlx5/mlx5_ethdev.c index 6665076..492ca07 100644
> > --- a/drivers/net/mlx5/mlx5_ethdev.c
> > +++ b/drivers/net/mlx5/mlx5_ethdev.c
> > @@ -808,6 +808,10 @@ mlx5_link_update_unlocked_gs(struct
> rte_eth_dev *dev, int wait_to_complete)
> >  		return -1;
> >  	}
> >  	dev_link.link_speed = ecmd->speed;
> > +	if (link_speed == -1)

Looks like link_speed is not defined (code is not compiling).

> > +		dev_link.link_speed = 0;
> > +	else
> > +		dev_link.link_speed = link_speed;
> >  	sc = ecmd->link_mode_masks[0] |
> >  		((uint64_t)ecmd->link_mode_masks[1] << 32);
> >  	priv->link_speed_capa = 0;
> > --
> > 2.7.4
> >
> 
> Thanks,
> 
> --
> Nélio Laranjeiro
> 6WIND

      reply	other threads:[~2018-02-05 13:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-05 12:01 Yuanhan Liu
2018-02-05 12:28 ` Nélio Laranjeiro
2018-02-05 13:39   ` Shahaf Shuler [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=VI1PR05MB314957E3E825C16B50053E9BC3FE0@VI1PR05MB3149.eurprd05.prod.outlook.com \
    --to=shahafs@mellanox.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=nelio.laranjeiro@6wind.com \
    --cc=stable@dpdk.org \
    --cc=yliu@fridaylinux.org \
    --cc=yskoh@mellanox.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).