Commit 94321a9f authored by John Crispin's avatar John Crispin Committed by David S. Miller

net: mediatek: dropped rx packets are not being counted properly

There are two places inside mtk_poll_rx where rx_dropped is not being
incremented properly. Fix this by adding the missing code to increment
the counter.
Signed-off-by: default avatarJohn Crispin <john@phrozen.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2fae723c
...@@ -829,6 +829,7 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget, ...@@ -829,6 +829,7 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget,
DMA_FROM_DEVICE); DMA_FROM_DEVICE);
if (unlikely(dma_mapping_error(&netdev->dev, dma_addr))) { if (unlikely(dma_mapping_error(&netdev->dev, dma_addr))) {
skb_free_frag(new_data); skb_free_frag(new_data);
netdev->stats.rx_dropped++;
goto release_desc; goto release_desc;
} }
...@@ -836,6 +837,7 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget, ...@@ -836,6 +837,7 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget,
skb = build_skb(data, ring->frag_size); skb = build_skb(data, ring->frag_size);
if (unlikely(!skb)) { if (unlikely(!skb)) {
put_page(virt_to_head_page(new_data)); put_page(virt_to_head_page(new_data));
netdev->stats.rx_dropped++;
goto release_desc; goto release_desc;
} }
skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN); skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment