aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2009-08-27 09:55:13 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-29 02:32:04 -0400
commite470757d6179eb8998881ac2706927d4d0cb0e54 (patch)
treec330507799072717647df780169b01d83d7493f5 /net
parent7d7bb1cf0ea7434230b3e3de49c24ff68666a72e (diff)
pktgen: use netdev_alloc_skb
netdev_alloc_skb is NUMA node aware. Also, don't exhaust atomic emergency pool. Don't want pktgen to cause OOM behaviour. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/pktgen.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 90d48ccf651d..2456bd5b086f 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2539,8 +2539,9 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev,
2539 mod_cur_headers(pkt_dev); 2539 mod_cur_headers(pkt_dev);
2540 2540
2541 datalen = (odev->hard_header_len + 16) & ~0xf; 2541 datalen = (odev->hard_header_len + 16) & ~0xf;
2542 skb = alloc_skb(pkt_dev->cur_pkt_size + 64 + datalen + 2542 skb = __netdev_alloc_skb(odev,
2543 pkt_dev->pkt_overhead, GFP_ATOMIC); 2543 pkt_dev->cur_pkt_size + 64
2544 + datalen + pkt_dev->pkt_overhead, GFP_NOWAIT);
2544 if (!skb) { 2545 if (!skb) {
2545 sprintf(pkt_dev->result, "No memory"); 2546 sprintf(pkt_dev->result, "No memory");
2546 return NULL; 2547 return NULL;
@@ -2878,8 +2879,9 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev,
2878 queue_map = pkt_dev->cur_queue_map; 2879 queue_map = pkt_dev->cur_queue_map;
2879 mod_cur_headers(pkt_dev); 2880 mod_cur_headers(pkt_dev);
2880 2881
2881 skb = alloc_skb(pkt_dev->cur_pkt_size + 64 + 16 + 2882 skb = __netdev_alloc_skb(odev,
2882 pkt_dev->pkt_overhead, GFP_ATOMIC); 2883 pkt_dev->cur_pkt_size + 64
2884 + 16 + pkt_dev->pkt_overhead, GFP_NOWAIT);
2883 if (!skb) { 2885 if (!skb) {
2884 sprintf(pkt_dev->result, "No memory"); 2886 sprintf(pkt_dev->result, "No memory");
2885 return NULL; 2887 return NULL;