net/mlx4_en: update moderation when config reset
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: commit79c54b6bbf("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:79c54b6bbf("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>
This commit is contained in:
committed by
David S. Miller
parent
638526bb41
commit
00ff801bb8
@@ -47,7 +47,7 @@
|
|||||||
#define EN_ETHTOOL_SHORT_MASK cpu_to_be16(0xffff)
|
#define EN_ETHTOOL_SHORT_MASK cpu_to_be16(0xffff)
|
||||||
#define EN_ETHTOOL_WORD_MASK cpu_to_be32(0xffffffff)
|
#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, t;
|
int i, t;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|||||||
@@ -3554,6 +3554,8 @@ int mlx4_en_reset_config(struct net_device *dev,
|
|||||||
en_err(priv, "Failed starting port\n");
|
en_err(priv, "Failed starting port\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!err)
|
||||||
|
err = mlx4_en_moderation_update(priv);
|
||||||
out:
|
out:
|
||||||
mutex_unlock(&mdev->state_lock);
|
mutex_unlock(&mdev->state_lock);
|
||||||
kfree(tmp);
|
kfree(tmp);
|
||||||
|
|||||||
@@ -775,6 +775,7 @@ void mlx4_en_ptp_overflow_check(struct mlx4_en_dev *mdev);
|
|||||||
#define DEV_FEATURE_CHANGED(dev, new_features, feature) \
|
#define DEV_FEATURE_CHANGED(dev, new_features, feature) \
|
||||||
((dev->features & feature) ^ (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,
|
int mlx4_en_reset_config(struct net_device *dev,
|
||||||
struct hwtstamp_config ts_config,
|
struct hwtstamp_config ts_config,
|
||||||
netdev_features_t new_features);
|
netdev_features_t new_features);
|
||||||
|
|||||||
Reference in New Issue
Block a user