]> git.proxmox.com Git - pve-kernel.git/blob - patches/kernel/0009-net-ethernet-sun-niu-set-correct-packet-size-in-skb.patch
3f58da8635d5c8065b7d5acf9d413494a6644091
[pve-kernel.git] / patches / kernel / 0009-net-ethernet-sun-niu-set-correct-packet-size-in-skb.patch
1 From 14224923c3600bae2ac4dcae3bf0c3d4dc2812be 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: 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 f081de4..88c1247 100644
29 --- a/drivers/net/ethernet/sun/niu.c
30 +++ b/drivers/net/ethernet/sun/niu.c
31 @@ -3443,7 +3443,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 @@ -3453,7 +3453,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 @@ -3466,7 +3465,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) {
57 --
58 cgit v1.1