1 From 44136672c6043943bcf0772bb0edfb6fc23354dc Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Mon, 9 Apr 2018 14:31:54 +0100
4 Subject: [PATCH 269/454] net: lan78xx: Request s/w csum check on VLAN tagged
7 There appears to be some issue in the LAN78xx where the checksum
8 computed on a VLAN tagged packet is incorrect, or at least not
9 in the form that the kernel is after. This is most easily shown
10 by pinging a device via a VLAN tagged interface and it will dump
11 out the error message and stack trace from netdev_rx_csum_fault.
12 It has also been seen with standard TCP and UDP packets.
14 Until this is fully understood, request that the network stack
15 computes the checksum on packets signalled as having a VLAN tag
18 See https://github.com/raspberrypi/linux/issues/2458
20 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
22 drivers/net/usb/lan78xx.c | 6 +++++-
23 1 file changed, 5 insertions(+), 1 deletion(-)
25 --- a/drivers/net/usb/lan78xx.c
26 +++ b/drivers/net/usb/lan78xx.c
27 @@ -2959,8 +2959,12 @@ static void lan78xx_rx_csum_offload(stru
29 u32 rx_cmd_a, u32 rx_cmd_b)
31 + /* Checksum offload appears to be flawed if used with VLANs.
32 + * Elect for sw checksum check instead.
34 if (!(dev->net->features & NETIF_F_RXCSUM) ||
35 - unlikely(rx_cmd_a & RX_CMD_A_ICSM_)) {
36 + unlikely(rx_cmd_a & RX_CMD_A_ICSM_) ||
37 + (rx_cmd_a & RX_CMD_A_FVTG_)) {
38 skb->ip_summed = CHECKSUM_NONE;
40 skb->csum = ntohs((u16)(rx_cmd_b >> RX_CMD_B_CSUM_SHIFT_));