From 37c69f8e96c0cc0fd1a22b9fbba69d0b88a6f4c5 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 11 Sep 2018 12:08:45 +0200 Subject: [PATCH] 4.4-stable patches added patches: net-bcmgenet-use-mac-link-status-for-fixed-phy.patch qlge-fix-netdev-features-configuration.patch tcp-do-not-restart-timewait-timer-on-rst-reception.patch vti6-remove-skb-ignore_df-check-from-vti6_xmit.patch --- ...et-use-mac-link-status-for-fixed-phy.patch | 56 ++++++++ ...ge-fix-netdev-features-configuration.patch | 77 +++++++++++ queue-4.4/series | 4 + ...tart-timewait-timer-on-rst-reception.patch | 122 ++++++++++++++++++ ...e-skb-ignore_df-check-from-vti6_xmit.patch | 42 ++++++ 5 files changed, 301 insertions(+) create mode 100644 queue-4.4/net-bcmgenet-use-mac-link-status-for-fixed-phy.patch create mode 100644 queue-4.4/qlge-fix-netdev-features-configuration.patch create mode 100644 queue-4.4/tcp-do-not-restart-timewait-timer-on-rst-reception.patch create mode 100644 queue-4.4/vti6-remove-skb-ignore_df-check-from-vti6_xmit.patch diff --git a/queue-4.4/net-bcmgenet-use-mac-link-status-for-fixed-phy.patch b/queue-4.4/net-bcmgenet-use-mac-link-status-for-fixed-phy.patch new file mode 100644 index 00000000000..b6fd3eacfd4 --- /dev/null +++ b/queue-4.4/net-bcmgenet-use-mac-link-status-for-fixed-phy.patch @@ -0,0 +1,56 @@ +From foo@baz Tue Sep 11 11:55:25 CEST 2018 +From: Doug Berger +Date: Tue, 28 Aug 2018 12:33:15 -0700 +Subject: net: bcmgenet: use MAC link status for fixed phy + +From: Doug Berger + +[ Upstream commit c3c397c1f16c51601a3fac4fe0c63ad8aa85a904 ] + +When using the fixed PHY with GENET (e.g. MOCA) the PHY link +status can be determined from the internal link status captured +by the MAC. This allows the PHY state machine to use the correct +link state with the fixed PHY even if MAC link event interrupts +are missed when the net device is opened. + +Fixes: 8d88c6ebb34c ("net: bcmgenet: enable MoCA link state change detection") +Signed-off-by: Doug Berger +Reviewed-by: Florian Fainelli +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/broadcom/genet/bcmgenet.h | 3 +++ + drivers/net/ethernet/broadcom/genet/bcmmii.c | 10 ++++++++-- + 2 files changed, 11 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.h ++++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.h +@@ -185,6 +185,9 @@ struct bcmgenet_mib_counters { + #define UMAC_MAC1 0x010 + #define UMAC_MAX_FRAME_LEN 0x014 + ++#define UMAC_MODE 0x44 ++#define MODE_LINK_STATUS (1 << 5) ++ + #define UMAC_EEE_CTRL 0x064 + #define EN_LPI_RX_PAUSE (1 << 0) + #define EN_LPI_TX_PFC (1 << 1) +--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c ++++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c +@@ -167,8 +167,14 @@ void bcmgenet_mii_setup(struct net_devic + static int bcmgenet_fixed_phy_link_update(struct net_device *dev, + struct fixed_phy_status *status) + { +- if (dev && dev->phydev && status) +- status->link = dev->phydev->link; ++ struct bcmgenet_priv *priv; ++ u32 reg; ++ ++ if (dev && dev->phydev && status) { ++ priv = netdev_priv(dev); ++ reg = bcmgenet_umac_readl(priv, UMAC_MODE); ++ status->link = !!(reg & MODE_LINK_STATUS); ++ } + + return 0; + } diff --git a/queue-4.4/qlge-fix-netdev-features-configuration.patch b/queue-4.4/qlge-fix-netdev-features-configuration.patch new file mode 100644 index 00000000000..0c25786587f --- /dev/null +++ b/queue-4.4/qlge-fix-netdev-features-configuration.patch @@ -0,0 +1,77 @@ +From foo@baz Tue Sep 11 11:55:25 CEST 2018 +From: Manish Chopra +Date: Thu, 23 Aug 2018 13:20:52 -0700 +Subject: qlge: Fix netdev features configuration. + +From: Manish Chopra + +[ Upstream commit 6750c87074c5b534d82fdaabb1deb45b8f1f57de ] + +qlge_fix_features() is not supposed to modify hardware or +driver state, rather it is supposed to only fix requested +fetures bits. Currently qlge_fix_features() also goes for +interface down and up unnecessarily if there is not even +any change in features set. + +This patch changes/fixes following - + +1) Move reload of interface or device re-config from + qlge_fix_features() to qlge_set_features(). +2) Reload of interface in qlge_set_features() only if + relevant feature bit (NETIF_F_HW_VLAN_CTAG_RX) is changed. +3) Get rid of qlge_fix_features() since driver is not really + required to fix any features bit. + +Signed-off-by: Manish +Reviewed-by: Benjamin Poirier +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/qlogic/qlge/qlge_main.c | 23 ++++++++--------------- + 1 file changed, 8 insertions(+), 15 deletions(-) + +--- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c ++++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c +@@ -2388,26 +2388,20 @@ static int qlge_update_hw_vlan_features( + return status; + } + +-static netdev_features_t qlge_fix_features(struct net_device *ndev, +- netdev_features_t features) +-{ +- int err; +- +- /* Update the behavior of vlan accel in the adapter */ +- err = qlge_update_hw_vlan_features(ndev, features); +- if (err) +- return err; +- +- return features; +-} +- + static int qlge_set_features(struct net_device *ndev, + netdev_features_t features) + { + netdev_features_t changed = ndev->features ^ features; ++ int err; ++ ++ if (changed & NETIF_F_HW_VLAN_CTAG_RX) { ++ /* Update the behavior of vlan accel in the adapter */ ++ err = qlge_update_hw_vlan_features(ndev, features); ++ if (err) ++ return err; + +- if (changed & NETIF_F_HW_VLAN_CTAG_RX) + qlge_vlan_mode(ndev, features); ++ } + + return 0; + } +@@ -4720,7 +4714,6 @@ static const struct net_device_ops qlge_ + .ndo_set_mac_address = qlge_set_mac_address, + .ndo_validate_addr = eth_validate_addr, + .ndo_tx_timeout = qlge_tx_timeout, +- .ndo_fix_features = qlge_fix_features, + .ndo_set_features = qlge_set_features, + .ndo_vlan_rx_add_vid = qlge_vlan_rx_add_vid, + .ndo_vlan_rx_kill_vid = qlge_vlan_rx_kill_vid, diff --git a/queue-4.4/series b/queue-4.4/series index cbef77f8892..7a534ad67d9 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -1,2 +1,6 @@ x86-speculation-l1tf-fix-up-pte-pfn-conversion-for-pae.patch staging-android-ion-fix-ion_ioc_-map-share-use-after-free.patch +net-bcmgenet-use-mac-link-status-for-fixed-phy.patch +qlge-fix-netdev-features-configuration.patch +tcp-do-not-restart-timewait-timer-on-rst-reception.patch +vti6-remove-skb-ignore_df-check-from-vti6_xmit.patch diff --git a/queue-4.4/tcp-do-not-restart-timewait-timer-on-rst-reception.patch b/queue-4.4/tcp-do-not-restart-timewait-timer-on-rst-reception.patch new file mode 100644 index 00000000000..e80d807abd3 --- /dev/null +++ b/queue-4.4/tcp-do-not-restart-timewait-timer-on-rst-reception.patch @@ -0,0 +1,122 @@ +From foo@baz Tue Sep 11 11:55:25 CEST 2018 +From: Florian Westphal +Date: Thu, 30 Aug 2018 14:24:29 +0200 +Subject: tcp: do not restart timewait timer on rst reception + +From: Florian Westphal + +[ Upstream commit 63cc357f7bba6729869565a12df08441a5995d9a ] + +RFC 1337 says: + ''Ignore RST segments in TIME-WAIT state. + If the 2 minute MSL is enforced, this fix avoids all three hazards.'' + +So with net.ipv4.tcp_rfc1337=1, expected behaviour is to have TIME-WAIT sk +expire rather than removing it instantly when a reset is received. + +However, Linux will also re-start the TIME-WAIT timer. + +This causes connect to fail when tying to re-use ports or very long +delays (until syn retry interval exceeds MSL). + +packetdrill test case: +// Demonstrate bogus rearming of TIME-WAIT timer in rfc1337 mode. +`sysctl net.ipv4.tcp_rfc1337=1` + +0.000 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3 +0.000 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 +0.000 bind(3, ..., ...) = 0 +0.000 listen(3, 1) = 0 + +0.100 < S 0:0(0) win 29200 +0.100 > S. 0:0(0) ack 1 +0.200 < . 1:1(0) ack 1 win 257 +0.200 accept(3, ..., ...) = 4 + +// Receive first segment +0.310 < P. 1:1001(1000) ack 1 win 46 + +// Send one ACK +0.310 > . 1:1(0) ack 1001 + +// read 1000 byte +0.310 read(4, ..., 1000) = 1000 + +// Application writes 100 bytes +0.350 write(4, ..., 100) = 100 +0.350 > P. 1:101(100) ack 1001 + +// ACK +0.500 < . 1001:1001(0) ack 101 win 257 + +// close the connection +0.600 close(4) = 0 +0.600 > F. 101:101(0) ack 1001 win 244 + +// Our side is in FIN_WAIT_1 & waits for ack to fin +0.7 < . 1001:1001(0) ack 102 win 244 + +// Our side is in FIN_WAIT_2 with no outstanding data. +0.8 < F. 1001:1001(0) ack 102 win 244 +0.8 > . 102:102(0) ack 1002 win 244 + +// Our side is now in TIME_WAIT state, send ack for fin. +0.9 < F. 1002:1002(0) ack 102 win 244 +0.9 > . 102:102(0) ack 1002 win 244 + +// Peer reopens with in-window SYN: +1.000 < S 1000:1000(0) win 9200 + +// Therefore, reply with ACK. +1.000 > . 102:102(0) ack 1002 win 244 + +// Peer sends RST for this ACK. Normally this RST results +// in tw socket removal, but rfc1337=1 setting prevents this. +1.100 < R 1002:1002(0) win 244 + +// second syn. Due to rfc1337=1 expect another pure ACK. +31.0 < S 1000:1000(0) win 9200 +31.0 > . 102:102(0) ack 1002 win 244 + +// .. and another RST from peer. +31.1 < R 1002:1002(0) win 244 +31.2 `echo no timer restart;ss -m -e -a -i -n -t -o state TIME-WAIT` + +// third syn after one minute. Time-Wait socket should have expired by now. +63.0 < S 1000:1000(0) win 9200 + +// so we expect a syn-ack & 3whs to proceed from here on. +63.0 > S. 0:0(0) ack 1 + +Without this patch, 'ss' shows restarts of tw timer and last packet is +thus just another pure ack, more than one minute later. + +This restores the original code from commit 283fd6cf0be690a83 +("Merge in ANK networking jumbo patch") in netdev-vger-cvs.git . + +For some reason the else branch was removed/lost in 1f28b683339f7 +("Merge in TCP/UDP optimizations and [..]") and timer restart became +unconditional. + +Reported-by: Michal Tesar +Signed-off-by: Florian Westphal +Signed-off-by: Eric Dumazet +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv4/tcp_minisocks.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/net/ipv4/tcp_minisocks.c ++++ b/net/ipv4/tcp_minisocks.c +@@ -200,8 +200,9 @@ kill: + inet_twsk_deschedule_put(tw); + return TCP_TW_SUCCESS; + } ++ } else { ++ inet_twsk_reschedule(tw, TCP_TIMEWAIT_LEN); + } +- inet_twsk_reschedule(tw, TCP_TIMEWAIT_LEN); + + if (tmp_opt.saw_tstamp) { + tcptw->tw_ts_recent = tmp_opt.rcv_tsval; diff --git a/queue-4.4/vti6-remove-skb-ignore_df-check-from-vti6_xmit.patch b/queue-4.4/vti6-remove-skb-ignore_df-check-from-vti6_xmit.patch new file mode 100644 index 00000000000..d1ea06620c4 --- /dev/null +++ b/queue-4.4/vti6-remove-skb-ignore_df-check-from-vti6_xmit.patch @@ -0,0 +1,42 @@ +From foo@baz Tue Sep 11 11:48:38 CEST 2018 +From: Alexey Kodanev +Date: Thu, 23 Aug 2018 19:49:54 +0300 +Subject: vti6: remove !skb->ignore_df check from vti6_xmit() + +From: Alexey Kodanev + +[ Upstream commit 9f2895461439fda2801a7906fb4c5fb3dbb37a0a ] + +Before the commit d6990976af7c ("vti6: fix PMTU caching and reporting +on xmit") '!skb->ignore_df' check was always true because the function +skb_scrub_packet() was called before it, resetting ignore_df to zero. + +In the commit, skb_scrub_packet() was moved below, and now this check +can be false for the packet, e.g. when sending it in the two fragments, +this prevents successful PMTU updates in such case. The next attempts +to send the packet lead to the same tx error. Moreover, vti6 initial +MTU value relies on PMTU adjustments. + +This issue can be reproduced with the following LTP test script: + udp_ipsec_vti.sh -6 -p ah -m tunnel -s 2000 + +Fixes: ccd740cbc6e0 ("vti6: Add pmtu handling to vti6_xmit.") +Signed-off-by: Alexey Kodanev +Acked-by: Steffen Klassert +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv6/ip6_vti.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/ipv6/ip6_vti.c ++++ b/net/ipv6/ip6_vti.c +@@ -470,7 +470,7 @@ vti6_xmit(struct sk_buff *skb, struct ne + } + + mtu = dst_mtu(dst); +- if (!skb->ignore_df && skb->len > mtu) { ++ if (skb->len > mtu) { + skb_dst(skb)->ops->update_pmtu(dst, NULL, skb, mtu); + + if (skb->protocol == htons(ETH_P_IPV6)) { -- 2.47.2