diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-10-05 00:11:22 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-05 00:21:57 -0700 |
commit | 0bfbedb14a8a96c529341bec88991a92b41fac72 (patch) | |
tree | d52ccb4758fd58cbf74c7a9001e6885275d3ddc8 /net/ipv6/sit.c | |
parent | 16c6cf8bb471392fd09b48b7c27e7d83a446b4bc (diff) |
tunnels: Optimize tx path
We currently dirty a cache line to update tunnel device stats
(tx_packets/tx_bytes). We better use the txq->tx_bytes/tx_packets
counters that already are present in cpu cache, in the cache
line shared with txq->_xmit_lock
This patch extends IPTUNNEL_XMIT() macro to use txq pointer
provided by the caller.
Also &tunnel->dev->stats can be replaced by &dev->stats
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/sit.c')
-rw-r--r-- | net/ipv6/sit.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index dbd19a78ca73..99da272951dc 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c @@ -555,7 +555,8 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) { struct ip_tunnel *tunnel = netdev_priv(dev); - struct net_device_stats *stats = &tunnel->dev->stats; + struct net_device_stats *stats = &dev->stats; + struct netdev_queue *txq = netdev_get_tx_queue(dev, 0); struct iphdr *tiph = &tunnel->parms.iph; struct ipv6hdr *iph6 = ipv6_hdr(skb); u8 tos = tunnel->parms.iph.tos; @@ -688,7 +689,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, struct sk_buff *new_skb = skb_realloc_headroom(skb, max_headroom); if (!new_skb) { ip_rt_put(rt); - stats->tx_dropped++; + txq->tx_dropped++; dev_kfree_skb(skb); return NETDEV_TX_OK; } |