Patchwork net/hyperv: rx_bytes should account the ether header size

login
register
mail settings
Submitter Wei Yongjun
Date Jan. 30, 2012, 8:14 a.m.
Message ID <CAPgLHd8M7vPra_gTH5J1RmR4nmSeuDEGCjghatd1BsOJEeGKKA@mail.gmail.com>
Download mbox | patch
Permalink /patch/138529/
State Accepted
Delegated to: David Miller
Headers show

Comments

Wei Yongjun - Jan. 30, 2012, 8:14 a.m.
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

skb->len after call eth_type_trans() does not include the ether
header size, but rx_bytes should account it.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/net/hyperv/netvsc_drv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
David Miller - Feb. 1, 2012, 7:30 p.m.
From: Wei Yongjun <weiyj.lk@gmail.com>
Date: Mon, 30 Jan 2012 16:14:02 +0800

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> skb->len after call eth_type_trans() does not include the ether
> header size, but rx_bytes should account it.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 1a1ca6c..9dccc7a 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -298,7 +298,7 @@  int netvsc_recv_callback(struct hv_device *device_obj,
 	skb->ip_summed = CHECKSUM_NONE;
 
 	net->stats.rx_packets++;
-	net->stats.rx_bytes += skb->len;
+	net->stats.rx_bytes += packet->total_data_buflen;
 
 	/*
 	 * Pass the skb back up. Network stack will deallocate the skb when it