Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bogendoerfer <tbogendoerfer@suse.de>2019-11-05 14:08:48 +0100
committerThomas Bogendoerfer <tbogendoerfer@suse.de>2019-11-05 14:09:50 +0100
commit7b2f710a61e90329687f49e3c8770d7840a61e45 (patch)
treef0737c54b5f01184e4742d207b142e3f596f7772
parent883e0b601226ff5433f9706dfcd0714d2aa61b2e (diff)
net/mlx5e: Fix ethtool self test: link speed (jsc#SLE-8464).
-rw-r--r--patches.suse/net-mlx5e-Fix-ethtool-self-test-link-speed.patch58
-rw-r--r--series.conf1
2 files changed, 59 insertions, 0 deletions
diff --git a/patches.suse/net-mlx5e-Fix-ethtool-self-test-link-speed.patch b/patches.suse/net-mlx5e-Fix-ethtool-self-test-link-speed.patch
new file mode 100644
index 0000000000..1497162d9e
--- /dev/null
+++ b/patches.suse/net-mlx5e-Fix-ethtool-self-test-link-speed.patch
@@ -0,0 +1,58 @@
+From: Aya Levin <ayal@mellanox.com>
+Date: Wed, 2 Oct 2019 16:53:21 +0300
+Subject: net/mlx5e: Fix ethtool self test: link speed
+Patch-mainline: v5.4-rc6
+Git-commit: 534e7366f41b0c689b01af4375aefcd1462adedf
+References: jsc#SLE-8464
+
+Ethtool self test contains a test for link speed. This test reads the
+PTYS register and determines whether the current speed is valid or not.
+Change current implementation to use the function mlx5e_port_linkspeed()
+that does the same check and fails when speed is invalid. This code
+redundancy lead to a bug when mlx5e_port_linkspeed() was updated with
+expended speeds and the self test was not.
+
+Fixes: 2c81bfd5ae56 ("net/mlx5e: Move port speed code from en_ethtool.c to en/port.c")
+Signed-off-by: Aya Levin <ayal@mellanox.com>
+Reviewed-by: Moshe Shemesh <moshe@mellanox.com>
+Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
+Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
+---
+ drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c | 15 +++------------
+ 1 file changed, 3 insertions(+), 12 deletions(-)
+
+--- a/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c
++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c
+@@ -35,6 +35,7 @@
+ #include <linux/udp.h>
+ #include <net/udp.h>
+ #include "en.h"
++#include "en/port.h"
+
+ enum {
+ MLX5E_ST_LINK_STATE,
+@@ -80,22 +81,12 @@ static int mlx5e_test_link_state(struct
+
+ static int mlx5e_test_link_speed(struct mlx5e_priv *priv)
+ {
+- u32 out[MLX5_ST_SZ_DW(ptys_reg)];
+- u32 eth_proto_oper;
+- int i;
++ u32 speed;
+
+ if (!netif_carrier_ok(priv->netdev))
+ return 1;
+
+- if (mlx5_query_port_ptys(priv->mdev, out, sizeof(out), MLX5_PTYS_EN, 1))
+- return 1;
+-
+- eth_proto_oper = MLX5_GET(ptys_reg, out, eth_proto_oper);
+- for (i = 0; i < MLX5E_LINK_MODES_NUMBER; i++) {
+- if (eth_proto_oper & MLX5E_PROT_MASK(i))
+- return 0;
+- }
+- return 1;
++ return mlx5e_port_linkspeed(priv->mdev, &speed);
+ }
+
+ struct mlx5ehdr {
diff --git a/series.conf b/series.conf
index 04fa8ff8a1..fdac26686e 100644
--- a/series.conf
+++ b/series.conf
@@ -2879,6 +2879,7 @@
patches.suse/net-mlx5-Fix-NULL-pointer-dereference-in-extended-de.patch
patches.suse/net-mlx5e-Don-t-store-direct-pointer-to-action-s-tun.patch
patches.suse/net-mlx5e-Fix-handling-of-compressed-CQEs-in-case-of.patch
+ patches.suse/net-mlx5e-Fix-ethtool-self-test-link-speed.patch
patches.suse/powerpc-powernv-Fix-CPU-idle-to-be-called-with-IRQs-.patch
patches.suse/scsi-qla2xxx-fixup-incorrect-usage-of-host_byte.patch
patches.suse/scsi-lpfc-Check-queue-pointer-before-use.patch