DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix condition for calling mlx5_link_update_unlocked_gset
@ 2019-06-11  6:28 Asaf Penso
  2019-06-11  6:36 ` Shahaf Shuler
  0 siblings, 1 reply; 5+ messages in thread
From: Asaf Penso @ 2019-06-11  6:28 UTC (permalink / raw)
  To: Yongseok Koh, Shahaf Shuler; +Cc: dev, srinivas.narayan, stable

mlx5_link_update uses the newer ethtool command
ETHTOOL_GLINKSETTINGS to determine interface capabilities but falls
back to the older (deprecated) ETHTOOL_GSET command if the new
method fails for any reason.
The older method only supports reporting of capabilities up to 40G.

However, mlx5_link_update_unlocked_gs can return a failure for a
number of reasons (including the link being down).
Using the older method in cases of transient failure of the method
can result in reporting of reduced capabilities to the application.

The older method (mlx5_link_update_unlocked_gset) should only be
invoked if the newer method returns EOPNOTSUPP.

Ref: https://bugs.dpdk.org/show_bug.cgi?id=289
Fixes: 7d2e32f7 ("net/mlx5: fix ethtool link setting call order")
Cc: stable@dpdk.org

Signed-off-by: Asaf Penso <asafp@mellanox.com>
Reported-by: Srinivas Narayan <srinivas.narayan@att.com>
---
 drivers/net/mlx5/mlx5_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index ac0500a..61e12cc 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -947,7 +947,7 @@ int mlx5_fw_version_get(struct rte_eth_dev *dev, char *fw_ver, size_t fw_size)
 
 	do {
 		ret = mlx5_link_update_unlocked_gs(dev, &dev_link);
-		if (ret)
+		if (ret == -ENOTSUP)
 			ret = mlx5_link_update_unlocked_gset(dev, &dev_link);
 		if (ret == 0)
 			break;
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] net/mlx5: fix condition for calling mlx5_link_update_unlocked_gset
  2019-06-11  6:28 [dpdk-dev] [PATCH] net/mlx5: fix condition for calling mlx5_link_update_unlocked_gset Asaf Penso
@ 2019-06-11  6:36 ` Shahaf Shuler
  0 siblings, 0 replies; 5+ messages in thread
From: Shahaf Shuler @ 2019-06-11  6:36 UTC (permalink / raw)
  To: Asaf Penso, Yongseok Koh; +Cc: dev, srinivas.narayan, stable

Srinivas, 

Tuesday, June 11, 2019 9:29 AM, Asaf Penso:
> Subject: [PATCH] net/mlx5: fix condition for calling
> mlx5_link_update_unlocked_gset
> 
> mlx5_link_update uses the newer ethtool command
> ETHTOOL_GLINKSETTINGS to determine interface capabilities but falls back
> to the older (deprecated) ETHTOOL_GSET command if the new method fails
> for any reason.
> The older method only supports reporting of capabilities up to 40G.
> 
> However, mlx5_link_update_unlocked_gs can return a failure for a number
> of reasons (including the link being down).
> Using the older method in cases of transient failure of the method can result
> in reporting of reduced capabilities to the application.
> 
> The older method (mlx5_link_update_unlocked_gset) should only be
> invoked if the newer method returns EOPNOTSUPP.
> 
> Ref: https://bugs.dpdk.org/show_bug.cgi?id=289
> Fixes: 7d2e32f7 ("net/mlx5: fix ethtool link setting call order")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Asaf Penso <asafp@mellanox.com>
> Reported-by: Srinivas Narayan <srinivas.narayan@att.com>

Can you confirm this patch fixes the issue you reported on?

