a95b82daf9b270ad804a83a63e480b6b78913e3e
[openwrt/openwrt.git] /
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
5 packets.
6
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.
13
14 Until this is fully understood, request that the network stack
15 computes the checksum on packets signalled as having a VLAN tag
16 applied.
17
18 See https://github.com/raspberrypi/linux/issues/2458
19
20 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
21 ---
22 drivers/net/usb/lan78xx.c | 6 +++++-
23 1 file changed, 5 insertions(+), 1 deletion(-)
24
25 --- a/drivers/net/usb/lan78xx.c
26 +++ b/drivers/net/usb/lan78xx.c
27 @@ -2952,8 +2952,12 @@ static void lan78xx_rx_csum_offload(stru
28 struct sk_buff *skb,
29 u32 rx_cmd_a, u32 rx_cmd_b)
30 {
31 + /* Checksum offload appears to be flawed if used with VLANs.
32 + * Elect for sw checksum check instead.
33 + */
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;
39 } else {
40 skb->csum = ntohs((u16)(rx_cmd_b >> RX_CMD_B_CSUM_SHIFT_));