aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
authorAshish Sharma <ashishsharma@google.com>2011-10-07 17:54:16 -0700
committerJP Abgrall <jpa@google.com>2011-10-07 17:54:30 -0700
commit3bc18c7282298005d4726de14e19c3f5c807bb51 (patch)
tree96840870818dd590c8fc41f54c6fd301f9baa01a /net/bridge
parentca37d833b0de24f87502c5df5234f4bf38884830 (diff)
downloadkernel_samsung_espresso10-3bc18c7282298005d4726de14e19c3f5c807bb51.zip
kernel_samsung_espresso10-3bc18c7282298005d4726de14e19c3f5c807bb51.tar.gz
kernel_samsung_espresso10-3bc18c7282298005d4726de14e19c3f5c807bb51.tar.bz2
bridge: Have tx_bytes count headers like rx_bytes.
Since rx_bytes accounting does not include Ethernet Headers in br_input.c, excluding ETH_HLEN on the transmit path for consistent measurement of packet length on both the Tx and Rx chains. The clean way would be for Rx to include the eth header, but the skb len has already been adjusted by the time the br code sees the skb. This is only a temporary workaround until we can completely ignore or cleanly fix the skb->len handling. Change-Id: I910de95a4686b2119da7f1f326e2154ef31f9972 Signed-off-by: Ashish Sharma <ashishsharma@google.com>
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/br_device.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index 32b8f9f..a9dd166 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -38,16 +38,17 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
}
#endif
- u64_stats_update_begin(&brstats->syncp);
- brstats->tx_packets++;
- brstats->tx_bytes += skb->len;
- u64_stats_update_end(&brstats->syncp);
-
BR_INPUT_SKB_CB(skb)->brdev = dev;
skb_reset_mac_header(skb);
skb_pull(skb, ETH_HLEN);
+ u64_stats_update_begin(&brstats->syncp);
+ brstats->tx_packets++;
+ /* Exclude ETH_HLEN from byte stats for consistency with Rx chain */
+ brstats->tx_bytes += skb->len;
+ u64_stats_update_end(&brstats->syncp);
+
rcu_read_lock();
if (is_broadcast_ether_addr(dest))
br_flood_deliver(br, skb);