net: aquantia: Fix internal stats calculation on rx
authorIgor Russkikh <igor.russkikh@aquantia.com>
Mon, 15 Jan 2018 13:41:22 +0000 (16:41 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 Jan 2018 19:40:01 +0000 (14:40 -0500)
skb len should be fetched before gro_receive - otherwise we may get
wrong or even outdated skb data.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/aquantia/atlantic/aq_ring.c

index 519ca65..0be6a11 100644 (file)
@@ -279,10 +279,10 @@ int aq_ring_rx_clean(struct aq_ring_s *self,
 
                skb_record_rx_queue(skb, self->idx);
 
-               napi_gro_receive(napi, skb);
-
                ++self->stats.rx.packets;
                self->stats.rx.bytes += skb->len;
+
+               napi_gro_receive(napi, skb);
        }
 
 err_exit: