aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/core/pktgen.c35
1 files changed, 3 insertions, 32 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 1d6f1c6270b6..84c0edeedf6d 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -167,7 +167,7 @@
167#include <asm/div64.h> /* do_div */ 167#include <asm/div64.h> /* do_div */
168#include <asm/timex.h> 168#include <asm/timex.h>
169 169
170#define VERSION "pktgen v2.68: Packet Generator for packet performance testing.\n" 170#define VERSION "pktgen v2.69: Packet Generator for packet performance testing.\n"
171 171
172/* The buckets are exponential in 'width' */ 172/* The buckets are exponential in 'width' */
173#define LAT_BUCKETS_MAX 32 173#define LAT_BUCKETS_MAX 32
@@ -384,7 +384,6 @@ struct pktgen_thread {
384 struct list_head th_list; 384 struct list_head th_list;
385 struct task_struct *tsk; 385 struct task_struct *tsk;
386 char result[512]; 386 char result[512];
387 u32 max_before_softirq; /* We'll call do_softirq to prevent starvation. */
388 387
389 /* Field for thread to receive "posted" events terminate, stop ifs etc. */ 388 /* Field for thread to receive "posted" events terminate, stop ifs etc. */
390 389
@@ -1761,9 +1760,6 @@ static int pktgen_thread_show(struct seq_file *seq, void *v)
1761 1760
1762 BUG_ON(!t); 1761 BUG_ON(!t);
1763 1762
1764 seq_printf(seq, "Name: %s max_before_softirq: %d\n",
1765 t->tsk->comm, t->max_before_softirq);
1766
1767 seq_printf(seq, "Running: "); 1763 seq_printf(seq, "Running: ");
1768 1764
1769 if_lock(t); 1765 if_lock(t);
@@ -1796,7 +1792,6 @@ static ssize_t pktgen_thread_write(struct file *file,
1796 int i = 0, max, len, ret; 1792 int i = 0, max, len, ret;
1797 char name[40]; 1793 char name[40];
1798 char *pg_result; 1794 char *pg_result;
1799 unsigned long value = 0;
1800 1795
1801 if (count < 1) { 1796 if (count < 1) {
1802 // sprintf(pg_result, "Wrong command format"); 1797 // sprintf(pg_result, "Wrong command format");
@@ -1870,12 +1865,8 @@ static ssize_t pktgen_thread_write(struct file *file,
1870 } 1865 }
1871 1866
1872 if (!strcmp(name, "max_before_softirq")) { 1867 if (!strcmp(name, "max_before_softirq")) {
1873 len = num_arg(&user_buffer[i], 10, &value); 1868 sprintf(pg_result, "OK: Note! max_before_softirq is obsoleted -- Do not use");
1874 mutex_lock(&pktgen_thread_lock);
1875 t->max_before_softirq = value;
1876 mutex_unlock(&pktgen_thread_lock);
1877 ret = count; 1869 ret = count;
1878 sprintf(pg_result, "OK: max_before_softirq=%lu", value);
1879 goto out; 1870 goto out;
1880 } 1871 }
1881 1872
@@ -2154,7 +2145,6 @@ static void spin(struct pktgen_dev *pkt_dev, __u64 spin_until_us)
2154 if (spin_until_us - now > jiffies_to_usecs(1) + 1) 2145 if (spin_until_us - now > jiffies_to_usecs(1) + 1)
2155 schedule_timeout_interruptible(1); 2146 schedule_timeout_interruptible(1);
2156 else if (spin_until_us - now > 100) { 2147 else if (spin_until_us - now > 100) {
2157 do_softirq();
2158 if (!pkt_dev->running) 2148 if (!pkt_dev->running)
2159 return; 2149 return;
2160 if (need_resched()) 2150 if (need_resched())
@@ -3524,8 +3514,6 @@ static int pktgen_thread_worker(void *arg)
3524 struct pktgen_thread *t = arg; 3514 struct pktgen_thread *t = arg;
3525 struct pktgen_dev *pkt_dev = NULL; 3515 struct pktgen_dev *pkt_dev = NULL;
3526 int cpu = t->cpu; 3516 int cpu = t->cpu;
3527 u32 max_before_softirq;
3528 u32 tx_since_softirq = 0;
3529 3517
3530 BUG_ON(smp_processor_id() != cpu); 3518 BUG_ON(smp_processor_id() != cpu);
3531 3519
@@ -3533,8 +3521,6 @@ static int pktgen_thread_worker(void *arg)
3533 3521
3534 pr_debug("pktgen: starting pktgen/%d: pid=%d\n", cpu, current->pid); 3522 pr_debug("pktgen: starting pktgen/%d: pid=%d\n", cpu, current->pid);
3535 3523
3536 max_before_softirq = t->max_before_softirq;
3537
3538 set_current_state(TASK_INTERRUPTIBLE); 3524 set_current_state(TASK_INTERRUPTIBLE);
3539 3525
3540 set_freezable(); 3526 set_freezable();
@@ -3553,24 +3539,9 @@ static int pktgen_thread_worker(void *arg)
3553 3539
3554 __set_current_state(TASK_RUNNING); 3540 __set_current_state(TASK_RUNNING);
3555 3541
3556 if (pkt_dev) { 3542 if (pkt_dev)
3557
3558 pktgen_xmit(pkt_dev); 3543 pktgen_xmit(pkt_dev);
3559 3544
3560 /*
3561 * We like to stay RUNNING but must also give
3562 * others fair share.
3563 */
3564
3565 tx_since_softirq += pkt_dev->last_ok;
3566
3567 if (tx_since_softirq > max_before_softirq) {
3568 if (local_softirq_pending())
3569 do_softirq();
3570 tx_since_softirq = 0;
3571 }
3572 }
3573
3574 if (t->control & T_STOP) { 3545 if (t->control & T_STOP) {
3575 pktgen_stop(t); 3546 pktgen_stop(t);
3576 t->control &= ~(T_STOP); 3547 t->control &= ~(T_STOP);