]> git.proxmox.com Git - pve-kernel.git/blob - patches/kernel/0008-net-ethernet-sun-niu-set-correct-packet-size-in-skb.patch
e5a2727249492f2e05b707f3acc35a8c828eedfa
[pve-kernel.git] / patches / kernel / 0008-net-ethernet-sun-niu-set-correct-packet-size-in-skb.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Rob Taglang <rob@taglang.io>
3 Date: Thu, 3 May 2018 17:13:06 -0400
4 Subject: [PATCH] net: ethernet: sun: niu set correct packet size in skb
5
6 Currently, skb->len and skb->data_len are set to the page size, not
7 the packet size. This causes the frame check sequence to not be
8 located at the "end" of the packet resulting in ethernet frame check
9 errors. The driver does work currently, but stricter kernel facing
10 networking solutions like OpenVSwitch will drop these packets as
11 invalid.
12
13 These changes set the packet size correctly so that these errors no
14 longer occur. The length does not include the frame check sequence, so
15 that subtraction was removed.
16
17 Tested on Oracle/SUN Multithreaded 10-Gigabit Ethernet Network
18 Controller [108e:abcd] and validated in wireshark.
19
20 Signed-off-by: Rob Taglang <rob@taglang.io>
21 Signed-off-by: David S. Miller <davem@davemloft.net>
22 Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 ---
24 drivers/net/ethernet/sun/niu.c | 5 ++---
25 1 file changed, 2 insertions(+), 3 deletions(-)
26
27 diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
28 index 06001bacbe0f..64f1b3a3afa8 100644
29 --- a/drivers/net/ethernet/sun/niu.c
30 +++ b/drivers/net/ethernet/sun/niu.c
31 @@ -3442,7 +3442,7 @@ static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np,
32
33 len = (val & RCR_ENTRY_L2_LEN) >>
34 RCR_ENTRY_L2_LEN_SHIFT;
35 - len -= ETH_FCS_LEN;
36 + append_size = len + ETH_HLEN + ETH_FCS_LEN;
37
38 addr = (val & RCR_ENTRY_PKT_BUF_ADDR) <<
39 RCR_ENTRY_PKT_BUF_ADDR_SHIFT;
40 @@ -3452,7 +3452,6 @@ static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np,
41 RCR_ENTRY_PKTBUFSZ_SHIFT];
42
43 off = addr & ~PAGE_MASK;
44 - append_size = rcr_size;
45 if (num_rcr == 1) {
46 int ptype;
47
48 @@ -3465,7 +3464,7 @@ static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np,
49 else
50 skb_checksum_none_assert(skb);
51 } else if (!(val & RCR_ENTRY_MULTI))
52 - append_size = len - skb->len;
53 + append_size = append_size - skb->len;
54
55 niu_rx_skb_append(skb, page, off, append_size, rcr_size);
56 if ((page->index + rp->rbr_block_size) - rcr_size == addr) {