Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 168954
b: refs/heads/master
c: 593f63b
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Nov 23, 2009
1 parent 4278c3f commit d0a7978
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 73cfe264c27fb50d4592ef1580486bea319443ac
refs/heads/master: 593f63b0be70762bd4354bde147b8e169c5a2f57
18 changes: 10 additions & 8 deletions trunk/net/core/pktgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ struct pktgen_dev {
* device name (not when the inject is
* started as it used to do.)
*/
char odevname[32];
struct flow_state *flows;
unsigned cflows; /* Concurrent flows (config) */
unsigned lflow; /* Flow length (config) */
Expand Down Expand Up @@ -528,7 +529,7 @@ static int pktgen_if_show(struct seq_file *seq, void *v)
seq_printf(seq,
" frags: %d delay: %llu clone_skb: %d ifname: %s\n",
pkt_dev->nfrags, (unsigned long long) pkt_dev->delay,
pkt_dev->clone_skb, pkt_dev->odev->name);
pkt_dev->clone_skb, pkt_dev->odevname);

seq_printf(seq, " flows: %u flowlen: %u\n", pkt_dev->cflows,
pkt_dev->lflow);
Expand Down Expand Up @@ -1688,13 +1689,13 @@ static int pktgen_thread_show(struct seq_file *seq, void *v)
if_lock(t);
list_for_each_entry(pkt_dev, &t->if_list, list)
if (pkt_dev->running)
seq_printf(seq, "%s ", pkt_dev->odev->name);
seq_printf(seq, "%s ", pkt_dev->odevname);

seq_printf(seq, "\nStopped: ");

list_for_each_entry(pkt_dev, &t->if_list, list)
if (!pkt_dev->running)
seq_printf(seq, "%s ", pkt_dev->odev->name);
seq_printf(seq, "%s ", pkt_dev->odevname);

if (t->result[0])
seq_printf(seq, "\nResult: %s\n", t->result);
Expand Down Expand Up @@ -1994,15 +1995,15 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev)
"queue_map_min (zero-based) (%d) exceeds valid range "
"[0 - %d] for (%d) queues on %s, resetting\n",
pkt_dev->queue_map_min, (ntxq ?: 1) - 1, ntxq,
pkt_dev->odev->name);
pkt_dev->odevname);
pkt_dev->queue_map_min = ntxq - 1;
}
if (pkt_dev->queue_map_max >= ntxq) {
printk(KERN_WARNING "pktgen: WARNING: Requested "
"queue_map_max (zero-based) (%d) exceeds valid range "
"[0 - %d] for (%d) queues on %s, resetting\n",
pkt_dev->queue_map_max, (ntxq ?: 1) - 1, ntxq,
pkt_dev->odev->name);
pkt_dev->odevname);
pkt_dev->queue_map_max = ntxq - 1;
}

Expand Down Expand Up @@ -3262,7 +3263,7 @@ static int pktgen_stop_device(struct pktgen_dev *pkt_dev)

if (!pkt_dev->running) {
printk(KERN_WARNING "pktgen: interface: %s is already "
"stopped\n", pkt_dev->odev->name);
"stopped\n", pkt_dev->odevname);
return -EINVAL;
}

Expand Down Expand Up @@ -3464,7 +3465,7 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev)
default: /* Drivers are not supposed to return other values! */
if (net_ratelimit())
pr_info("pktgen: %s xmit error: %d\n",
odev->name, ret);
pkt_dev->odevname, ret);
pkt_dev->errors++;
/* fallthru */
case NETDEV_TX_LOCKED:
Expand Down Expand Up @@ -3572,7 +3573,7 @@ static struct pktgen_dev *pktgen_find_dev(struct pktgen_thread *t,
if_lock(t);

list_for_each_entry(p, &t->if_list, list)
if (strncmp(p->odev->name, ifname, IFNAMSIZ) == 0) {
if (strncmp(p->odevname, ifname, IFNAMSIZ) == 0) {
pkt_dev = p;
break;
}
Expand Down Expand Up @@ -3628,6 +3629,7 @@ static int pktgen_add_device(struct pktgen_thread *t, const char *ifname)
if (!pkt_dev)
return -ENOMEM;

strcpy(pkt_dev->odevname, ifname);
pkt_dev->flows = vmalloc(MAX_CFLOWS * sizeof(struct flow_state));
if (pkt_dev->flows == NULL) {
kfree(pkt_dev);
Expand Down

0 comments on commit d0a7978

Please sign in to comment.