]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Feb 2021 13:20:45 +0000 (14:20 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Feb 2021 13:20:45 +0000 (14:20 +0100)
added patches:
net-dsa-mv88e6xxx-override-existent-unicast-portvec-in-port_fdb_add.patch
net-ip_tunnel-fix-mtu-calculation.patch

queue-4.19/net-dsa-mv88e6xxx-override-existent-unicast-portvec-in-port_fdb_add.patch [new file with mode: 0644]
queue-4.19/net-ip_tunnel-fix-mtu-calculation.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/net-dsa-mv88e6xxx-override-existent-unicast-portvec-in-port_fdb_add.patch b/queue-4.19/net-dsa-mv88e6xxx-override-existent-unicast-portvec-in-port_fdb_add.patch
new file mode 100644 (file)
index 0000000..e73fc3d
--- /dev/null
@@ -0,0 +1,39 @@
+From f72f2fb8fb6be095b98af5d740ac50cffd0b0cae Mon Sep 17 00:00:00 2001
+From: DENG Qingfang <dqfext@gmail.com>
+Date: Sat, 30 Jan 2021 21:43:34 +0800
+Subject: net: dsa: mv88e6xxx: override existent unicast portvec in port_fdb_add
+
+From: DENG Qingfang <dqfext@gmail.com>
+
+commit f72f2fb8fb6be095b98af5d740ac50cffd0b0cae upstream.
+
+Having multiple destination ports for a unicast address does not make
+sense.
+Make port_db_load_purge override existent unicast portvec instead of
+adding a new port bit.
+
+Fixes: 884729399260 ("net: dsa: mv88e6xxx: handle multiple ports in ATU")
+Signed-off-by: DENG Qingfang <dqfext@gmail.com>
+Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
+Link: https://lore.kernel.org/r/20210130134334.10243-1-dqfext@gmail.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/dsa/mv88e6xxx/chip.c |    6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/dsa/mv88e6xxx/chip.c
++++ b/drivers/net/dsa/mv88e6xxx/chip.c
+@@ -1658,7 +1658,11 @@ static int mv88e6xxx_port_db_load_purge(
+               if (!entry.portvec)
+                       entry.state = MV88E6XXX_G1_ATU_DATA_STATE_UNUSED;
+       } else {
+-              entry.portvec |= BIT(port);
++              if (state == MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC)
++                      entry.portvec = BIT(port);
++              else
++                      entry.portvec |= BIT(port);
++
+               entry.state = state;
+       }
diff --git a/queue-4.19/net-ip_tunnel-fix-mtu-calculation.patch b/queue-4.19/net-ip_tunnel-fix-mtu-calculation.patch
new file mode 100644 (file)
index 0000000..69959a0
--- /dev/null
@@ -0,0 +1,80 @@
+From 28e104d00281ade30250b24e098bf50887671ea4 Mon Sep 17 00:00:00 2001
+From: Vadim Fedorenko <vfedorenko@novek.ru>
+Date: Sat, 30 Jan 2021 01:27:47 +0300
+Subject: net: ip_tunnel: fix mtu calculation
+
+From: Vadim Fedorenko <vfedorenko@novek.ru>
+
+commit 28e104d00281ade30250b24e098bf50887671ea4 upstream.
+
+dev->hard_header_len for tunnel interface is set only when header_ops
+are set too and already contains full overhead of any tunnel encapsulation.
+That's why there is not need to use this overhead twice in mtu calc.
+
+Fixes: fdafed459998 ("ip_gre: set dev->hard_header_len and dev->needed_headroom properly")
+Reported-by: Slava Bacherikov <mail@slava.cc>
+Signed-off-by: Vadim Fedorenko <vfedorenko@novek.ru>
+Link: https://lore.kernel.org/r/1611959267-20536-1-git-send-email-vfedorenko@novek.ru
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv4/ip_tunnel.c |   16 +++++++---------
+ 1 file changed, 7 insertions(+), 9 deletions(-)
+
+--- a/net/ipv4/ip_tunnel.c
++++ b/net/ipv4/ip_tunnel.c
+@@ -330,7 +330,7 @@ static int ip_tunnel_bind_dev(struct net
+       }
+       dev->needed_headroom = t_hlen + hlen;
+-      mtu -= (dev->hard_header_len + t_hlen);
++      mtu -= t_hlen;
+       if (mtu < IPV4_MIN_MTU)
+               mtu = IPV4_MIN_MTU;
+@@ -360,7 +360,7 @@ static struct ip_tunnel *ip_tunnel_creat
+       nt = netdev_priv(dev);
+       t_hlen = nt->hlen + sizeof(struct iphdr);
+       dev->min_mtu = ETH_MIN_MTU;
+-      dev->max_mtu = IP_MAX_MTU - dev->hard_header_len - t_hlen;
++      dev->max_mtu = IP_MAX_MTU - t_hlen;
+       ip_tunnel_add(itn, nt);
+       return nt;
+@@ -502,12 +502,11 @@ static int tnl_update_pmtu(struct net_de
+                           const struct iphdr *inner_iph)
+ {
+       struct ip_tunnel *tunnel = netdev_priv(dev);
+-      int pkt_size = skb->len - tunnel->hlen - dev->hard_header_len;
++      int pkt_size = skb->len - tunnel->hlen;
+       int mtu;
+       if (df)
+-              mtu = dst_mtu(&rt->dst) - dev->hard_header_len
+-                                      - sizeof(struct iphdr) - tunnel->hlen;
++              mtu = dst_mtu(&rt->dst) - (sizeof(struct iphdr) + tunnel->hlen);
+       else
+               mtu = skb_dst(skb) ? dst_mtu(skb_dst(skb)) : dev->mtu;
+@@ -935,7 +934,7 @@ int __ip_tunnel_change_mtu(struct net_de
+ {
+       struct ip_tunnel *tunnel = netdev_priv(dev);
+       int t_hlen = tunnel->hlen + sizeof(struct iphdr);
+-      int max_mtu = IP_MAX_MTU - dev->hard_header_len - t_hlen;
++      int max_mtu = IP_MAX_MTU - t_hlen;
+       if (new_mtu < ETH_MIN_MTU)
+               return -EINVAL;
+@@ -1112,10 +1111,9 @@ int ip_tunnel_newlink(struct net_device
+       mtu = ip_tunnel_bind_dev(dev);
+       if (tb[IFLA_MTU]) {
+-              unsigned int max = IP_MAX_MTU - dev->hard_header_len - nt->hlen;
++              unsigned int max = IP_MAX_MTU - (nt->hlen + sizeof(struct iphdr));
+-              mtu = clamp(dev->mtu, (unsigned int)ETH_MIN_MTU,
+-                          (unsigned int)(max - sizeof(struct iphdr)));
++              mtu = clamp(dev->mtu, (unsigned int)ETH_MIN_MTU, max);
+       }
+       err = dev_set_mtu(dev, mtu);
index 5c1e32e51ef11f22104fa138c7b747e20402c846..56f319b97926eee9795b7f11dfb2fa27ec5a4b5f 100644 (file)
@@ -34,3 +34,5 @@ x86-apic-add-extra-serialization-for-non-serializing-msrs.patch
 input-xpad-sync-supported-devices-with-fork-on-github.patch
 iommu-vt-d-do-not-use-flush-queue-when-caching-mode-is-on.patch
 md-set-prev_flush_start-and-flush_bio-in-an-atomic-way.patch
+net-ip_tunnel-fix-mtu-calculation.patch
+net-dsa-mv88e6xxx-override-existent-unicast-portvec-in-port_fdb_add.patch