DPDK patches and discussions
 help / color / mirror / Atom feed
From: Matan Azrad <matan@mellanox.com>
To: "Benoît Ganne" <bganne@cisco.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix link state update
Date: Sun, 29 Mar 2020 07:00:45 +0000	[thread overview]
Message-ID: <AM0PR0502MB40198893D194CF61BA15FF84D2CA0@AM0PR0502MB4019.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <20200327172449.6514-1-bganne@cisco.com>

Hi

 From: Benoît Ganne
> mlx5 PMD refuses to update link state if link speed is defined but status is
> down or if link speed is undefined but status is up, even if the ioctl()
> succeeded.
> This prevents application to detect link up/down event, especially when the
> link speed is not correctly detected.

Do you use the wait option? Or no wait?

> As link speed is nice to have whereas link status is mandatory for operations,
> always update link state regardless of link speed. The application can then
> check link speed if needs be.

Is it documented well? I didn't find doc\description says link speed is best effort.

PMD cannot guess whether link speed is mandatory for the user or not....

I think, at least you should update ethdev relevant API descriptions and get agreement from more PMD maintainers... 

 
> Signed-off-by: Benoît Ganne <bganne@cisco.com>
> ---
> 
> Following the discussion on dpdk-users [1], I am submitting a tentative patch.
> [1]
> https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmails.
> dpdk.org%2Farchives%2Fusers%2F2020-
> March%2Fthread.html%234744&amp;data=02%7C01%7Cmatan%40mellanox.
> com%7C2cb881fc068c434e2f6b08d7d273c924%7Ca652971c7d2e4d9ba6a4d14
> 9256f461b%7C0%7C0%7C637209267055735109&amp;sdata=WV%2Fsd%2B%2
> BKssI3d8uxMf8cqackb%2FHrpqRIWOos2BWynU4%3D&amp;reserved=0
> 
>  drivers/net/mlx5/mlx5_ethdev.c | 10 ----------
>  1 file changed, 10 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_ethdev.c
> b/drivers/net/mlx5/mlx5_ethdev.c index d7d3bc73c..c15f4d62b 100644
> --- a/drivers/net/mlx5/mlx5_ethdev.c
> +++ b/drivers/net/mlx5/mlx5_ethdev.c
> @@ -896,11 +896,6 @@ mlx5_link_update_unlocked_gset(struct
> rte_eth_dev *dev,
>  				ETH_LINK_HALF_DUPLEX :
> ETH_LINK_FULL_DUPLEX);
>  	dev_link.link_autoneg = !(dev->data->dev_conf.link_speeds &
>  			ETH_LINK_SPEED_FIXED);
> -	if (((dev_link.link_speed && !dev_link.link_status) ||
> -	     (!dev_link.link_speed && dev_link.link_status))) {
> -		rte_errno = EAGAIN;
> -		return -rte_errno;
> -	}
>  	*link = dev_link;
>  	return 0;
>  }
> @@ -1032,11 +1027,6 @@ mlx5_link_update_unlocked_gs(struct
> rte_eth_dev *dev,
>  				ETH_LINK_HALF_DUPLEX :
> ETH_LINK_FULL_DUPLEX);
>  	dev_link.link_autoneg = !(dev->data->dev_conf.link_speeds &
>  				  ETH_LINK_SPEED_FIXED);
> -	if (((dev_link.link_speed && !dev_link.link_status) ||
> -	     (!dev_link.link_speed && dev_link.link_status))) {
> -		rte_errno = EAGAIN;
> -		return -rte_errno;
> -	}
>  	*link = dev_link;
>  	return 0;
>  }
> --
> 2.17.1


  reply	other threads:[~2020-03-29  7:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-27 17:24 Benoît Ganne
2020-03-29  7:00 ` Matan Azrad [this message]
2020-03-30  9:55   ` Benoit Ganne (bganne)
2020-03-30 10:12     ` Matan Azrad
2020-03-30 12:03       ` Benoit Ganne (bganne)
2020-03-30 13:44         ` Matan Azrad
2020-03-30 13:53           ` Benoit Ganne (bganne)
2020-03-30 16:13             ` Matan Azrad
2020-04-01 10:17               ` Benoit Ganne (bganne)
2020-04-01 12:46                 ` Matan Azrad
2020-04-07 12:54               ` Thomas Monjalon
2020-04-07 13:41                 ` Benoit Ganne (bganne)
2020-11-19  8:30                   ` Matan Azrad
2020-11-19 14:20 ` [dpdk-dev] [PATCH v2] " Raslan Darawsheh
2020-11-19 16:27   ` Raslan Darawsheh
2020-11-19 17:48   ` Ferruh Yigit
2020-11-19 18:42     ` Thomas Monjalon
2020-11-20 10:51       ` Ferruh Yigit
2020-11-20 13:50         ` Thomas Monjalon
2020-11-20 14:21           ` Ferruh Yigit
2020-11-22 10:03             ` Raslan Darawsheh
2020-11-22 10:04   ` [dpdk-dev] [PATCH v3] net/mlx5: allow unknown link speed Raslan Darawsheh
2020-11-22 12:58     ` 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=AM0PR0502MB40198893D194CF61BA15FF84D2CA0@AM0PR0502MB4019.eurprd05.prod.outlook.com \
    --to=matan@mellanox.com \
    --cc=bganne@cisco.com \
    --cc=dev@dpdk.org \
    /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).