aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/core/pktgen.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index b44104d3e6be..19ee493ec178 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -3626,6 +3626,7 @@ static int pktgen_add_device(struct pktgen_thread *t, const char *ifname)
3626{ 3626{
3627 struct pktgen_dev *pkt_dev; 3627 struct pktgen_dev *pkt_dev;
3628 int err; 3628 int err;
3629 int node = cpu_to_node(t->cpu);
3629 3630
3630 /* We don't allow a device to be on several threads */ 3631 /* We don't allow a device to be on several threads */
3631 3632
@@ -3635,12 +3636,13 @@ static int pktgen_add_device(struct pktgen_thread *t, const char *ifname)
3635 return -EBUSY; 3636 return -EBUSY;
3636 } 3637 }
3637 3638
3638 pkt_dev = kzalloc(sizeof(struct pktgen_dev), GFP_KERNEL); 3639 pkt_dev = kzalloc_node(sizeof(struct pktgen_dev), GFP_KERNEL, node);
3639 if (!pkt_dev) 3640 if (!pkt_dev)
3640 return -ENOMEM; 3641 return -ENOMEM;
3641 3642
3642 strcpy(pkt_dev->odevname, ifname); 3643 strcpy(pkt_dev->odevname, ifname);
3643 pkt_dev->flows = vmalloc(MAX_CFLOWS * sizeof(struct flow_state)); 3644 pkt_dev->flows = vmalloc_node(MAX_CFLOWS * sizeof(struct flow_state),
3645 node);
3644 if (pkt_dev->flows == NULL) { 3646 if (pkt_dev->flows == NULL) {
3645 kfree(pkt_dev); 3647 kfree(pkt_dev);
3646 return -ENOMEM; 3648 return -ENOMEM;
@@ -3702,7 +3704,8 @@ static int __init pktgen_create_thread(int cpu)
3702 struct proc_dir_entry *pe; 3704 struct proc_dir_entry *pe;
3703 struct task_struct *p; 3705 struct task_struct *p;
3704 3706
3705 t = kzalloc(sizeof(struct pktgen_thread), GFP_KERNEL); 3707 t = kzalloc_node(sizeof(struct pktgen_thread), GFP_KERNEL,
3708 cpu_to_node(cpu));
3706 if (!t) { 3709 if (!t) {
3707 printk(KERN_ERR "pktgen: ERROR: out of memory, can't " 3710 printk(KERN_ERR "pktgen: ERROR: out of memory, can't "
3708 "create new thread.\n"); 3711 "create new thread.\n");