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 519ca6534b8580ecaee0fa842e17c0d82060bdb4..0be6a11370bb3e233370c0dd377c8558310ab0f5 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: