diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-10-05 03:11:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-05 03:21:57 -0400 |
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, | |||
555 | struct net_device *dev) | 555 | struct net_device *dev) |
556 | { | 556 | { |
557 | struct ip_tunnel *tunnel = netdev_priv(dev); | 557 | struct ip_tunnel *tunnel = netdev_priv(dev); |
558 | struct net_device_stats *stats = &tunnel->dev->stats; | 558 | struct net_device_stats *stats = &dev->stats; |
559 | struct netdev_queue *txq = netdev_get_tx_queue(dev, 0); | ||
559 | struct iphdr *tiph = &tunnel->parms.iph; | 560 | struct iphdr *tiph = &tunnel->parms.iph; |
560 | struct ipv6hdr *iph6 = ipv6_hdr(skb); | 561 | struct ipv6hdr *iph6 = ipv6_hdr(skb); |
561 | u8 tos = tunnel->parms.iph.tos; | 562 | u8 tos = tunnel->parms.iph.tos; |
@@ -688,7 +689,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, | |||
688 | struct sk_buff *new_skb = skb_realloc_headroom(skb, max_headroom); | 689 | struct sk_buff *new_skb = skb_realloc_headroom(skb, max_headroom); |
689 | if (!new_skb) { | 690 | if (!new_skb) { |
690 | ip_rt_put(rt); | 691 | ip_rt_put(rt); |
691 | stats->tx_dropped++; | 692 | txq->tx_dropped++; |
692 | dev_kfree_skb(skb); | 693 | dev_kfree_skb(skb); |
693 | return NETDEV_TX_OK; | 694 | return NETDEV_TX_OK; |
694 | } | 695 | } |