From f2c3d60c2940c3a035e7dba389fee410d4544467 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sun, 4 Oct 2020 18:23:51 -0400 Subject: [PATCH] Fixes for 4.4 Signed-off-by: Sasha Levin --- ...hdlc-set-skb-protocol-before-transmi.patch | 106 ++++++++++++++++++ ...lapbether-make-skb-protocol-consiste.patch | 58 ++++++++++ ...increase-receive-ring-size-for-tulip.patch | 43 +++++++ ...ase-sleep-time-in-the-query-response.patch | 49 ++++++++ queue-4.4/series | 4 + 5 files changed, 260 insertions(+) create mode 100644 queue-4.4/drivers-net-wan-hdlc-set-skb-protocol-before-transmi.patch create mode 100644 queue-4.4/drivers-net-wan-lapbether-make-skb-protocol-consiste.patch create mode 100644 queue-4.4/net-dec-de2104x-increase-receive-ring-size-for-tulip.patch create mode 100644 queue-4.4/rndis_host-increase-sleep-time-in-the-query-response.patch diff --git a/queue-4.4/drivers-net-wan-hdlc-set-skb-protocol-before-transmi.patch b/queue-4.4/drivers-net-wan-hdlc-set-skb-protocol-before-transmi.patch new file mode 100644 index 00000000000..e4e9193bda0 --- /dev/null +++ b/queue-4.4/drivers-net-wan-hdlc-set-skb-protocol-before-transmi.patch @@ -0,0 +1,106 @@ +From 22a31707e1de9eae7824aea3e746c7eb2969145d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 16 Sep 2020 14:25:07 -0700 +Subject: drivers/net/wan/hdlc: Set skb->protocol before transmitting + +From: Xie He + +[ Upstream commit 9fb030a70431a2a2a1b292dbf0b2f399cc072c16 ] + +This patch sets skb->protocol before transmitting frames on the HDLC +device, so that a user listening on the HDLC device with an AF_PACKET +socket will see outgoing frames' sll_protocol field correctly set and +consistent with that of incoming frames. + +1. Control frames in hdlc_cisco and hdlc_ppp + +When these drivers send control frames, skb->protocol is not set. + +This value should be set to htons(ETH_P_HDLC), because when receiving +control frames, their skb->protocol is set to htons(ETH_P_HDLC). + +When receiving, hdlc_type_trans in hdlc.h is called, which then calls +cisco_type_trans or ppp_type_trans. The skb->protocol of control frames +is set to htons(ETH_P_HDLC) so that the control frames can be received +by hdlc_rcv in hdlc.c, which calls cisco_rx or ppp_rx to process the +control frames. + +2. hdlc_fr + +When this driver sends control frames, skb->protocol is set to internal +values used in this driver. + +When this driver sends data frames (from upper stacked PVC devices), +skb->protocol is the same as that of the user data packet being sent on +the upper PVC device (for normal PVC devices), or is htons(ETH_P_802_3) +(for Ethernet-emulating PVC devices). + +However, skb->protocol for both control frames and data frames should be +set to htons(ETH_P_HDLC), because when receiving, all frames received on +the HDLC device will have their skb->protocol set to htons(ETH_P_HDLC). + +When receiving, hdlc_type_trans in hdlc.h is called, and because this +driver doesn't provide a type_trans function in struct hdlc_proto, +all frames will have their skb->protocol set to htons(ETH_P_HDLC). +The frames are then received by hdlc_rcv in hdlc.c, which calls fr_rx +to process the frames (control frames are consumed and data frames +are re-received on upper PVC devices). + +Cc: Krzysztof Halasa +Signed-off-by: Xie He +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/wan/hdlc_cisco.c | 1 + + drivers/net/wan/hdlc_fr.c | 3 +++ + drivers/net/wan/hdlc_ppp.c | 1 + + 3 files changed, 5 insertions(+) + +diff --git a/drivers/net/wan/hdlc_cisco.c b/drivers/net/wan/hdlc_cisco.c +index f8ed079d8bc3e..7a6f851d9843a 100644 +--- a/drivers/net/wan/hdlc_cisco.c ++++ b/drivers/net/wan/hdlc_cisco.c +@@ -120,6 +120,7 @@ static void cisco_keepalive_send(struct net_device *dev, u32 type, + skb_put(skb, sizeof(struct cisco_packet)); + skb->priority = TC_PRIO_CONTROL; + skb->dev = dev; ++ skb->protocol = htons(ETH_P_HDLC); + skb_reset_network_header(skb); + + dev_queue_xmit(skb); +diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c +index 89541cc90e877..74d46f7e77eaa 100644 +--- a/drivers/net/wan/hdlc_fr.c ++++ b/drivers/net/wan/hdlc_fr.c +@@ -435,6 +435,8 @@ static netdev_tx_t pvc_xmit(struct sk_buff *skb, struct net_device *dev) + if (pvc->state.fecn) /* TX Congestion counter */ + dev->stats.tx_compressed++; + skb->dev = pvc->frad; ++ skb->protocol = htons(ETH_P_HDLC); ++ skb_reset_network_header(skb); + dev_queue_xmit(skb); + return NETDEV_TX_OK; + } +@@ -557,6 +559,7 @@ static void fr_lmi_send(struct net_device *dev, int fullrep) + skb_put(skb, i); + skb->priority = TC_PRIO_CONTROL; + skb->dev = dev; ++ skb->protocol = htons(ETH_P_HDLC); + skb_reset_network_header(skb); + + dev_queue_xmit(skb); +diff --git a/drivers/net/wan/hdlc_ppp.c b/drivers/net/wan/hdlc_ppp.c +index a2559f213daed..473a9b8ec9ba5 100644 +--- a/drivers/net/wan/hdlc_ppp.c ++++ b/drivers/net/wan/hdlc_ppp.c +@@ -254,6 +254,7 @@ static void ppp_tx_cp(struct net_device *dev, u16 pid, u8 code, + + skb->priority = TC_PRIO_CONTROL; + skb->dev = dev; ++ skb->protocol = htons(ETH_P_HDLC); + skb_reset_network_header(skb); + skb_queue_tail(&tx_queue, skb); + } +-- +2.25.1 + diff --git a/queue-4.4/drivers-net-wan-lapbether-make-skb-protocol-consiste.patch b/queue-4.4/drivers-net-wan-lapbether-make-skb-protocol-consiste.patch new file mode 100644 index 00000000000..f9d36213bef --- /dev/null +++ b/queue-4.4/drivers-net-wan-lapbether-make-skb-protocol-consiste.patch @@ -0,0 +1,58 @@ +From d0594e5ec2bf0d67dfe45027894a7f9d0d91a884 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 16 Sep 2020 09:49:18 -0700 +Subject: drivers/net/wan/lapbether: Make skb->protocol consistent with the + header + +From: Xie He + +[ Upstream commit 83f9a9c8c1edc222846dc1bde6e3479703e8e5a3 ] + +This driver is a virtual driver stacked on top of Ethernet interfaces. + +When this driver transmits data on the Ethernet device, the skb->protocol +setting is inconsistent with the Ethernet header prepended to the skb. + +This causes a user listening on the Ethernet interface with an AF_PACKET +socket, to see different sll_protocol values for incoming and outgoing +frames, because incoming frames would have this value set by parsing the +Ethernet header. + +This patch changes the skb->protocol value for outgoing Ethernet frames, +making it consistent with the Ethernet header prepended. This makes a +user listening on the Ethernet device with an AF_PACKET socket, to see +the same sll_protocol value for incoming and outgoing frames. + +Cc: Martin Schiller +Signed-off-by: Xie He +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/wan/lapbether.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c +index c6db9a4e7c457..ef746ba74ab4c 100644 +--- a/drivers/net/wan/lapbether.c ++++ b/drivers/net/wan/lapbether.c +@@ -201,8 +201,6 @@ static void lapbeth_data_transmit(struct net_device *ndev, struct sk_buff *skb) + struct net_device *dev; + int size = skb->len; + +- skb->protocol = htons(ETH_P_X25); +- + ptr = skb_push(skb, 2); + + *ptr++ = size % 256; +@@ -213,6 +211,8 @@ static void lapbeth_data_transmit(struct net_device *ndev, struct sk_buff *skb) + + skb->dev = dev = lapbeth->ethdev; + ++ skb->protocol = htons(ETH_P_DEC); ++ + skb_reset_network_header(skb); + + dev_hard_header(skb, dev, ETH_P_DEC, bcast_addr, NULL, 0); +-- +2.25.1 + diff --git a/queue-4.4/net-dec-de2104x-increase-receive-ring-size-for-tulip.patch b/queue-4.4/net-dec-de2104x-increase-receive-ring-size-for-tulip.patch new file mode 100644 index 00000000000..55cdb310247 --- /dev/null +++ b/queue-4.4/net-dec-de2104x-increase-receive-ring-size-for-tulip.patch @@ -0,0 +1,43 @@ +From 94a6a4ce76ac8b8696653d989ba441e782c4300f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 10 Sep 2020 12:05:09 -0700 +Subject: net: dec: de2104x: Increase receive ring size for Tulip + +From: Lucy Yan + +[ Upstream commit ee460417d254d941dfea5fb7cff841f589643992 ] + +Increase Rx ring size to address issue where hardware is reaching +the receive work limit. + +Before: + +[ 102.223342] de2104x 0000:17:00.0 eth0: rx work limit reached +[ 102.245695] de2104x 0000:17:00.0 eth0: rx work limit reached +[ 102.251387] de2104x 0000:17:00.0 eth0: rx work limit reached +[ 102.267444] de2104x 0000:17:00.0 eth0: rx work limit reached + +Signed-off-by: Lucy Yan +Reviewed-by: Moritz Fischer +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/dec/tulip/de2104x.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/dec/tulip/de2104x.c b/drivers/net/ethernet/dec/tulip/de2104x.c +index cadcee645f74e..11ce50a057998 100644 +--- a/drivers/net/ethernet/dec/tulip/de2104x.c ++++ b/drivers/net/ethernet/dec/tulip/de2104x.c +@@ -91,7 +91,7 @@ MODULE_PARM_DESC (rx_copybreak, "de2104x Breakpoint at which Rx packets are copi + #define DSL CONFIG_DE2104X_DSL + #endif + +-#define DE_RX_RING_SIZE 64 ++#define DE_RX_RING_SIZE 128 + #define DE_TX_RING_SIZE 64 + #define DE_RING_BYTES \ + ((sizeof(struct de_desc) * DE_RX_RING_SIZE) + \ +-- +2.25.1 + diff --git a/queue-4.4/rndis_host-increase-sleep-time-in-the-query-response.patch b/queue-4.4/rndis_host-increase-sleep-time-in-the-query-response.patch new file mode 100644 index 00000000000..28099b4bc28 --- /dev/null +++ b/queue-4.4/rndis_host-increase-sleep-time-in-the-query-response.patch @@ -0,0 +1,49 @@ +From aca3886293efc67c5cad4fbd104bafe3f04375a3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 11 Sep 2020 14:17:24 +0000 +Subject: rndis_host: increase sleep time in the query-response loop + +From: Olympia Giannou + +[ Upstream commit 4202c9fdf03d79dedaa94b2c4cf574f25793d669 ] + +Some WinCE devices face connectivity issues via the NDIS interface. They +fail to register, resulting in -110 timeout errors and failures during the +probe procedure. + +In this kind of WinCE devices, the Windows-side ndis driver needs quite +more time to be loaded and configured, so that the linux rndis host queries +to them fail to be responded correctly on time. + +More specifically, when INIT is called on the WinCE side - no other +requests can be served by the Client and this results in a failed QUERY +afterwards. + +The increase of the waiting time on the side of the linux rndis host in +the command-response loop leaves the INIT process to complete and respond +to a QUERY, which comes afterwards. The WinCE devices with this special +"feature" in their ndis driver are satisfied by this fix. + +Signed-off-by: Olympia Giannou +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/usb/rndis_host.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c +index 524a47a281207..b20b380d91bf6 100644 +--- a/drivers/net/usb/rndis_host.c ++++ b/drivers/net/usb/rndis_host.c +@@ -213,7 +213,7 @@ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen) + dev_dbg(&info->control->dev, + "rndis response error, code %d\n", retval); + } +- msleep(20); ++ msleep(40); + } + dev_dbg(&info->control->dev, "rndis response timeout\n"); + return -ETIMEDOUT; +-- +2.25.1 + diff --git a/queue-4.4/series b/queue-4.4/series index 65f8f7a8f21..d78b1f84d13 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -1,3 +1,7 @@ gpio-tc35894-fix-up-tc35894-interrupt-configuration.patch input-i8042-add-nopnp-quirk-for-acer-aspire-5-a515.patch drm-amdgpu-restore-proper-ref-count-in-amdgpu_display_crtc_set_config.patch +net-dec-de2104x-increase-receive-ring-size-for-tulip.patch +rndis_host-increase-sleep-time-in-the-query-response.patch +drivers-net-wan-lapbether-make-skb-protocol-consiste.patch +drivers-net-wan-hdlc-set-skb-protocol-before-transmi.patch -- 2.47.3