DPDK patches and discussions
 help / color / mirror / Atom feed
From: Slava Ovsiienko <viacheslavo@mellanox.com>
To: Jack Min <jackmin@mellanox.com>,
	Shahaf Shuler <shahafs@mellanox.com>,
	Yongseok Koh <yskoh@mellanox.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix link speed info when link is down
Date: Mon, 5 Aug 2019 13:39:35 +0000	[thread overview]
Message-ID: <AM4PR05MB32657087E8EEAFB849E4D301D2DA0@AM4PR05MB3265.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <4b0167f58ced8ae76262b0accbf14a4653b29283.1564991888.git.jackmin@mellanox.com>

> -----Original Message-----
> From: Xiaoyu Min <jackmin@mellanox.com>
> Sent: Monday, August 5, 2019 11:02
> To: Shahaf Shuler <shahafs@mellanox.com>; Yongseok Koh
> <yskoh@mellanox.com>; Slava Ovsiienko <viacheslavo@mellanox.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix link speed info when link is down
> 
> When the link is down, the link speed returned by ethtool is UINT32_MAX
> and the link status is 0.
> 
> In this case, the DPDK ethdev link speed should be set to
> ETH_SPEED_NUM_NONE.
> Otherwise since link speed is non-zero but link status is zero, this is an
> inconsistent situation and -EAGAIN is returned, which is not right.
> 
> Fixes: 188408719888 ("net/mlx5: fix support for newer link speeds")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>

> ---
>  drivers/net/mlx5/mlx5_ethdev.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_ethdev.c
> b/drivers/net/mlx5/mlx5_ethdev.c index 9629cfb333..33a32fc2fa 100644
> --- a/drivers/net/mlx5/mlx5_ethdev.c
> +++ b/drivers/net/mlx5/mlx5_ethdev.c
> @@ -908,7 +908,8 @@ mlx5_link_update_unlocked_gs(struct rte_eth_dev
> *dev,
>  			dev->data->port_id, strerror(rte_errno));
>  		return ret;
>  	}
> -	dev_link.link_speed = ecmd->speed;
> +	dev_link.link_speed = (ecmd->speed == UINT32_MAX) ?
> ETH_SPEED_NUM_NONE :
> +							    ecmd->speed;
>  	sc = ecmd->link_mode_masks[0] |
>  		((uint64_t)ecmd->link_mode_masks[1] << 32);
>  	priv->link_speed_capa = 0;
> --
> 2.21.0


  reply	other threads:[~2019-08-05 13:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-05  8:02 Xiaoyu Min
2019-08-05 13:39 ` Slava Ovsiienko [this message]
2019-08-05 15:16 ` Raslan Darawsheh

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=AM4PR05MB32657087E8EEAFB849E4D301D2DA0@AM4PR05MB3265.eurprd05.prod.outlook.com \
    --to=viacheslavo@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=jackmin@mellanox.com \
    --cc=shahafs@mellanox.com \
    --cc=stable@dpdk.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).