summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2012-07-11 18:50:09 +0400
committerKozlov Dmitry <xeb@mail.ru>2012-07-11 18:50:09 +0400
commit22c8cf9724a2766b5f38afbc250065308c2bd7e2 (patch)
tree9978bec376565f4741b513be9b23bcb9527fa77a /drivers
parentb2e106f8778fd834e0518cc6c0704d7d6b50875e (diff)
downloadaccel-ppp-22c8cf9724a2766b5f38afbc250065308c2bd7e2.tar.gz
accel-ppp-22c8cf9724a2766b5f38afbc250065308c2bd7e2.zip
ipoe: fix transmit bytes calculation
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ipoe/ipoe.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/ipoe/ipoe.c b/drivers/ipoe/ipoe.c
index 18f0f708..7f1ca962 100644
--- a/drivers/ipoe/ipoe.c
+++ b/drivers/ipoe/ipoe.c
@@ -127,11 +127,11 @@ static inline int hash_addr(__be32 addr)
}
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,35)
-static void ipoe_update_stats(struct sk_buff *skb, struct ipoe_stats *st)
+static void ipoe_update_stats(struct sk_buff *skb, struct ipoe_stats *st, int corr)
{
u64_stats_update_begin(&st->sync);
st->packets++;
- st->bytes += skb->len;
+ st->bytes += skb->len - corr;
u64_stats_update_end(&st->sync);
}
#endif
@@ -355,10 +355,10 @@ static netdev_tx_t ipoe_xmit(struct sk_buff *skb, struct net_device *dev)
//pr_info("ipoe: xmit %08x %08x\n", iph->saddr, iph->daddr);
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,35)
- ipoe_update_stats(skb, this_cpu_ptr(ses->tx_stats));
+ ipoe_update_stats(skb, this_cpu_ptr(ses->tx_stats), ETH_HLEN);
#else
stats->tx_packets++;
- stats->tx_bytes += skb->len;
+ stats->tx_bytes += skb->len - ETH_HLEN;
#endif
if (iph->daddr == ses->addr) {
@@ -493,7 +493,7 @@ static int ipoe_rcv_arp(struct sk_buff *skb, struct net_device *dev, struct pack
netif_rx(skb1);
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,35)
- ipoe_update_stats(skb, this_cpu_ptr(ses->rx_stats));
+ ipoe_update_stats(skb, this_cpu_ptr(ses->rx_stats), 0);
#else
stats->rx_packets++;
stats->rx_bytes += skb->len;
@@ -588,7 +588,7 @@ static int ipoe_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_t
netif_rx(skb1);
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,35)
- ipoe_update_stats(skb, this_cpu_ptr(ses->rx_stats));
+ ipoe_update_stats(skb, this_cpu_ptr(ses->rx_stats), 0);
#else
stats->rx_packets++;
stats->rx_bytes += skb->len;