]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Jan 2020 17:26:22 +0000 (18:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Jan 2020 17:26:22 +0000 (18:26 +0100)
added patches:
devlink-wait-longer-before-warning-about-unset-port-type.patch
drm-amdgpu-allow-direct-upload-save-restore-list-for-raven2.patch
mlxsw-spectrum-do-not-modify-cloned-skbs-during-xmit.patch
mlxsw-spectrum-wipe-xstats.backlog-of-down-ports.patch
mlxsw-spectrum_qdisc-include-mc-tcs-in-qdisc-counters.patch
net-stmmac-selftests-make-it-work-in-synopsys-axs101-boards.patch
net-stmmac-selftests-mark-as-fail-when-received-vlan-id-expected.patch
net-stmmac-selftests-update-status-when-disabling-rss.patch
net-stmmac-tc-do-not-setup-flower-filtering-if-rss-is-enabled.patch
selftests-mlxsw-qos_mc_aware-fix-mausezahn-invocation.patch
sh_eth-check-sh_eth_cpu_data-dual_port-when-dumping-registers.patch

14 files changed:
queue-5.4/devlink-wait-longer-before-warning-about-unset-port-type.patch [new file with mode: 0644]
queue-5.4/drm-amdgpu-allow-direct-upload-save-restore-list-for-raven2.patch [new file with mode: 0644]
queue-5.4/mlxsw-spectrum-do-not-modify-cloned-skbs-during-xmit.patch [new file with mode: 0644]
queue-5.4/mlxsw-spectrum-wipe-xstats.backlog-of-down-ports.patch [new file with mode: 0644]
queue-5.4/mlxsw-spectrum_qdisc-include-mc-tcs-in-qdisc-counters.patch [new file with mode: 0644]
queue-5.4/net-stmmac-selftests-make-it-work-in-synopsys-axs101-boards.patch [new file with mode: 0644]
queue-5.4/net-stmmac-selftests-mark-as-fail-when-received-vlan-id-expected.patch [new file with mode: 0644]
queue-5.4/net-stmmac-selftests-update-status-when-disabling-rss.patch [new file with mode: 0644]
queue-5.4/net-stmmac-tc-do-not-setup-flower-filtering-if-rss-is-enabled.patch [new file with mode: 0644]
queue-5.4/selftests-mlxsw-qos_mc_aware-fix-mausezahn-invocation.patch [new file with mode: 0644]
queue-5.4/series
queue-5.4/sh_eth-check-sh_eth_cpu_data-dual_port-when-dumping-registers.patch [new file with mode: 0644]
queue-5.4/wimax-i2400-fix-memory-leak-in-i2400m_op_rfkill_sw_toggle.patch [deleted file]
queue-5.4/wimax-i2400-fix-memory-leak.patch [deleted file]

diff --git a/queue-5.4/devlink-wait-longer-before-warning-about-unset-port-type.patch b/queue-5.4/devlink-wait-longer-before-warning-about-unset-port-type.patch
new file mode 100644 (file)
index 0000000..e0db56f
--- /dev/null
@@ -0,0 +1,61 @@
+From 4c582234ab3948d08a24c82eb1e00436aabacbc6 Mon Sep 17 00:00:00 2001
+From: Ido Schimmel <idosch@mellanox.com>
+Date: Thu, 9 Jan 2020 19:57:41 +0200
+Subject: devlink: Wait longer before warning about unset port type
+
+From: Ido Schimmel <idosch@mellanox.com>
+
+commit 4c582234ab3948d08a24c82eb1e00436aabacbc6 upstream.
+
+The commit cited below causes devlink to emit a warning if a type was
+not set on a devlink port for longer than 30 seconds to "prevent
+misbehavior of drivers". This proved to be problematic when
+unregistering the backing netdev. The flow is always:
+
+devlink_port_type_clear()      // schedules the warning
+unregister_netdev()            // blocking
+devlink_port_unregister()      // cancels the warning
+
+The call to unregister_netdev() can block for long periods of time for
+various reasons: RTNL lock is contended, large amounts of configuration
+to unroll following dismantle of the netdev, etc. This results in
+devlink emitting a warning despite the driver behaving correctly.
+
+In emulated environments (of future hardware) which are usually very
+slow, the warning can also be emitted during port creation as more than
+30 seconds can pass between the time the devlink port is registered and
+when its type is set.
+
+In addition, syzbot has hit this warning [1] 1974 times since 07/11/19
+without being able to produce a reproducer. Probably because
+reproduction depends on the load or other bugs (e.g., RTNL not being
+released).
+
+To prevent bogus warnings, increase the timeout to 1 hour.
+
+[1] https://syzkaller.appspot.com/bug?id=e99b59e9c024a666c9f7450dc162a4b74d09d9cb
+
+Fixes: 136bf27fc0e9 ("devlink: add warning in case driver does not set port type")
+Signed-off-by: Ido Schimmel <idosch@mellanox.com>
+Reported-by: syzbot+b0a18ed7b08b735d2f41@syzkaller.appspotmail.com
+Reported-by: Alex Veber <alexve@mellanox.com>
+Tested-by: Alex Veber <alexve@mellanox.com>
+Acked-by: Jiri Pirko <jiri@mellanox.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/core/devlink.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/net/core/devlink.c
++++ b/net/core/devlink.c
+@@ -6280,7 +6280,7 @@ static bool devlink_port_type_should_war
+              devlink_port->attrs.flavour != DEVLINK_PORT_FLAVOUR_DSA;
+ }
+-#define DEVLINK_PORT_TYPE_WARN_TIMEOUT (HZ * 30)
++#define DEVLINK_PORT_TYPE_WARN_TIMEOUT (HZ * 3600)
+ static void devlink_port_type_warn_schedule(struct devlink_port *devlink_port)
+ {
diff --git a/queue-5.4/drm-amdgpu-allow-direct-upload-save-restore-list-for-raven2.patch b/queue-5.4/drm-amdgpu-allow-direct-upload-save-restore-list-for-raven2.patch
new file mode 100644 (file)
index 0000000..62fdf10
--- /dev/null
@@ -0,0 +1,36 @@
+From eebc7f4d7ffa09f2a620bd1e2c67ddd579118af9 Mon Sep 17 00:00:00 2001
+From: changzhu <Changfeng.Zhu@amd.com>
+Date: Thu, 7 Nov 2019 14:09:27 +0800
+Subject: drm/amdgpu: allow direct upload save restore list for raven2
+
+From: changzhu <Changfeng.Zhu@amd.com>
+
+commit eebc7f4d7ffa09f2a620bd1e2c67ddd579118af9 upstream.
+
+It will cause modprobe atombios stuck problem in raven2 if it doesn't
+allow direct upload save restore list from gfx driver.
+So it needs to allow direct upload save restore list for raven2
+temporarily.
+
+Signed-off-by: changzhu <Changfeng.Zhu@amd.com>
+Reviewed-by: Huang Rui <ray.huang@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
++++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+@@ -2923,7 +2923,9 @@ static void gfx_v9_0_init_pg(struct amdg
+        * And it's needed by gfxoff feature.
+        */
+       if (adev->gfx.rlc.is_rlc_v2_1) {
+-              if (adev->asic_type == CHIP_VEGA12)
++              if (adev->asic_type == CHIP_VEGA12 ||
++                  (adev->asic_type == CHIP_RAVEN &&
++                   adev->rev_id >= 8))
+                       gfx_v9_1_init_rlc_save_restore_list(adev);
+               gfx_v9_0_enable_save_restore_machine(adev);
+       }
diff --git a/queue-5.4/mlxsw-spectrum-do-not-modify-cloned-skbs-during-xmit.patch b/queue-5.4/mlxsw-spectrum-do-not-modify-cloned-skbs-during-xmit.patch
new file mode 100644 (file)
index 0000000..6afbbb4
--- /dev/null
@@ -0,0 +1,84 @@
+From 2da51ce75d86ab1f7770ac1391a9a1697ddaa60c Mon Sep 17 00:00:00 2001
+From: Ido Schimmel <idosch@mellanox.com>
+Date: Wed, 15 Jan 2020 13:53:45 +0200
+Subject: mlxsw: spectrum: Do not modify cloned SKBs during xmit
+
+From: Ido Schimmel <idosch@mellanox.com>
+
+commit 2da51ce75d86ab1f7770ac1391a9a1697ddaa60c upstream.
+
+The driver needs to prepend a Tx header to each packet it is
+transmitting. The header includes information such as the egress port
+and traffic class.
+
+The addition of the header requires the driver to modify the SKB's
+header and therefore it must not be shared. Otherwise, we risk hitting
+various race conditions.
+
+For example, when a packet is flooded (cloned) by the bridge driver to
+two switch ports swp1 and swp2:
+
+t0 - mlxsw_sp_port_xmit() is called for swp1. Tx header is prepended with
+     swp1's port number
+t1 - mlxsw_sp_port_xmit() is called for swp2. Tx header is prepended with
+     swp2's port number, overwriting swp1's port number
+t2 - The device processes data buffer from t0. Packet is transmitted via
+     swp2
+t3 - The device processes data buffer from t1. Packet is transmitted via
+     swp2
+
+Usually, the device is fast enough and transmits the packet before its
+Tx header is overwritten, but this is not the case in emulated
+environments.
+
+Fix this by making sure the SKB's header is writable by calling
+skb_cow_head(). Since the function ensures we have headroom to push the
+Tx header, the check further in the function can be removed.
+
+v2:
+* Use skb_cow_head() instead of skb_unshare() as suggested by Jakub
+* Remove unnecessary check regarding headroom
+
+Fixes: 56ade8fe3fe1 ("mlxsw: spectrum: Add initial support for Spectrum ASIC")
+Signed-off-by: Ido Schimmel <idosch@mellanox.com>
+Reported-by: Shalom Toledo <shalomt@mellanox.com>
+Acked-by: Jiri Pirko <jiri@mellanox.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/ethernet/mellanox/mlxsw/spectrum.c |   18 ++++++------------
+ 1 file changed, 6 insertions(+), 12 deletions(-)
+
+--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+@@ -812,23 +812,17 @@ static netdev_tx_t mlxsw_sp_port_xmit(st
+       u64 len;
+       int err;
++      if (skb_cow_head(skb, MLXSW_TXHDR_LEN)) {
++              this_cpu_inc(mlxsw_sp_port->pcpu_stats->tx_dropped);
++              dev_kfree_skb_any(skb);
++              return NETDEV_TX_OK;
++      }
++
+       memset(skb->cb, 0, sizeof(struct mlxsw_skb_cb));
+       if (mlxsw_core_skb_transmit_busy(mlxsw_sp->core, &tx_info))
+               return NETDEV_TX_BUSY;
+-      if (unlikely(skb_headroom(skb) < MLXSW_TXHDR_LEN)) {
+-              struct sk_buff *skb_orig = skb;
+-
+-              skb = skb_realloc_headroom(skb, MLXSW_TXHDR_LEN);
+-              if (!skb) {
+-                      this_cpu_inc(mlxsw_sp_port->pcpu_stats->tx_dropped);
+-                      dev_kfree_skb_any(skb_orig);
+-                      return NETDEV_TX_OK;
+-              }
+-              dev_consume_skb_any(skb_orig);
+-      }
+-
+       if (eth_skb_pad(skb)) {
+               this_cpu_inc(mlxsw_sp_port->pcpu_stats->tx_dropped);
+               return NETDEV_TX_OK;
diff --git a/queue-5.4/mlxsw-spectrum-wipe-xstats.backlog-of-down-ports.patch b/queue-5.4/mlxsw-spectrum-wipe-xstats.backlog-of-down-ports.patch
new file mode 100644 (file)
index 0000000..c264999
--- /dev/null
@@ -0,0 +1,67 @@
+From ca7609ff3680c51d6c29897f3117aa2ad904f92a Mon Sep 17 00:00:00 2001
+From: Petr Machata <petrm@mellanox.com>
+Date: Wed, 15 Jan 2020 13:53:48 +0200
+Subject: mlxsw: spectrum: Wipe xstats.backlog of down ports
+
+From: Petr Machata <petrm@mellanox.com>
+
+commit ca7609ff3680c51d6c29897f3117aa2ad904f92a upstream.
+
+Per-port counter cache used by Qdiscs is updated periodically, unless the
+port is down. The fact that the cache is not updated for down ports is no
+problem for most counters, which are relative in nature. However, backlog
+is absolute in nature, and if there is a non-zero value in the cache around
+the time that the port goes down, that value just stays there. This value
+then leaks to offloaded Qdiscs that report non-zero backlog even if
+there (obviously) is no traffic.
+
+The HW does not keep backlog of a downed port, so do likewise: as the port
+goes down, wipe the backlog value from xstats.
+
+Fixes: 075ab8adaf4e ("mlxsw: spectrum: Collect tclass related stats periodically")
+Signed-off-by: Petr Machata <petrm@mellanox.com>
+Acked-by: Jiri Pirko <jiri@mellanox.com>
+Signed-off-by: Ido Schimmel <idosch@mellanox.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/ethernet/mellanox/mlxsw/spectrum.c |   13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+@@ -1161,6 +1161,9 @@ static void update_stats_cache(struct wo
+                            periodic_hw_stats.update_dw.work);
+       if (!netif_carrier_ok(mlxsw_sp_port->dev))
++              /* Note: mlxsw_sp_port_down_wipe_counters() clears the cache as
++               * necessary when port goes down.
++               */
+               goto out;
+       mlxsw_sp_port_get_hw_stats(mlxsw_sp_port->dev,
+@@ -4170,6 +4173,15 @@ static int mlxsw_sp_port_unsplit(struct
+       return 0;
+ }
++static void
++mlxsw_sp_port_down_wipe_counters(struct mlxsw_sp_port *mlxsw_sp_port)
++{
++      int i;
++
++      for (i = 0; i < TC_MAX_QUEUE; i++)
++              mlxsw_sp_port->periodic_hw_stats.xstats.backlog[i] = 0;
++}
++
+ static void mlxsw_sp_pude_event_func(const struct mlxsw_reg_info *reg,
+                                    char *pude_pl, void *priv)
+ {
+@@ -4191,6 +4203,7 @@ static void mlxsw_sp_pude_event_func(con
+       } else {
+               netdev_info(mlxsw_sp_port->dev, "link down\n");
+               netif_carrier_off(mlxsw_sp_port->dev);
++              mlxsw_sp_port_down_wipe_counters(mlxsw_sp_port);
+       }
+ }
diff --git a/queue-5.4/mlxsw-spectrum_qdisc-include-mc-tcs-in-qdisc-counters.patch b/queue-5.4/mlxsw-spectrum_qdisc-include-mc-tcs-in-qdisc-counters.patch
new file mode 100644 (file)
index 0000000..c0906a4
--- /dev/null
@@ -0,0 +1,109 @@
+From 85005b82e59fa7bb7388b12594ab2067bf73d66c Mon Sep 17 00:00:00 2001
+From: Petr Machata <petrm@mellanox.com>
+Date: Wed, 15 Jan 2020 13:53:49 +0200
+Subject: mlxsw: spectrum_qdisc: Include MC TCs in Qdisc counters
+
+From: Petr Machata <petrm@mellanox.com>
+
+commit 85005b82e59fa7bb7388b12594ab2067bf73d66c upstream.
+
+mlxsw configures Spectrum in such a way that BUM traffic is passed not
+through its nominal traffic class TC, but through its MC counterpart TC+8.
+However, when collecting statistics, Qdiscs only look at the nominal TC and
+ignore the MC TC.
+
+Add two helpers to compute the value for logical TC from the constituents,
+one for backlog, the other for tail drops. Use them throughout instead of
+going through the xstats pointer directly.
+
+Counters for TX bytes and packets are deduced from packet priority
+counters, and therefore already include BUM traffic. wred_drop counter is
+irrelevant on MC TCs, because RED is not enabled on them.
+
+Fixes: 7b8195306694 ("mlxsw: spectrum: Configure MC-aware mode on mlxsw ports")
+Signed-off-by: Petr Machata <petrm@mellanox.com>
+Acked-by: Jiri Pirko <jiri@mellanox.com>
+Signed-off-by: Ido Schimmel <idosch@mellanox.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c |   30 ++++++++++++++-----
+ 1 file changed, 23 insertions(+), 7 deletions(-)
+
+--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c
++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c
+@@ -195,6 +195,20 @@ mlxsw_sp_qdisc_get_xstats(struct mlxsw_s
+       return -EOPNOTSUPP;
+ }
++static u64
++mlxsw_sp_xstats_backlog(struct mlxsw_sp_port_xstats *xstats, int tclass_num)
++{
++      return xstats->backlog[tclass_num] +
++             xstats->backlog[tclass_num + 8];
++}
++
++static u64
++mlxsw_sp_xstats_tail_drop(struct mlxsw_sp_port_xstats *xstats, int tclass_num)
++{
++      return xstats->tail_drop[tclass_num] +
++             xstats->tail_drop[tclass_num + 8];
++}
++
+ static void
+ mlxsw_sp_qdisc_bstats_per_priority_get(struct mlxsw_sp_port_xstats *xstats,
+                                      u8 prio_bitmap, u64 *tx_packets,
+@@ -269,7 +283,7 @@ mlxsw_sp_setup_tc_qdisc_red_clean_stats(
+                                              &stats_base->tx_bytes);
+       red_base->prob_mark = xstats->ecn;
+       red_base->prob_drop = xstats->wred_drop[tclass_num];
+-      red_base->pdrop = xstats->tail_drop[tclass_num];
++      red_base->pdrop = mlxsw_sp_xstats_tail_drop(xstats, tclass_num);
+       stats_base->overlimits = red_base->prob_drop + red_base->prob_mark;
+       stats_base->drops = red_base->prob_drop + red_base->pdrop;
+@@ -369,7 +383,8 @@ mlxsw_sp_qdisc_get_red_xstats(struct mlx
+       early_drops = xstats->wred_drop[tclass_num] - xstats_base->prob_drop;
+       marks = xstats->ecn - xstats_base->prob_mark;
+-      pdrops = xstats->tail_drop[tclass_num] - xstats_base->pdrop;
++      pdrops = mlxsw_sp_xstats_tail_drop(xstats, tclass_num) -
++               xstats_base->pdrop;
+       res->pdrop += pdrops;
+       res->prob_drop += early_drops;
+@@ -402,9 +417,10 @@ mlxsw_sp_qdisc_get_red_stats(struct mlxs
+       overlimits = xstats->wred_drop[tclass_num] + xstats->ecn -
+                    stats_base->overlimits;
+-      drops = xstats->wred_drop[tclass_num] + xstats->tail_drop[tclass_num] -
++      drops = xstats->wred_drop[tclass_num] +
++              mlxsw_sp_xstats_tail_drop(xstats, tclass_num) -
+               stats_base->drops;
+-      backlog = xstats->backlog[tclass_num];
++      backlog = mlxsw_sp_xstats_backlog(xstats, tclass_num);
+       _bstats_update(stats_ptr->bstats, tx_bytes, tx_packets);
+       stats_ptr->qstats->overlimits += overlimits;
+@@ -575,9 +591,9 @@ mlxsw_sp_qdisc_get_prio_stats(struct mlx
+       tx_packets = stats->tx_packets - stats_base->tx_packets;
+       for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
+-              drops += xstats->tail_drop[i];
++              drops += mlxsw_sp_xstats_tail_drop(xstats, i);
+               drops += xstats->wred_drop[i];
+-              backlog += xstats->backlog[i];
++              backlog += mlxsw_sp_xstats_backlog(xstats, i);
+       }
+       drops = drops - stats_base->drops;
+@@ -613,7 +629,7 @@ mlxsw_sp_setup_tc_qdisc_prio_clean_stats
+       stats_base->drops = 0;
+       for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
+-              stats_base->drops += xstats->tail_drop[i];
++              stats_base->drops += mlxsw_sp_xstats_tail_drop(xstats, i);
+               stats_base->drops += xstats->wred_drop[i];
+       }
diff --git a/queue-5.4/net-stmmac-selftests-make-it-work-in-synopsys-axs101-boards.patch b/queue-5.4/net-stmmac-selftests-make-it-work-in-synopsys-axs101-boards.patch
new file mode 100644 (file)
index 0000000..6bb616f
--- /dev/null
@@ -0,0 +1,91 @@
+From 0b9f932edc1a461933bfde08e620362e2190e0dd Mon Sep 17 00:00:00 2001
+From: Jose Abreu <Jose.Abreu@synopsys.com>
+Date: Tue, 14 Jan 2020 17:09:21 +0100
+Subject: net: stmmac: selftests: Make it work in Synopsys AXS101 boards
+
+From: Jose Abreu <Jose.Abreu@synopsys.com>
+
+commit 0b9f932edc1a461933bfde08e620362e2190e0dd upstream.
+
+Synopsys AXS101 boards do not support unaligned memory loads or stores.
+Change the selftests mechanism to explicity:
+- Not add extra alignment in TX SKB
+- Use the unaligned version of ether_addr_equal()
+
+Fixes: 091810dbded9 ("net: stmmac: Introduce selftests support")
+Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c |   20 +++++++++--------
+ 1 file changed, 11 insertions(+), 9 deletions(-)
+
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
+@@ -80,7 +80,7 @@ static struct sk_buff *stmmac_test_get_u
+       if (attr->max_size && (attr->max_size > size))
+               size = attr->max_size;
+-      skb = netdev_alloc_skb_ip_align(priv->dev, size);
++      skb = netdev_alloc_skb(priv->dev, size);
+       if (!skb)
+               return NULL;
+@@ -244,6 +244,8 @@ static int stmmac_test_loopback_validate
+                                        struct net_device *orig_ndev)
+ {
+       struct stmmac_test_priv *tpriv = pt->af_packet_priv;
++      unsigned char *src = tpriv->packet->src;
++      unsigned char *dst = tpriv->packet->dst;
+       struct stmmachdr *shdr;
+       struct ethhdr *ehdr;
+       struct udphdr *uhdr;
+@@ -260,15 +262,15 @@ static int stmmac_test_loopback_validate
+               goto out;
+       ehdr = (struct ethhdr *)skb_mac_header(skb);
+-      if (tpriv->packet->dst) {
+-              if (!ether_addr_equal(ehdr->h_dest, tpriv->packet->dst))
++      if (dst) {
++              if (!ether_addr_equal_unaligned(ehdr->h_dest, dst))
+                       goto out;
+       }
+       if (tpriv->packet->sarc) {
+-              if (!ether_addr_equal(ehdr->h_source, ehdr->h_dest))
++              if (!ether_addr_equal_unaligned(ehdr->h_source, ehdr->h_dest))
+                       goto out;
+-      } else if (tpriv->packet->src) {
+-              if (!ether_addr_equal(ehdr->h_source, tpriv->packet->src))
++      } else if (src) {
++              if (!ether_addr_equal_unaligned(ehdr->h_source, src))
+                       goto out;
+       }
+@@ -714,7 +716,7 @@ static int stmmac_test_flowctrl_validate
+       struct ethhdr *ehdr;
+       ehdr = (struct ethhdr *)skb_mac_header(skb);
+-      if (!ether_addr_equal(ehdr->h_source, orig_ndev->dev_addr))
++      if (!ether_addr_equal_unaligned(ehdr->h_source, orig_ndev->dev_addr))
+               goto out;
+       if (ehdr->h_proto != htons(ETH_P_PAUSE))
+               goto out;
+@@ -856,7 +858,7 @@ static int stmmac_test_vlan_validate(str
+       }
+       ehdr = (struct ethhdr *)skb_mac_header(skb);
+-      if (!ether_addr_equal(ehdr->h_dest, tpriv->packet->dst))
++      if (!ether_addr_equal_unaligned(ehdr->h_dest, tpriv->packet->dst))
+               goto out;
+       ihdr = ip_hdr(skb);
+@@ -1546,7 +1548,7 @@ static int stmmac_test_arp_validate(stru
+       struct arphdr *ahdr;
+       ehdr = (struct ethhdr *)skb_mac_header(skb);
+-      if (!ether_addr_equal(ehdr->h_dest, tpriv->packet->src))
++      if (!ether_addr_equal_unaligned(ehdr->h_dest, tpriv->packet->src))
+               goto out;
+       ahdr = arp_hdr(skb);
diff --git a/queue-5.4/net-stmmac-selftests-mark-as-fail-when-received-vlan-id-expected.patch b/queue-5.4/net-stmmac-selftests-mark-as-fail-when-received-vlan-id-expected.patch
new file mode 100644 (file)
index 0000000..815df63
--- /dev/null
@@ -0,0 +1,37 @@
+From d39b68e5a736afa67d2e9cfb158efdd237d99dbd Mon Sep 17 00:00:00 2001
+From: Jose Abreu <Jose.Abreu@synopsys.com>
+Date: Tue, 14 Jan 2020 17:09:22 +0100
+Subject: net: stmmac: selftests: Mark as fail when received VLAN ID != expected
+
+From: Jose Abreu <Jose.Abreu@synopsys.com>
+
+commit d39b68e5a736afa67d2e9cfb158efdd237d99dbd upstream.
+
+When the VLAN ID does not match the expected one it means filter failed
+in HW. Fix it.
+
+Fixes: 94e18382003c ("net: stmmac: selftests: Add selftest for VLAN TX Offload")
+Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c |    6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
+@@ -853,8 +853,12 @@ static int stmmac_test_vlan_validate(str
+       if (tpriv->vlan_id) {
+               if (skb->vlan_proto != htons(proto))
+                       goto out;
+-              if (skb->vlan_tci != tpriv->vlan_id)
++              if (skb->vlan_tci != tpriv->vlan_id) {
++                      /* Means filter did not work. */
++                      tpriv->ok = false;
++                      complete(&tpriv->comp);
+                       goto out;
++              }
+       }
+       ehdr = (struct ethhdr *)skb_mac_header(skb);
diff --git a/queue-5.4/net-stmmac-selftests-update-status-when-disabling-rss.patch b/queue-5.4/net-stmmac-selftests-update-status-when-disabling-rss.patch
new file mode 100644 (file)
index 0000000..4c82b57
--- /dev/null
@@ -0,0 +1,88 @@
+From e715d74504352968cf24ac95476706bc911a69cd Mon Sep 17 00:00:00 2001
+From: Jose Abreu <Jose.Abreu@synopsys.com>
+Date: Fri, 10 Jan 2020 16:23:52 +0100
+Subject: net: stmmac: selftests: Update status when disabling RSS
+
+From: Jose Abreu <Jose.Abreu@synopsys.com>
+
+commit e715d74504352968cf24ac95476706bc911a69cd upstream.
+
+We are disabling RSS on HW but not updating the internal private status
+to the 'disabled' state. This is needed for next tc commit that will
+check if RSS is disabled before trying to apply filters.
+
+Fixes: 4647e021193d ("net: stmmac: selftests: Add selftest for L3/L4 Filters")
+Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c |   20 +++++++++++------
+ 1 file changed, 14 insertions(+), 6 deletions(-)
+
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
+@@ -1297,16 +1297,19 @@ static int __stmmac_test_l3filt(struct s
+       struct stmmac_packet_attrs attr = { };
+       struct flow_dissector *dissector;
+       struct flow_cls_offload *cls;
++      int ret, old_enable = 0;
+       struct flow_rule *rule;
+-      int ret;
+       if (!tc_can_offload(priv->dev))
+               return -EOPNOTSUPP;
+       if (!priv->dma_cap.l3l4fnum)
+               return -EOPNOTSUPP;
+-      if (priv->rss.enable)
++      if (priv->rss.enable) {
++              old_enable = priv->rss.enable;
++              priv->rss.enable = false;
+               stmmac_rss_configure(priv, priv->hw, NULL,
+                                    priv->plat->rx_queues_to_use);
++      }
+       dissector = kzalloc(sizeof(*dissector), GFP_KERNEL);
+       if (!dissector) {
+@@ -1373,7 +1376,8 @@ cleanup_cls:
+ cleanup_dissector:
+       kfree(dissector);
+ cleanup_rss:
+-      if (priv->rss.enable) {
++      if (old_enable) {
++              priv->rss.enable = old_enable;
+               stmmac_rss_configure(priv, priv->hw, &priv->rss,
+                                    priv->plat->rx_queues_to_use);
+       }
+@@ -1418,16 +1422,19 @@ static int __stmmac_test_l4filt(struct s
+       struct stmmac_packet_attrs attr = { };
+       struct flow_dissector *dissector;
+       struct flow_cls_offload *cls;
++      int ret, old_enable = 0;
+       struct flow_rule *rule;
+-      int ret;
+       if (!tc_can_offload(priv->dev))
+               return -EOPNOTSUPP;
+       if (!priv->dma_cap.l3l4fnum)
+               return -EOPNOTSUPP;
+-      if (priv->rss.enable)
++      if (priv->rss.enable) {
++              old_enable = priv->rss.enable;
++              priv->rss.enable = false;
+               stmmac_rss_configure(priv, priv->hw, NULL,
+                                    priv->plat->rx_queues_to_use);
++      }
+       dissector = kzalloc(sizeof(*dissector), GFP_KERNEL);
+       if (!dissector) {
+@@ -1499,7 +1506,8 @@ cleanup_cls:
+ cleanup_dissector:
+       kfree(dissector);
+ cleanup_rss:
+-      if (priv->rss.enable) {
++      if (old_enable) {
++              priv->rss.enable = old_enable;
+               stmmac_rss_configure(priv, priv->hw, &priv->rss,
+                                    priv->plat->rx_queues_to_use);
+       }
diff --git a/queue-5.4/net-stmmac-tc-do-not-setup-flower-filtering-if-rss-is-enabled.patch b/queue-5.4/net-stmmac-tc-do-not-setup-flower-filtering-if-rss-is-enabled.patch
new file mode 100644 (file)
index 0000000..8e4a3c3
--- /dev/null
@@ -0,0 +1,34 @@
+From 7bd754c47dd3ad1b048c9641294b0234fcce2c58 Mon Sep 17 00:00:00 2001
+From: Jose Abreu <Jose.Abreu@synopsys.com>
+Date: Fri, 10 Jan 2020 16:23:53 +0100
+Subject: net: stmmac: tc: Do not setup flower filtering if RSS is enabled
+
+From: Jose Abreu <Jose.Abreu@synopsys.com>
+
+commit 7bd754c47dd3ad1b048c9641294b0234fcce2c58 upstream.
+
+RSS, when enabled, will bypass the L3 and L4 filtering causing it not
+to work. Add a check before trying to setup the filters.
+
+Fixes: 425eabddaf0f ("net: stmmac: Implement L3/L4 Filters using TC Flower")
+Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
+@@ -579,6 +579,10 @@ static int tc_setup_cls(struct stmmac_pr
+ {
+       int ret = 0;
++      /* When RSS is enabled, the filtering will be bypassed */
++      if (priv->rss.enable)
++              return -EBUSY;
++
+       switch (cls->command) {
+       case FLOW_CLS_REPLACE:
+               ret = tc_add_flow(priv, cls);
diff --git a/queue-5.4/selftests-mlxsw-qos_mc_aware-fix-mausezahn-invocation.patch b/queue-5.4/selftests-mlxsw-qos_mc_aware-fix-mausezahn-invocation.patch
new file mode 100644 (file)
index 0000000..4500d90
--- /dev/null
@@ -0,0 +1,52 @@
+From fef6d6704944c7be72fd2b77c021f1aed3d5df0d Mon Sep 17 00:00:00 2001
+From: Petr Machata <petrm@mellanox.com>
+Date: Wed, 15 Jan 2020 13:53:47 +0200
+Subject: selftests: mlxsw: qos_mc_aware: Fix mausezahn invocation
+
+From: Petr Machata <petrm@mellanox.com>
+
+commit fef6d6704944c7be72fd2b77c021f1aed3d5df0d upstream.
+
+Mausezahn does not recognize "own" as a keyword on source IP address. As a
+result, the MC stream is not running at all, and therefore no UC
+degradation can be observed even in principle.
+
+Fix the invocation, and tighten the test: due to the minimum shaper
+configured at the MC TCs, we always expect about 20% degradation. Fail the
+test if it is lower.
+
+Fixes: 573363a68f27 ("selftests: mlxsw: Add qos_lib.sh")
+Signed-off-by: Petr Machata <petrm@mellanox.com>
+Reported-by: Amit Cohen <amitc@mellanox.com>
+Signed-off-by: Ido Schimmel <idosch@mellanox.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh |    8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+--- a/tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh
++++ b/tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh
+@@ -232,7 +232,7 @@ test_mc_aware()
+       stop_traffic
+       local ucth1=${uc_rate[1]}
+-      start_traffic $h1 own bc bc
++      start_traffic $h1 192.0.2.65 bc bc
+       local d0=$(date +%s)
+       local t0=$(ethtool_stats_get $h3 rx_octets_prio_0)
+@@ -254,7 +254,11 @@ test_mc_aware()
+                       ret = 100 * ($ucth1 - $ucth2) / $ucth1
+                       if (ret > 0) { ret } else { 0 }
+                   ")
+-      check_err $(bc <<< "$deg > 25")
++
++      # Minimum shaper of 200Mbps on MC TCs should cause about 20% of
++      # degradation on 1Gbps link.
++      check_err $(bc <<< "$deg < 15") "Minimum shaper not in effect"
++      check_err $(bc <<< "$deg > 25") "MC traffic degrades UC performance too much"
+       local interval=$((d1 - d0))
+       local mc_ir=$(rate $u0 $u1 $interval)
index cfcc2d0cf46797fe0528f661cff16c5ea659fdc8..1ae05bfb5b7f8fbef773460c6deca3da02ecc92d 100644 (file)
@@ -155,6 +155,15 @@ net-dsa-sja1105-don-t-error-out-on-disabled-ports-with-no-phy-mode.patch
 net-dsa-tag_gswip-fix-typo-in-tagger-name.patch
 net-sched-act_ctinfo-fix-memory-leak.patch
 net-dsa-bcm_sf2-configure-imp-port-for-2gb-sec.patch
-wimax-i2400-fix-memory-leak.patch
-wimax-i2400-fix-memory-leak-in-i2400m_op_rfkill_sw_toggle.patch
 i40e-prevent-memory-leak-in-i40e_setup_macvlans.patch
+drm-amdgpu-allow-direct-upload-save-restore-list-for-raven2.patch
+sh_eth-check-sh_eth_cpu_data-dual_port-when-dumping-registers.patch
+mlxsw-spectrum-do-not-modify-cloned-skbs-during-xmit.patch
+mlxsw-spectrum-wipe-xstats.backlog-of-down-ports.patch
+mlxsw-spectrum_qdisc-include-mc-tcs-in-qdisc-counters.patch
+net-stmmac-selftests-make-it-work-in-synopsys-axs101-boards.patch
+net-stmmac-selftests-mark-as-fail-when-received-vlan-id-expected.patch
+selftests-mlxsw-qos_mc_aware-fix-mausezahn-invocation.patch
+net-stmmac-selftests-update-status-when-disabling-rss.patch
+net-stmmac-tc-do-not-setup-flower-filtering-if-rss-is-enabled.patch
+devlink-wait-longer-before-warning-about-unset-port-type.patch
diff --git a/queue-5.4/sh_eth-check-sh_eth_cpu_data-dual_port-when-dumping-registers.patch b/queue-5.4/sh_eth-check-sh_eth_cpu_data-dual_port-when-dumping-registers.patch
new file mode 100644 (file)
index 0000000..bef6efe
--- /dev/null
@@ -0,0 +1,70 @@
+From 3249b1e442a1be1a6b9f1026785b519d1443f807 Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Date: Wed, 8 Jan 2020 23:42:42 +0300
+Subject: sh_eth: check sh_eth_cpu_data::dual_port when dumping registers
+
+From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+
+commit 3249b1e442a1be1a6b9f1026785b519d1443f807 upstream.
+
+When adding the sh_eth_cpu_data::dual_port flag I forgot to add the flag
+checks to __sh_eth_get_regs(), causing the non-existing TSU registers to
+be dumped by 'ethtool' on the single port Ether controllers having TSU...
+
+Fixes: a94cf2a614f8 ("sh_eth: fix TSU init on SH7734/R8A7740")
+Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/ethernet/renesas/sh_eth.c |   38 ++++++++++++++++++----------------
+ 1 file changed, 21 insertions(+), 17 deletions(-)
+
+--- a/drivers/net/ethernet/renesas/sh_eth.c
++++ b/drivers/net/ethernet/renesas/sh_eth.c
+@@ -2204,24 +2204,28 @@ static size_t __sh_eth_get_regs(struct n
+       if (cd->tsu) {
+               add_tsu_reg(ARSTR);
+               add_tsu_reg(TSU_CTRST);
+-              add_tsu_reg(TSU_FWEN0);
+-              add_tsu_reg(TSU_FWEN1);
+-              add_tsu_reg(TSU_FCM);
+-              add_tsu_reg(TSU_BSYSL0);
+-              add_tsu_reg(TSU_BSYSL1);
+-              add_tsu_reg(TSU_PRISL0);
+-              add_tsu_reg(TSU_PRISL1);
+-              add_tsu_reg(TSU_FWSL0);
+-              add_tsu_reg(TSU_FWSL1);
++              if (cd->dual_port) {
++                      add_tsu_reg(TSU_FWEN0);
++                      add_tsu_reg(TSU_FWEN1);
++                      add_tsu_reg(TSU_FCM);
++                      add_tsu_reg(TSU_BSYSL0);
++                      add_tsu_reg(TSU_BSYSL1);
++                      add_tsu_reg(TSU_PRISL0);
++                      add_tsu_reg(TSU_PRISL1);
++                      add_tsu_reg(TSU_FWSL0);
++                      add_tsu_reg(TSU_FWSL1);
++              }
+               add_tsu_reg(TSU_FWSLC);
+-              add_tsu_reg(TSU_QTAGM0);
+-              add_tsu_reg(TSU_QTAGM1);
+-              add_tsu_reg(TSU_FWSR);
+-              add_tsu_reg(TSU_FWINMK);
+-              add_tsu_reg(TSU_ADQT0);
+-              add_tsu_reg(TSU_ADQT1);
+-              add_tsu_reg(TSU_VTAG0);
+-              add_tsu_reg(TSU_VTAG1);
++              if (cd->dual_port) {
++                      add_tsu_reg(TSU_QTAGM0);
++                      add_tsu_reg(TSU_QTAGM1);
++                      add_tsu_reg(TSU_FWSR);
++                      add_tsu_reg(TSU_FWINMK);
++                      add_tsu_reg(TSU_ADQT0);
++                      add_tsu_reg(TSU_ADQT1);
++                      add_tsu_reg(TSU_VTAG0);
++                      add_tsu_reg(TSU_VTAG1);
++              }
+               add_tsu_reg(TSU_ADSBSY);
+               add_tsu_reg(TSU_TEN);
+               add_tsu_reg(TSU_POST1);
diff --git a/queue-5.4/wimax-i2400-fix-memory-leak-in-i2400m_op_rfkill_sw_toggle.patch b/queue-5.4/wimax-i2400-fix-memory-leak-in-i2400m_op_rfkill_sw_toggle.patch
deleted file mode 100644 (file)
index ee573b0..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-From foo@baz Tue 21 Jan 2020 04:26:29 PM CET
-From: Navid Emamdoost <navid.emamdoost@gmail.com>
-Date: Fri, 25 Oct 2019 23:53:30 -0500
-Subject: wimax: i2400: Fix memory leak in i2400m_op_rfkill_sw_toggle
-
-From: Navid Emamdoost <navid.emamdoost@gmail.com>
-
-[ Upstream commit 6f3ef5c25cc762687a7341c18cbea5af54461407 ]
-
-In the implementation of i2400m_op_rfkill_sw_toggle() the allocated
-buffer for cmd should be released before returning. The
-documentation for i2400m_msg_to_dev() says when it returns the buffer
-can be reused. Meaning cmd should be released in either case. Move
-kfree(cmd) before return to be reached by all execution paths.
-
-Fixes: 2507e6ab7a9a ("wimax: i2400: fix memory leak")
-Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- drivers/net/wimax/i2400m/op-rfkill.c |    1 -
- 1 file changed, 1 deletion(-)
-
---- a/drivers/net/wimax/i2400m/op-rfkill.c
-+++ b/drivers/net/wimax/i2400m/op-rfkill.c
-@@ -127,7 +127,6 @@ int i2400m_op_rfkill_sw_toggle(struct wi
-                       "%d\n", result);
-       result = 0;
- error_cmd:
--      kfree(cmd);
-       kfree_skb(ack_skb);
- error_msg_to_dev:
- error_alloc:
diff --git a/queue-5.4/wimax-i2400-fix-memory-leak.patch b/queue-5.4/wimax-i2400-fix-memory-leak.patch
deleted file mode 100644 (file)
index e63f92f..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-From foo@baz Tue 21 Jan 2020 04:26:29 PM CET
-From: Navid Emamdoost <navid.emamdoost@gmail.com>
-Date: Tue, 10 Sep 2019 18:01:40 -0500
-Subject: wimax: i2400: fix memory leak
-
-From: Navid Emamdoost <navid.emamdoost@gmail.com>
-
-[ Upstream commit 2507e6ab7a9a440773be476141a255934468c5ef ]
-
-In i2400m_op_rfkill_sw_toggle cmd buffer should be released along with
-skb response.
-
-Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- drivers/net/wimax/i2400m/op-rfkill.c |    1 +
- 1 file changed, 1 insertion(+)
-
---- a/drivers/net/wimax/i2400m/op-rfkill.c
-+++ b/drivers/net/wimax/i2400m/op-rfkill.c
-@@ -127,6 +127,7 @@ int i2400m_op_rfkill_sw_toggle(struct wi
-                       "%d\n", result);
-       result = 0;
- error_cmd:
-+      kfree(cmd);
-       kfree_skb(ack_skb);
- error_msg_to_dev:
- error_alloc: