diff options
author | Junchang Wang <junchangwang@gmail.com> | 2010-12-08 11:55:16 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-10 18:36:52 -0500 |
commit | a8d764b9832d3cc86019f71916665dd2d337d7c2 (patch) | |
tree | 08637ac7b04a569b1b5152f8e52434c9f284bf29 /net/core/pktgen.c | |
parent | 4afb7527ac8cc7bd8f03570e12f6eed0eca03363 (diff) |
pktgen: adding prefetchw() call
We know for sure pktgen is going to write skb->data right after
*_alloc_skb, causing unnecessary cache misses.
Idea is to add a prefetchw() call to prefetch the first cache line
indicated by skb->data. On systems with Adjacent Cache Line Prefetch,
it's probably two cache lines are prefetched.
With this patch, pktgen on Intel SR1625 server with two E5530
quad-core processors and a single ixgbe-based NIC went from 8.63Mpps
to 9.03Mpps, with 4.6% improvement.
Signed-off-by: Junchang Wang <junchangwang@gmail.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/pktgen.c')
-rw-r--r-- | net/core/pktgen.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 2953b2abc971..18fe20dacc60 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -2660,6 +2660,7 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev, | |||
2660 | sprintf(pkt_dev->result, "No memory"); | 2660 | sprintf(pkt_dev->result, "No memory"); |
2661 | return NULL; | 2661 | return NULL; |
2662 | } | 2662 | } |
2663 | prefetchw(skb->data); | ||
2663 | 2664 | ||
2664 | skb_reserve(skb, datalen); | 2665 | skb_reserve(skb, datalen); |
2665 | 2666 | ||
@@ -3007,6 +3008,7 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev, | |||
3007 | sprintf(pkt_dev->result, "No memory"); | 3008 | sprintf(pkt_dev->result, "No memory"); |
3008 | return NULL; | 3009 | return NULL; |
3009 | } | 3010 | } |
3011 | prefetchw(skb->data); | ||
3010 | 3012 | ||
3011 | skb_reserve(skb, 16); | 3013 | skb_reserve(skb, 16); |
3012 | 3014 | ||