Commit b163911f authored by Robert Olsson's avatar Robert Olsson Committed by David S. Miller

[PKTGEN]: Remove softirq scheduling.

It's not a job for pktgen.
Signed-off-by: default avatarRobert Olsson <robert.olsson@its.uu.se>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 45b270f8
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
#include <asm/div64.h> /* do_div */ #include <asm/div64.h> /* do_div */
#include <asm/timex.h> #include <asm/timex.h>
#define VERSION "pktgen v2.68: Packet Generator for packet performance testing.\n" #define VERSION "pktgen v2.69: Packet Generator for packet performance testing.\n"
/* The buckets are exponential in 'width' */ /* The buckets are exponential in 'width' */
#define LAT_BUCKETS_MAX 32 #define LAT_BUCKETS_MAX 32
...@@ -384,7 +384,6 @@ struct pktgen_thread { ...@@ -384,7 +384,6 @@ struct pktgen_thread {
struct list_head th_list; struct list_head th_list;
struct task_struct *tsk; struct task_struct *tsk;
char result[512]; char result[512];
u32 max_before_softirq; /* We'll call do_softirq to prevent starvation. */
/* Field for thread to receive "posted" events terminate, stop ifs etc. */ /* Field for thread to receive "posted" events terminate, stop ifs etc. */
...@@ -1761,9 +1760,6 @@ static int pktgen_thread_show(struct seq_file *seq, void *v) ...@@ -1761,9 +1760,6 @@ static int pktgen_thread_show(struct seq_file *seq, void *v)
BUG_ON(!t); BUG_ON(!t);
seq_printf(seq, "Name: %s max_before_softirq: %d\n",
t->tsk->comm, t->max_before_softirq);
seq_printf(seq, "Running: "); seq_printf(seq, "Running: ");
if_lock(t); if_lock(t);
...@@ -1796,7 +1792,6 @@ static ssize_t pktgen_thread_write(struct file *file, ...@@ -1796,7 +1792,6 @@ static ssize_t pktgen_thread_write(struct file *file,
int i = 0, max, len, ret; int i = 0, max, len, ret;
char name[40]; char name[40];
char *pg_result; char *pg_result;
unsigned long value = 0;
if (count < 1) { if (count < 1) {
// sprintf(pg_result, "Wrong command format"); // sprintf(pg_result, "Wrong command format");
...@@ -1870,12 +1865,8 @@ static ssize_t pktgen_thread_write(struct file *file, ...@@ -1870,12 +1865,8 @@ static ssize_t pktgen_thread_write(struct file *file,
} }
if (!strcmp(name, "max_before_softirq")) { if (!strcmp(name, "max_before_softirq")) {
len = num_arg(&user_buffer[i], 10, &value); sprintf(pg_result, "OK: Note! max_before_softirq is obsoleted -- Do not use");
mutex_lock(&pktgen_thread_lock);
t->max_before_softirq = value;
mutex_unlock(&pktgen_thread_lock);
ret = count; ret = count;
sprintf(pg_result, "OK: max_before_softirq=%lu", value);
goto out; goto out;
} }
...@@ -2154,7 +2145,6 @@ static void spin(struct pktgen_dev *pkt_dev, __u64 spin_until_us) ...@@ -2154,7 +2145,6 @@ static void spin(struct pktgen_dev *pkt_dev, __u64 spin_until_us)
if (spin_until_us - now > jiffies_to_usecs(1) + 1) if (spin_until_us - now > jiffies_to_usecs(1) + 1)
schedule_timeout_interruptible(1); schedule_timeout_interruptible(1);
else if (spin_until_us - now > 100) { else if (spin_until_us - now > 100) {
do_softirq();
if (!pkt_dev->running) if (!pkt_dev->running)
return; return;
if (need_resched()) if (need_resched())
...@@ -3524,8 +3514,6 @@ static int pktgen_thread_worker(void *arg) ...@@ -3524,8 +3514,6 @@ static int pktgen_thread_worker(void *arg)
struct pktgen_thread *t = arg; struct pktgen_thread *t = arg;
struct pktgen_dev *pkt_dev = NULL; struct pktgen_dev *pkt_dev = NULL;
int cpu = t->cpu; int cpu = t->cpu;
u32 max_before_softirq;
u32 tx_since_softirq = 0;
BUG_ON(smp_processor_id() != cpu); BUG_ON(smp_processor_id() != cpu);
...@@ -3533,8 +3521,6 @@ static int pktgen_thread_worker(void *arg) ...@@ -3533,8 +3521,6 @@ static int pktgen_thread_worker(void *arg)
pr_debug("pktgen: starting pktgen/%d: pid=%d\n", cpu, current->pid); pr_debug("pktgen: starting pktgen/%d: pid=%d\n", cpu, current->pid);
max_before_softirq = t->max_before_softirq;
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
set_freezable(); set_freezable();
...@@ -3553,24 +3539,9 @@ static int pktgen_thread_worker(void *arg) ...@@ -3553,24 +3539,9 @@ static int pktgen_thread_worker(void *arg)
__set_current_state(TASK_RUNNING); __set_current_state(TASK_RUNNING);
if (pkt_dev) { if (pkt_dev)
pktgen_xmit(pkt_dev); pktgen_xmit(pkt_dev);
/*
* We like to stay RUNNING but must also give
* others fair share.
*/
tx_since_softirq += pkt_dev->last_ok;
if (tx_since_softirq > max_before_softirq) {
if (local_softirq_pending())
do_softirq();
tx_since_softirq = 0;
}
}
if (t->control & T_STOP) { if (t->control & T_STOP) {
pktgen_stop(t); pktgen_stop(t);
t->control &= ~(T_STOP); t->control &= ~(T_STOP);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment