]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Mar 2021 12:40:32 +0000 (13:40 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Mar 2021 12:40:32 +0000 (13:40 +0100)
added patches:
net-mlx4_en-update-moderation-when-config-reset.patch

queue-4.4/net-mlx4_en-update-moderation-when-config-reset.patch [new file with mode: 0644]
queue-4.4/series

diff --git a/queue-4.4/net-mlx4_en-update-moderation-when-config-reset.patch b/queue-4.4/net-mlx4_en-update-moderation-when-config-reset.patch
new file mode 100644 (file)
index 0000000..e85cf08
--- /dev/null
@@ -0,0 +1,80 @@
+From 00ff801bb8ce6711e919af4530b6ffa14a22390a Mon Sep 17 00:00:00 2001
+From: "Kevin(Yudong) Yang" <yyd@google.com>
+Date: Wed, 3 Mar 2021 09:43:54 -0500
+Subject: net/mlx4_en: update moderation when config reset
+
+From: Kevin(Yudong) Yang <yyd@google.com>
+
+commit 00ff801bb8ce6711e919af4530b6ffa14a22390a upstream.
+
+This patch fixes a bug that the moderation config will not be
+applied when calling mlx4_en_reset_config. For example, when
+turning on rx timestamping, mlx4_en_reset_config() will be called,
+causing the NIC to forget previous moderation config.
+
+This fix is in phase with a previous fix:
+commit 79c54b6bbf06 ("net/mlx4_en: Fix TX moderation info loss
+after set_ringparam is called")
+
+Tested: Before this patch, on a host with NIC using mlx4, run
+netserver and stream TCP to the host at full utilization.
+$ sar -I SUM 1
+                 INTR    intr/s
+14:03:56          sum  48758.00
+
+After rx hwtstamp is enabled:
+$ sar -I SUM 1
+14:10:38          sum 317771.00
+We see the moderation is not working properly and issued 7x more
+interrupts.
+
+After the patch, and turned on rx hwtstamp, the rate of interrupts
+is as expected:
+$ sar -I SUM 1
+14:52:11          sum  49332.00
+
+Fixes: 79c54b6bbf06 ("net/mlx4_en: Fix TX moderation info loss after set_ringparam is called")
+Signed-off-by: Kevin(Yudong) Yang <yyd@google.com>
+Reviewed-by: Eric Dumazet <edumazet@google.com>
+Reviewed-by: Neal Cardwell <ncardwell@google.com>
+CC: Tariq Toukan <tariqt@nvidia.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/mellanox/mlx4/en_ethtool.c |    2 +-
+ drivers/net/ethernet/mellanox/mlx4/en_netdev.c  |    2 ++
+ drivers/net/ethernet/mellanox/mlx4/mlx4_en.h    |    1 +
+ 3 files changed, 4 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
++++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
+@@ -47,7 +47,7 @@
+ #define EN_ETHTOOL_SHORT_MASK cpu_to_be16(0xffff)
+ #define EN_ETHTOOL_WORD_MASK  cpu_to_be32(0xffffffff)
+-static int mlx4_en_moderation_update(struct mlx4_en_priv *priv)
++int mlx4_en_moderation_update(struct mlx4_en_priv *priv)
+ {
+       int i;
+       int err = 0;
+--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
++++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+@@ -3188,6 +3188,8 @@ int mlx4_en_reset_config(struct net_devi
+                       en_err(priv, "Failed starting port\n");
+       }
++      if (!err)
++              err = mlx4_en_moderation_update(priv);
+ out:
+       mutex_unlock(&mdev->state_lock);
+       netdev_features_change(dev);
+--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
++++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
+@@ -839,6 +839,7 @@ void mlx4_en_ptp_overflow_check(struct m
+ #define DEV_FEATURE_CHANGED(dev, new_features, feature) \
+       ((dev->features & feature) ^ (new_features & feature))
++int mlx4_en_moderation_update(struct mlx4_en_priv *priv);
+ int mlx4_en_reset_config(struct net_device *dev,
+                        struct hwtstamp_config ts_config,
+                        netdev_features_t new_features);
index d335c3e6ed75fcf4c47122bec899ca8f993fb207..dd4e81471aeca4950ff76a4e9e097ec905518eab 100644 (file)
@@ -11,3 +11,4 @@ revert-mm-slub-consider-rest-of-partial-list-if-acquire_slab-fails.patch
 futex-change-locking-rules.patch
 futex-cure-exit-race.patch
 futex-fix-dead-code-in-attach_to_pi_owner.patch
+net-mlx4_en-update-moderation-when-config-reset.patch