ramips: fix the number of uarts for MT7688
[librecmc/librecmc.git] / target / linux / mediatek / patches-4.4 / 0085-net-next-mediatek-dropped-rx-packets-are-not-being-c.patch
1 From 98aac832925a99afee8722cdfd5a848dd6086b8f Mon Sep 17 00:00:00 2001
2 From: John Crispin <john@phrozen.org>
3 Date: Sat, 23 Apr 2016 09:28:25 +0200
4 Subject: [PATCH 085/102] net-next: mediatek: dropped rx packets are not being
5  counted properly
6
7 There are 2 places inside mtk_poll_rx where rx_dropped is not being
8 incremented properly. Fix this by adding the missing code to increment
9 the counter.
10
11 Signed-off-by: Sean Wang <keyhaede@gmail.com>
12 Signed-off-by: John Crispin <john@phrozen.org>
13 ---
14  drivers/net/ethernet/mediatek/mtk_eth_soc.c |    2 ++
15  1 file changed, 2 insertions(+)
16
17 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
18 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
19 @@ -841,6 +841,7 @@ static int mtk_poll_rx(struct napi_struc
20                                           DMA_FROM_DEVICE);
21                 if (unlikely(dma_mapping_error(&netdev->dev, dma_addr))) {
22                         skb_free_frag(new_data);
23 +                       netdev->stats.rx_dropped++;
24                         goto release_desc;
25                 }
26  
27 @@ -848,6 +849,7 @@ static int mtk_poll_rx(struct napi_struc
28                 skb = build_skb(data, ring->frag_size);
29                 if (unlikely(!skb)) {
30                         put_page(virt_to_head_page(new_data));
31 +                       netdev->stats.rx_dropped++;
32                         goto release_desc;
33                 }
34                 skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN);