]> git.proxmox.com Git - pve-kernel.git/blame - patches/kernel/0008-net-ethernet-sun-niu-set-correct-packet-size-in-skb.patch
update sources to Ubuntu-4.15.0-33.36
[pve-kernel.git] / patches / kernel / 0008-net-ethernet-sun-niu-set-correct-packet-size-in-skb.patch
CommitLineData
c0514fa3 1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
d3722c5c
TL
2From: Rob Taglang <rob@taglang.io>
3Date: Thu, 3 May 2018 17:13:06 -0400
c0514fa3 4Subject: [PATCH] net: ethernet: sun: niu set correct packet size in skb
d3722c5c
TL
5
6Currently, skb->len and skb->data_len are set to the page size, not
7the packet size. This causes the frame check sequence to not be
8located at the "end" of the packet resulting in ethernet frame check
9errors. The driver does work currently, but stricter kernel facing
10networking solutions like OpenVSwitch will drop these packets as
11invalid.
12
13These changes set the packet size correctly so that these errors no
14longer occur. The length does not include the frame check sequence, so
15that subtraction was removed.
16
17Tested on Oracle/SUN Multithreaded 10-Gigabit Ethernet Network
18Controller [108e:abcd] and validated in wireshark.
19
20Signed-off-by: Rob Taglang <rob@taglang.io>
21Signed-off-by: David S. Miller <davem@davemloft.net>
22Signed-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
27diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
c0514fa3 28index 06001bacbe0f..64f1b3a3afa8 100644
d3722c5c
TL
29--- a/drivers/net/ethernet/sun/niu.c
30+++ b/drivers/net/ethernet/sun/niu.c
c0514fa3 31@@ -3442,7 +3442,7 @@ static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np,
d3722c5c
TL
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;
c0514fa3 40@@ -3452,7 +3452,6 @@ static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np,
d3722c5c
TL
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
c0514fa3 48@@ -3465,7 +3464,7 @@ static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np,
d3722c5c
TL
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) {