diff options
-rw-r--r-- | net/core/pktgen.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 6eb8d47cbf3a..54c634fab6c3 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -363,6 +363,7 @@ struct pktgen_dev { | |||
363 | * device name (not when the inject is | 363 | * device name (not when the inject is |
364 | * started as it used to do.) | 364 | * started as it used to do.) |
365 | */ | 365 | */ |
366 | char odevname[32]; | ||
366 | struct flow_state *flows; | 367 | struct flow_state *flows; |
367 | unsigned cflows; /* Concurrent flows (config) */ | 368 | unsigned cflows; /* Concurrent flows (config) */ |
368 | unsigned lflow; /* Flow length (config) */ | 369 | unsigned lflow; /* Flow length (config) */ |
@@ -528,7 +529,7 @@ static int pktgen_if_show(struct seq_file *seq, void *v) | |||
528 | seq_printf(seq, | 529 | seq_printf(seq, |
529 | " frags: %d delay: %llu clone_skb: %d ifname: %s\n", | 530 | " frags: %d delay: %llu clone_skb: %d ifname: %s\n", |
530 | pkt_dev->nfrags, (unsigned long long) pkt_dev->delay, | 531 | pkt_dev->nfrags, (unsigned long long) pkt_dev->delay, |
531 | pkt_dev->clone_skb, pkt_dev->odev->name); | 532 | pkt_dev->clone_skb, pkt_dev->odevname); |
532 | 533 | ||
533 | seq_printf(seq, " flows: %u flowlen: %u\n", pkt_dev->cflows, | 534 | seq_printf(seq, " flows: %u flowlen: %u\n", pkt_dev->cflows, |
534 | pkt_dev->lflow); | 535 | pkt_dev->lflow); |
@@ -1688,13 +1689,13 @@ static int pktgen_thread_show(struct seq_file *seq, void *v) | |||
1688 | if_lock(t); | 1689 | if_lock(t); |
1689 | list_for_each_entry(pkt_dev, &t->if_list, list) | 1690 | list_for_each_entry(pkt_dev, &t->if_list, list) |
1690 | if (pkt_dev->running) | 1691 | if (pkt_dev->running) |
1691 | seq_printf(seq, "%s ", pkt_dev->odev->name); | 1692 | seq_printf(seq, "%s ", pkt_dev->odevname); |
1692 | 1693 | ||
1693 | seq_printf(seq, "\nStopped: "); | 1694 | seq_printf(seq, "\nStopped: "); |
1694 | 1695 | ||
1695 | list_for_each_entry(pkt_dev, &t->if_list, list) | 1696 | list_for_each_entry(pkt_dev, &t->if_list, list) |
1696 | if (!pkt_dev->running) | 1697 | if (!pkt_dev->running) |
1697 | seq_printf(seq, "%s ", pkt_dev->odev->name); | 1698 | seq_printf(seq, "%s ", pkt_dev->odevname); |
1698 | 1699 | ||
1699 | if (t->result[0]) | 1700 | if (t->result[0]) |
1700 | seq_printf(seq, "\nResult: %s\n", t->result); | 1701 | seq_printf(seq, "\nResult: %s\n", t->result); |
@@ -1994,7 +1995,7 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev) | |||
1994 | "queue_map_min (zero-based) (%d) exceeds valid range " | 1995 | "queue_map_min (zero-based) (%d) exceeds valid range " |
1995 | "[0 - %d] for (%d) queues on %s, resetting\n", | 1996 | "[0 - %d] for (%d) queues on %s, resetting\n", |
1996 | pkt_dev->queue_map_min, (ntxq ?: 1) - 1, ntxq, | 1997 | pkt_dev->queue_map_min, (ntxq ?: 1) - 1, ntxq, |
1997 | pkt_dev->odev->name); | 1998 | pkt_dev->odevname); |
1998 | pkt_dev->queue_map_min = ntxq - 1; | 1999 | pkt_dev->queue_map_min = ntxq - 1; |
1999 | } | 2000 | } |
2000 | if (pkt_dev->queue_map_max >= ntxq) { | 2001 | if (pkt_dev->queue_map_max >= ntxq) { |
@@ -2002,7 +2003,7 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev) | |||
2002 | "queue_map_max (zero-based) (%d) exceeds valid range " | 2003 | "queue_map_max (zero-based) (%d) exceeds valid range " |
2003 | "[0 - %d] for (%d) queues on %s, resetting\n", | 2004 | "[0 - %d] for (%d) queues on %s, resetting\n", |
2004 | pkt_dev->queue_map_max, (ntxq ?: 1) - 1, ntxq, | 2005 | pkt_dev->queue_map_max, (ntxq ?: 1) - 1, ntxq, |
2005 | pkt_dev->odev->name); | 2006 | pkt_dev->odevname); |
2006 | pkt_dev->queue_map_max = ntxq - 1; | 2007 | pkt_dev->queue_map_max = ntxq - 1; |
2007 | } | 2008 | } |
2008 | 2009 | ||
@@ -3262,7 +3263,7 @@ static int pktgen_stop_device(struct pktgen_dev *pkt_dev) | |||
3262 | 3263 | ||
3263 | if (!pkt_dev->running) { | 3264 | if (!pkt_dev->running) { |
3264 | printk(KERN_WARNING "pktgen: interface: %s is already " | 3265 | printk(KERN_WARNING "pktgen: interface: %s is already " |
3265 | "stopped\n", pkt_dev->odev->name); | 3266 | "stopped\n", pkt_dev->odevname); |
3266 | return -EINVAL; | 3267 | return -EINVAL; |
3267 | } | 3268 | } |
3268 | 3269 | ||
@@ -3464,7 +3465,7 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev) | |||
3464 | default: /* Drivers are not supposed to return other values! */ | 3465 | default: /* Drivers are not supposed to return other values! */ |
3465 | if (net_ratelimit()) | 3466 | if (net_ratelimit()) |
3466 | pr_info("pktgen: %s xmit error: %d\n", | 3467 | pr_info("pktgen: %s xmit error: %d\n", |
3467 | odev->name, ret); | 3468 | pkt_dev->odevname, ret); |
3468 | pkt_dev->errors++; | 3469 | pkt_dev->errors++; |
3469 | /* fallthru */ | 3470 | /* fallthru */ |
3470 | case NETDEV_TX_LOCKED: | 3471 | case NETDEV_TX_LOCKED: |
@@ -3572,7 +3573,7 @@ static struct pktgen_dev *pktgen_find_dev(struct pktgen_thread *t, | |||
3572 | if_lock(t); | 3573 | if_lock(t); |
3573 | 3574 | ||
3574 | list_for_each_entry(p, &t->if_list, list) | 3575 | list_for_each_entry(p, &t->if_list, list) |
3575 | if (strncmp(p->odev->name, ifname, IFNAMSIZ) == 0) { | 3576 | if (strncmp(p->odevname, ifname, IFNAMSIZ) == 0) { |
3576 | pkt_dev = p; | 3577 | pkt_dev = p; |
3577 | break; | 3578 | break; |
3578 | } | 3579 | } |
@@ -3628,6 +3629,7 @@ static int pktgen_add_device(struct pktgen_thread *t, const char *ifname) | |||
3628 | if (!pkt_dev) | 3629 | if (!pkt_dev) |
3629 | return -ENOMEM; | 3630 | return -ENOMEM; |
3630 | 3631 | ||
3632 | strcpy(pkt_dev->odevname, ifname); | ||
3631 | pkt_dev->flows = vmalloc(MAX_CFLOWS * sizeof(struct flow_state)); | 3633 | pkt_dev->flows = vmalloc(MAX_CFLOWS * sizeof(struct flow_state)); |
3632 | if (pkt_dev->flows == NULL) { | 3634 | if (pkt_dev->flows == NULL) { |
3633 | kfree(pkt_dev); | 3635 | kfree(pkt_dev); |