From: Greg Kroah-Hartman Date: Fri, 12 Mar 2021 12:41:22 +0000 (+0100) Subject: 4.19-stable patches X-Git-Tag: v4.4.262~105 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d08f0897dd3054db66ff38de8add839ac6c63b58;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: net-mlx4_en-update-moderation-when-config-reset.patch net-stmmac-fix-incorrect-dma-channel-intr-enable-setting-of-eqos-v4.10.patch --- diff --git a/queue-4.19/net-mlx4_en-update-moderation-when-config-reset.patch b/queue-4.19/net-mlx4_en-update-moderation-when-config-reset.patch new file mode 100644 index 00000000000..c2b2e56fd1d --- /dev/null +++ b/queue-4.19/net-mlx4_en-update-moderation-when-config-reset.patch @@ -0,0 +1,80 @@ +From 00ff801bb8ce6711e919af4530b6ffa14a22390a Mon Sep 17 00:00:00 2001 +From: "Kevin(Yudong) Yang" +Date: Wed, 3 Mar 2021 09:43:54 -0500 +Subject: net/mlx4_en: update moderation when config reset + +From: Kevin(Yudong) Yang + +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 +Reviewed-by: Eric Dumazet +Reviewed-by: Neal Cardwell +CC: Tariq Toukan +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + 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, t; + int err = 0; +--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c ++++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +@@ -3667,6 +3667,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); + kfree(tmp); +--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h ++++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +@@ -798,6 +798,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); diff --git a/queue-4.19/net-stmmac-fix-incorrect-dma-channel-intr-enable-setting-of-eqos-v4.10.patch b/queue-4.19/net-stmmac-fix-incorrect-dma-channel-intr-enable-setting-of-eqos-v4.10.patch new file mode 100644 index 00000000000..cbdafa564f5 --- /dev/null +++ b/queue-4.19/net-stmmac-fix-incorrect-dma-channel-intr-enable-setting-of-eqos-v4.10.patch @@ -0,0 +1,57 @@ +From 879c348c35bb5fb758dd881d8a97409c1862dae8 Mon Sep 17 00:00:00 2001 +From: Ong Boon Leong +Date: Wed, 3 Mar 2021 20:38:40 +0530 +Subject: net: stmmac: fix incorrect DMA channel intr enable setting of EQoS v4.10 + +From: Ong Boon Leong + +commit 879c348c35bb5fb758dd881d8a97409c1862dae8 upstream. + +We introduce dwmac410_dma_init_channel() here for both EQoS v4.10 and +above which use different DMA_CH(n)_Interrupt_Enable bit definitions for +NIE and AIE. + +Fixes: 48863ce5940f ("stmmac: add DMA support for GMAC 4.xx") +Signed-off-by: Ong Boon Leong +Signed-off-by: Ramesh Babu B +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c | 19 ++++++++++++++++++- + 1 file changed, 18 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c +@@ -119,6 +119,23 @@ static void dwmac4_dma_init_channel(void + ioaddr + DMA_CHAN_INTR_ENA(chan)); + } + ++static void dwmac410_dma_init_channel(void __iomem *ioaddr, ++ struct stmmac_dma_cfg *dma_cfg, u32 chan) ++{ ++ u32 value; ++ ++ /* common channel control register config */ ++ value = readl(ioaddr + DMA_CHAN_CONTROL(chan)); ++ if (dma_cfg->pblx8) ++ value = value | DMA_BUS_MODE_PBL; ++ ++ writel(value, ioaddr + DMA_CHAN_CONTROL(chan)); ++ ++ /* Mask interrupts by writing to CSR7 */ ++ writel(DMA_CHAN_INTR_DEFAULT_MASK_4_10, ++ ioaddr + DMA_CHAN_INTR_ENA(chan)); ++} ++ + static void dwmac4_dma_init(void __iomem *ioaddr, + struct stmmac_dma_cfg *dma_cfg, int atds) + { +@@ -461,7 +478,7 @@ const struct stmmac_dma_ops dwmac4_dma_o + const struct stmmac_dma_ops dwmac410_dma_ops = { + .reset = dwmac4_dma_reset, + .init = dwmac4_dma_init, +- .init_chan = dwmac4_dma_init_channel, ++ .init_chan = dwmac410_dma_init_channel, + .init_rx_chan = dwmac4_dma_init_rx_chan, + .init_tx_chan = dwmac4_dma_init_tx_chan, + .axi = dwmac4_dma_axi, diff --git a/queue-4.19/series b/queue-4.19/series index 44096c79b29..335216940b7 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -17,3 +17,5 @@ revert-mm-slub-consider-rest-of-partial-list-if-acquire_slab-fails.patch sh_eth-fix-trscer-mask-for-sh771x.patch net-check-if-protocol-extracted-by-virtio_net_hdr_set_proto-is-correct.patch net-avoid-infinite-loop-in-mpls_gso_segment-when-mpls_hlen-0.patch +net-mlx4_en-update-moderation-when-config-reset.patch +net-stmmac-fix-incorrect-dma-channel-intr-enable-setting-of-eqos-v4.10.patch