> ---
>  drivers/net/mlx5/mlx5_ethdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_ethdev.c
> b/drivers/net/mlx5/mlx5_ethdev.c index ac0500a..61e12cc 100644
> --- a/drivers/net/mlx5/mlx5_ethdev.c
> +++ b/drivers/net/mlx5/mlx5_ethdev.c
> @@ -947,7 +947,7 @@ int mlx5_fw_version_get(struct rte_eth_dev *dev,
> char *fw_ver, size_t fw_size)
> 
>  	do {
>  		ret = mlx5_link_update_unlocked_gs(dev, &dev_link);
> -		if (ret)
> +		if (ret == -ENOTSUP)
>  			ret = mlx5_link_update_unlocked_gset(dev,
> &dev_link);
>  		if (ret == 0)
>  			break;
> --
> 1.8.3.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] net/mlx5: fix condition for calling mlx5_link_update_unlocked_gset
  2019-06-19  9:52 Asaf Penso
  2019-07-02 15:03 ` Slava Ovsiienko
@ 2019-07-02 15:30 ` Raslan Darawsheh
  1 sibling, 0 replies; 5+ messages in thread
From: Raslan Darawsheh @ 2019-07-02 15:30 UTC (permalink / raw)
  To: Asaf Penso, Yongseok Koh, Shahaf Shuler; +Cc: dev, srinivas.narayan, stable

Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Asaf Penso
> Sent: Wednesday, June 19, 2019 12:53 PM
> To: Yongseok Koh <yskoh@mellanox.com>; Shahaf Shuler
> <shahafs@mellanox.com>
> Cc: dev@dpdk.org; srinivas.narayan@att.com; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix condition for calling
> mlx5_link_update_unlocked_gset
> 
> mlx5_link_update uses the newer ethtool command
> ETHTOOL_GLINKSETTINGS to determine interface capabilities but falls back
> to the older (deprecated) ETHTOOL_GSET command if the new method fails
> for any reason.
> The older method only supports reporting of capabilities up to 40G.
> 
> However, mlx5_link_update_unlocked_gs can return a failure for a number
> of reasons (including the link being down).
> Using the older method in cases of transient failure of the method can result
> in reporting of reduced capabilities to the application.
> 
> The older method (mlx5_link_update_unlocked_gset) should only be
> invoked if the newer method returns EOPNOTSUPP.
> 
> Fixes: 7d2e32f7 ("net/mlx5: fix ethtool link setting call order")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Asaf Penso <asafp@mellanox.com>
> Reported-by: Srinivas Narayan <srinivas.narayan@att.com>
> ---
>  drivers/net/mlx5/mlx5_ethdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_ethdev.c
> b/drivers/net/mlx5/mlx5_ethdev.c index ac0500a..61e12cc 100644
> --- a/drivers/net/mlx5/mlx5_ethdev.c
> +++ b/drivers/net/mlx5/mlx5_ethdev.c
> @@ -947,7 +947,7 @@ int mlx5_fw_version_get(struct rte_eth_dev *dev,
> char *fw_ver, size_t fw_size)
> 
>  	do {
>  		ret = mlx5_link_update_unlocked_gs(dev, &dev_link);
> -		if (ret)
> +		if (ret == -ENOTSUP)
>  			ret = mlx5_link_update_unlocked_gset(dev,
> &dev_link);
>  		if (ret == 0)
>  			break;
> --
> 1.8.3.1

Patch applied to next-net-mlx

Kindest regards,
Raslan Darawsheh

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] net/mlx5: fix condition for calling mlx5_link_update_unlocked_gset
  2019-06-19  9:52 Asaf Penso
@ 2019-07-02 15:03 ` Slava Ovsiienko
  2019-07-02 15:30 ` Raslan Darawsheh
  1 sibling, 0 replies; 5+ messages in thread
