From: Vladislav Yasevich <vyasevich@gmail.com>
To: netdev@vger.kernel.org
Cc: stephen@networkplumber.org, Vladislav Yasevich <vyasevic@redhat.com>
Subject: [PATCH] vlan: Fix receive statistics under-reporting
Date: Wed, 24 Sep 2014 10:45:06 -0400 [thread overview]
Message-ID: <1411569906-31679-1-git-send-email-vyasevic@redhat.com> (raw)
In-Reply-To: <20140922090134.3a114531@urahara>
Vlan devices uder-report 14 bytes per packet in the recieve statistics.
This is because the ETH_HLEN bytes of data has been pulled off the skb
by the time it gets to the vlan receive code. When accounting for
receive butes, add ETH_HLEN back.
See also https://bugzilla.kernel.org/show_bug.cgi?id=84951
Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
---
net/8021q/vlan_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index 90cc2bd..8bc5d46 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -54,7 +54,7 @@ bool vlan_do_receive(struct sk_buff **skbp)
u64_stats_update_begin(&rx_stats->syncp);
rx_stats->rx_packets++;
- rx_stats->rx_bytes += skb->len;
+ rx_stats->rx_bytes += skb->len + ETH_HLEN;
if (skb->pkt_type == PACKET_MULTICAST)
rx_stats->rx_multicast++;
u64_stats_update_end(&rx_stats->syncp);
--
1.9.3
next prev parent reply other threads:[~2014-09-24 14:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-22 16:01 Fw: [Bug 84951] New: 8021q: kernel doesn't take into account ethernet header bytes for received packets Stephen Hemminger
2014-09-24 14:36 ` Vlad Yasevich
2014-09-24 14:45 ` Vladislav Yasevich [this message]
2014-09-24 15:08 ` [PATCH] vlan: Fix receive statistics under-reporting Eric Dumazet
2014-09-24 16:45 ` Vlad Yasevich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1411569906-31679-1-git-send-email-vyasevic@redhat.com \
--to=vyasevich@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
--cc=vyasevic@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).