From: "Nélio Laranjeiro" <nelio.laranjeiro@6wind.com>
To: Yuanhan Liu <yliu@fridaylinux.org>
Cc: dev@dpdk.org, Adrien Mazarguil <adrien.mazarguil@6wind.com>,
Yongseok Koh <yskoh@mellanox.com>,
Shahaf Shuler <shahafs@mellanox.com>,
stable@dpdk.org
Subject: Re: [dpdk-stable] [PATCH] net/mlx5: fix link speed
Date: Mon, 5 Feb 2018 13:28:37 +0100 [thread overview]
Message-ID: <20180205122837.g62yquxw6uzgh2mu@laranjeiro-vm.dev.6wind.com> (raw)
In-Reply-To: <1517832104-2800-1-git-send-email-yliu@fridaylinux.org>
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)
> + 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
next prev parent reply other threads:[~2018-02-05 12:28 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 [this message]
2018-02-05 13:39 ` Shahaf Shuler
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=20180205122837.g62yquxw6uzgh2mu@laranjeiro-vm.dev.6wind.com \
--to=nelio.laranjeiro@6wind.com \
--cc=adrien.mazarguil@6wind.com \
--cc=dev@dpdk.org \
--cc=shahafs@mellanox.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).