1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-02-15 04:42:02 +00:00
openmptcprouter/root/target/linux/brcm2708/patches-4.14/0302-net-lan78xx-Reduce-s-w-csum-check-on-VLANs.patch
2018-05-02 16:32:48 +02:00

40 lines
1.4 KiB
Diff

From 0a76b56e61cf7745b8012299c8bc72e1a8fd6d05 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.org>
Date: Tue, 10 Apr 2018 13:08:36 +0100
Subject: [PATCH 302/321] net: lan78xx: Reduce s/w csum check on VLANs
With HW_VLAN_CTAG_RX enabled we don't observe the checksum
issue, so amend the workaround to only drop back to s/w
checksums if VLAN offload is disabled.
See #2458.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
---
drivers/net/usb/lan78xx.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
index ebf5dfa98cc0..28c47345420a 100644
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -2985,12 +2985,13 @@ static void lan78xx_rx_csum_offload(struct lan78xx_net *dev,
struct sk_buff *skb,
u32 rx_cmd_a, u32 rx_cmd_b)
{
- /* Checksum offload appears to be flawed if used with VLANs.
- * Elect for sw checksum check instead.
+ /* HW Checksum offload appears to be flawed if used when not stripping
+ * VLAN headers.
*/
if (!(dev->net->features & NETIF_F_RXCSUM) ||
unlikely(rx_cmd_a & RX_CMD_A_ICSM_) ||
- (rx_cmd_a & RX_CMD_A_FVTG_)) {
+ ((rx_cmd_a & RX_CMD_A_FVTG_) &&
+ !(dev->net->features & NETIF_F_HW_VLAN_CTAG_RX))) {
skb->ip_summed = CHECKSUM_NONE;
} else {
skb->csum = ntohs((u16)(rx_cmd_b >> RX_CMD_B_CSUM_SHIFT_));
--
2.16.1