d868498de48f01d958ddf8ee7a88daabe3334b42
[openwrt/openwrt.git] /
1 From ab1371fec54bdd16b5f6c56c76d817404c696d4b Mon Sep 17 00:00:00 2001
2 From: Camelia Groza <camelia.groza@nxp.com>
3 Date: Wed, 18 Oct 2017 16:38:30 +0300
4 Subject: [PATCH] sdk_dpaa: accept frames on RX even if larger than MTU
5
6 Documentation/networking/netdevices.txt mentions that interfaces must
7 be able to receive frames at least the size of the configured MTU. The
8 behavior for received frames larger than the MTU is unspecified. We have
9 been dropping these frames in software. Remove this behavior and accept
10 them.
11
12 Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
13 ---
14 drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.h | 11 -----------
15 drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_sg.c | 11 -----------
16 2 files changed, 22 deletions(-)
17
18 --- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.h
19 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.h
20 @@ -514,17 +514,6 @@ dpa_fd_offset(const struct qm_fd *fd)
21 return fd->offset;
22 }
23
24 -/* Verifies if the skb length is below the interface MTU */
25 -static inline int dpa_check_rx_mtu(struct sk_buff *skb, int mtu)
26 -{
27 - if (unlikely(skb->len > mtu))
28 - if ((skb->protocol != htons(ETH_P_8021Q))
29 - || (skb->len > mtu + 4))
30 - return -1;
31 -
32 - return 0;
33 -}
34 -
35 static inline uint16_t dpa_get_headroom(struct dpa_buffer_layout_s *bl)
36 {
37 uint16_t headroom;
38 --- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_sg.c
39 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_sg.c
40 @@ -616,13 +616,6 @@ void __hot _dpa_rx(struct net_device *ne
41 (*count_ptr)--;
42 skb->protocol = eth_type_trans(skb, net_dev);
43
44 - /* IP Reassembled frames are allowed to be larger than MTU */
45 - if (unlikely(dpa_check_rx_mtu(skb, net_dev->mtu) &&
46 - !(fd_status & FM_FD_IPR))) {
47 - percpu_stats->rx_dropped++;
48 - goto drop_bad_frame;
49 - }
50 -
51 skb_len = skb->len;
52
53 #ifdef CONFIG_FSL_DPAA_DBG_LOOP
54 @@ -655,10 +648,6 @@ void __hot _dpa_rx(struct net_device *ne
55 packet_dropped:
56 return;
57
58 -drop_bad_frame:
59 - dev_kfree_skb(skb);
60 - return;
61 -
62 _release_frame:
63 dpa_fd_release(net_dev, fd);
64 }