]> git.proxmox.com Git - pve-kernel.git/blame - patches/kernel/0009-net-ethernet-sun-niu-set-correct-packet-size-in-skb.patch
backport SUN NICs fix for OVS use
[pve-kernel.git] / patches / kernel / 0009-net-ethernet-sun-niu-set-correct-packet-size-in-skb.patch
CommitLineData
d3722c5c
TL
1From 14224923c3600bae2ac4dcae3bf0c3d4dc2812be Mon Sep 17 00:00:00 2001
2From: Rob Taglang <rob@taglang.io>
3Date: Thu, 3 May 2018 17:13:06 -0400
4Subject: net: ethernet: sun: niu set correct packet size in skb
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
28index 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--
58cgit v1.1