mwifiex: correct RX byte count statistics
authorUjjal Roy <royujjal@gmail.com>
Tue, 3 Dec 2013 07:17:54 +0000 (23:17 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 9 Dec 2013 20:35:29 +0000 (15:35 -0500)
The skb is modified in processing the RX packet. Save the original
packet length to a variable so that we can get the correct
statistics update.

Signed-off-by: Ujjal Roy <royujjal@gmail.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/util.c

index 5d9e150f411147f572541cf5b06d913a873fb413..9b82e225880cbc41d1e7b65060407ff2ce8c5cdc 100644 (file)
@@ -191,6 +191,9 @@ int mwifiex_recv_packet(struct mwifiex_private *priv, struct sk_buff *skb)
        if (!skb)
                return -1;
 
+       priv->stats.rx_bytes += skb->len;
+       priv->stats.rx_packets++;
+
        skb->dev = priv->netdev;
        skb->protocol = eth_type_trans(skb, priv->netdev);
        skb->ip_summed = CHECKSUM_NONE;
@@ -217,8 +220,6 @@ int mwifiex_recv_packet(struct mwifiex_private *priv, struct sk_buff *skb)
            (skb->truesize > MWIFIEX_RX_DATA_BUF_SIZE))
                skb->truesize += (skb->len - MWIFIEX_RX_DATA_BUF_SIZE);
 
-       priv->stats.rx_bytes += skb->len;
-       priv->stats.rx_packets++;
        if (in_interrupt())
                netif_rx(skb);
        else