Skip to contentSkip to conversation

: Fix dev_queue_xmit build with older gcc.

NET Jeff Garzik 2 participants 2 messages Jun 22, 2004 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 33 lines · Linux Kernel Mailing List

ChangeSet 1.1822, 2004/06/21 09:32:44-07:00, [email protected]

[NET]: Fix dev_queue_xmit build with older gcc.

 dev.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff -Nru a/net/core/dev.c b/net/core/dev.c

net/core/dev.c +2 -3
@@ -1406,13 +1406,12 @@
 	   Either shot noqueue qdisc, it is even simpler 8)
 	 */
 	if (dev->flags & IFF_UP) {
-		preempt_disable();
-		int cpu = smp_processor_id();
+		int cpu = get_cpu();
 
 		if (dev->xmit_lock_owner != cpu) {
 
 			HARD_TX_LOCK_BH(dev, cpu);
-			preempt_enable();
+			put_cpu();
 
 			if (!netif_queue_stopped(dev)) {
 				if (netdev_nit)

net/core/dev.c line 1432

Quoted 5 lines
net/core/dev.c +1 -1
@@ -1430,7 +1429,7 @@
 				       "queue packet!\n", dev->name);
 			goto out_enetdown;
 		} else {
-			preempt_enable();
+			put_cpu();

Has this been tested with preempt?

It looks right, but I'm paranoid...

Jeff

#2 lore raw
Quoted 3 lines · Jeff Garzik

Has this been tested with preempt?

It looks right, but I'm paranoid...

It has now. Prior to my last bk pull (a few minutes ago), there were all number of preempt problems leading to scheduling while atomic. They appear to be fixed now.

--Ricky