aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-09-14 08:19:08 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-09-14 08:19:08 -0400
commit905ec87e93bc9e01b15c60035cd6a50c636cbaef (patch)
tree46fd7618d6511611ffc19eb0dd4d7bc6b90a41c2 /net/core
parent1d6ae775d7a948c9575658eb41184fd2e506c0df (diff)
parent2f4ba45a75d6383b4a1201169a808ffea416ffa0 (diff)
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dst.c3
-rw-r--r--net/core/netpoll.c4
-rw-r--r--net/core/pktgen.c15
3 files changed, 9 insertions, 13 deletions
diff --git a/net/core/dst.c b/net/core/dst.c
index 334790da9f16..470c05bc4cb2 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -39,8 +39,7 @@ static unsigned long dst_gc_timer_inc = DST_GC_MAX;
39static void dst_run_gc(unsigned long); 39static void dst_run_gc(unsigned long);
40static void ___dst_free(struct dst_entry * dst); 40static void ___dst_free(struct dst_entry * dst);
41 41
42static struct timer_list dst_gc_timer = 42static DEFINE_TIMER(dst_gc_timer, dst_run_gc, DST_GC_MIN, 0);
43 TIMER_INITIALIZER(dst_run_gc, DST_GC_MIN, 0);
44 43
45static void dst_run_gc(unsigned long dummy) 44static void dst_run_gc(unsigned long dummy)
46{ 45{
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index a1a9a7abff50..5265dfd69928 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -645,10 +645,10 @@ int netpoll_setup(struct netpoll *np)
645 645
646 npinfo->rx_flags = 0; 646 npinfo->rx_flags = 0;
647 npinfo->rx_np = NULL; 647 npinfo->rx_np = NULL;
648 npinfo->poll_lock = SPIN_LOCK_UNLOCKED; 648 spin_lock_init(&npinfo->poll_lock);
649 npinfo->poll_owner = -1; 649 npinfo->poll_owner = -1;
650 npinfo->tries = MAX_RETRIES; 650 npinfo->tries = MAX_RETRIES;
651 npinfo->rx_lock = SPIN_LOCK_UNLOCKED; 651 spin_lock_init(&npinfo->rx_lock);
652 } else 652 } else
653 npinfo = ndev->npinfo; 653 npinfo = ndev->npinfo;
654 654
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 8eb083b6041a..ef430b1e8e42 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -503,7 +503,7 @@ static int pg_delay_d = 0;
503static int pg_clone_skb_d = 0; 503static int pg_clone_skb_d = 0;
504static int debug = 0; 504static int debug = 0;
505 505
506static spinlock_t _thread_lock = SPIN_LOCK_UNLOCKED; 506static DEFINE_SPINLOCK(_thread_lock);
507static struct pktgen_thread *pktgen_threads = NULL; 507static struct pktgen_thread *pktgen_threads = NULL;
508 508
509static char module_fname[128]; 509static char module_fname[128];
@@ -1452,8 +1452,7 @@ static int proc_thread_write(struct file *file, const char __user *user_buffer,
1452 thread_lock(); 1452 thread_lock();
1453 t->control |= T_REMDEV; 1453 t->control |= T_REMDEV;
1454 thread_unlock(); 1454 thread_unlock();
1455 current->state = TASK_INTERRUPTIBLE; 1455 schedule_timeout_interruptible(msecs_to_jiffies(125)); /* Propagate thread->control */
1456 schedule_timeout(HZ/8); /* Propagate thread->control */
1457 ret = count; 1456 ret = count;
1458 sprintf(pg_result, "OK: rem_device_all"); 1457 sprintf(pg_result, "OK: rem_device_all");
1459 goto out; 1458 goto out;
@@ -1716,10 +1715,9 @@ static void spin(struct pktgen_dev *pkt_dev, __u64 spin_until_us)
1716 printk(KERN_INFO "sleeping for %d\n", (int)(spin_until_us - now)); 1715 printk(KERN_INFO "sleeping for %d\n", (int)(spin_until_us - now));
1717 while (now < spin_until_us) { 1716 while (now < spin_until_us) {
1718 /* TODO: optimise sleeping behavior */ 1717 /* TODO: optimise sleeping behavior */
1719 if (spin_until_us - now > (1000000/HZ)+1) { 1718 if (spin_until_us - now > jiffies_to_usecs(1)+1)
1720 current->state = TASK_INTERRUPTIBLE; 1719 schedule_timeout_interruptible(1);
1721 schedule_timeout(1); 1720 else if (spin_until_us - now > 100) {
1722 } else if (spin_until_us - now > 100) {
1723 do_softirq(); 1721 do_softirq();
1724 if (!pkt_dev->running) 1722 if (!pkt_dev->running)
1725 return; 1723 return;
@@ -2449,8 +2447,7 @@ static void pktgen_run_all_threads(void)
2449 } 2447 }
2450 thread_unlock(); 2448 thread_unlock();
2451 2449
2452 current->state = TASK_INTERRUPTIBLE; 2450 schedule_timeout_interruptible(msecs_to_jiffies(125)); /* Propagate thread->control */
2453 schedule_timeout(HZ/8); /* Propagate thread->control */
2454 2451
2455 pktgen_wait_all_threads_run(); 2452 pktgen_wait_all_threads_run();
2456} 2453}