From: Slava Ovsiienko @ 2019-07-02 15:03 UTC (permalink / raw)
  To: Asaf Penso, Yongseok Koh, Shahaf Shuler; +Cc: dev, srinivas.narayan, stable

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Asaf Penso
> Sent: Wednesday, June 19, 2019 12:53
> To: Yongseok Koh <yskoh@mellanox.com>; Shahaf Shuler
> <shahafs@mellanox.com>
> Cc: dev@dpdk.org; srinivas.narayan@att.com; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix condition for calling
> mlx5_link_update_unlocked_gset
> 
> mlx5_link_update uses the newer ethtool command
> ETHTOOL_GLINKSETTINGS to determine interface capabilities but falls
> back to the older (deprecated) ETHTOOL_GSET command if the new
> method fails for any reason.
> The older method only supports reporting of capabilities up to 40G.
> 
> However, mlx5_link_update_unlocked_gs can return a failure for a
> number of reasons (including the link being down).
> Using the older method in cases of transient failure of the method
> can result in reporting of reduced capabilities to the application.
> 
> The older method (mlx5_link_update_unlocked_gset) should only be
> invoked if the newer method returns EOPNOTSUPP.
> 
> Fixes: 7d2e32f7 ("net/mlx5: fix ethtool link setting call order")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Asaf Penso <asafp@mellanox.com>
> Reported-by: Srinivas Narayan <srinivas.narayan@att.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>

> ---
>  drivers/net/mlx5/mlx5_ethdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_ethdev.c
> b/drivers/net/mlx5/mlx5_ethdev.c
> index ac0500a..61e12cc 100644
> --- a/drivers/net/mlx5/mlx5_ethdev.c
> +++ b/drivers/net/mlx5/mlx5_ethdev.c
> @@ -947,7 +947,7 @@ int mlx5_fw_version_get(struct rte_eth_dev *dev,
> char *fw_ver, size_t fw_size)
> 
>  	do {
>  		ret = mlx5_link_update_unlocked_gs(dev, &dev_link);
> -		if (ret)
> +		if (ret == -ENOTSUP)
>  			ret = mlx5_link_update_unlocked_gset(dev,
> &dev_link);
>  		if (ret == 0)
>  			break;
> --
> 1.8.3.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev] [PATCH] net/mlx5: fix condition for calling mlx5_link_update_unlocked_gset
@ 2019-06-19  9:52 Asaf Penso
  2019-07-02 15:03 ` Slava Ovsiienko
  2019-07-02 15:30 ` Raslan Darawsheh
  0 siblings, 2 replies; 5+ messages in thread
From: Asaf Penso @ 2019-06-19  9:52 UTC (permalink / raw)
  To: yskoh, shahafs; +Cc: dev, srinivas.narayan, stable

mlx5_link_update uses the newer ethtool command
ETHTOOL_GLINKSETTINGS to determine interface capabilities but falls
back to the older (deprecated) ETHTOOL_GSET command if the new
method fails for any reason.
The older method only supports reporting of capabilities up to 40G.

However, mlx5_link_update_unlocked_gs can return a failure for a
number of reasons (including the link being down).
Using the older method in cases of transient failure of the method
can result in reporting of reduced capabilities to the application.

The older method (mlx5_link_update_unlocked_gset) should only be
invoked if the newer method returns EOPNOTSUPP.

Fixes: 7d2e32f7 ("net/mlx5: fix ethtool link setting call order")
Cc: stable@dpdk.org

Signed-off-by: Asaf Penso <asafp@mellanox.com>
Reported-by: Srinivas Narayan <srinivas.narayan@att.com>
---
 drivers/net/mlx5/mlx5_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index ac0500a..61e12cc 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -947,7 +947,7 @@ int mlx5_fw_version_get(struct rte_eth_dev *dev, char *fw_ver, size_t fw_size)
 
 	do {
 		ret = mlx5_link_update_unlocked_gs(dev, &dev_link);
-		if (ret)
+		if (ret == -ENOTSUP)
 			ret = mlx5_link_update_unlocked_gset(dev, &dev_link);
 		if (ret == 0)
 			break;
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-07-02 15:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-11  6:28 [dpdk-dev] [PATCH] net/mlx5: fix condition for calling mlx5_link_update_unlocked_gset Asaf Penso
2019-06-11  6:36 ` Shahaf Shuler
2019-06-19  9:52 Asaf Penso
2019-07-02 15:03 ` Slava Ovsiienko
2019-07-02 15:30 ` Raslan Darawsheh

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).