Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121828
b: refs/heads/master
c: eb37b41
h: refs/heads/master
v: v3
  • Loading branch information
Jesse Brandeburg authored and David S. Miller committed Nov 11, 2008
1 parent 6e89453 commit 0073d22
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9b1582d4513a2102c68fe12ac1106595f3c09120
refs/heads/master: eb37b41cc2274cdecfc19d371717c321fe2ab426
22 changes: 22 additions & 0 deletions trunk/net/core/pktgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ static struct pktgen_dev *pktgen_find_dev(struct pktgen_thread *t,
const char *ifname);
static int pktgen_device_event(struct notifier_block *, unsigned long, void *);
static void pktgen_run_all_threads(void);
static void pktgen_reset_all_threads(void);
static void pktgen_stop_all_threads_ifs(void);
static int pktgen_stop_device(struct pktgen_dev *pkt_dev);
static void pktgen_stop(struct pktgen_thread *t);
Expand Down Expand Up @@ -480,6 +481,9 @@ static ssize_t pgctrl_write(struct file *file, const char __user * buf,
else if (!strcmp(data, "start"))
pktgen_run_all_threads();

else if (!strcmp(data, "reset"))
pktgen_reset_all_threads();

else
printk(KERN_WARNING "pktgen: Unknown command: %s\n", data);

Expand Down Expand Up @@ -3173,6 +3177,24 @@ static void pktgen_run_all_threads(void)
pktgen_wait_all_threads_run();
}

static void pktgen_reset_all_threads(void)
{
struct pktgen_thread *t;

pr_debug("pktgen: entering pktgen_reset_all_threads.\n");

mutex_lock(&pktgen_thread_lock);

list_for_each_entry(t, &pktgen_threads, th_list)
t->control |= (T_REMDEVALL);

mutex_unlock(&pktgen_thread_lock);

schedule_timeout_interruptible(msecs_to_jiffies(125)); /* Propagate thread->control */

pktgen_wait_all_threads_run();
}

static void show_results(struct pktgen_dev *pkt_dev, int nr_frags)
{
__u64 total_us, bps, mbps, pps, idle;
Expand Down

0 comments on commit 0073d22

Please sign in to comment.