mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH][4/6] CPU Hotplug net/
  2003-02-03 11:37 [PATCH][4/6] CPU Hotplug net/ Zwane Mwaikambo
@ 2003-02-03 11:30 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2003-02-03 11:30 UTC (permalink / raw)
  To: zwane; +Cc: linux-kernel


Looks ok.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH][4/6] CPU Hotplug net/
@ 2003-02-03 11:37 Zwane Mwaikambo
  2003-02-03 11:30 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Zwane Mwaikambo @ 2003-02-03 11:37 UTC (permalink / raw)
  To: Linux Kernel; +Cc: David S. Miller

Hi Dave,
	This isn't a patch for inclusion, but a request for a once over.
Thanks,
	Zwane

 dev.c |   64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 64 insertions(+)

Index: linux-2.5.59-lch2/net/core/dev.c
===================================================================
RCS file: /build/cvsroot/linux-2.5.59/net/core/dev.c,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -u -r1.1.1.1 -r1.1.1.1.2.1
--- linux-2.5.59-lch2/net/core/dev.c	17 Jan 2003 11:16:28 -0000	1.1.1.1
+++ linux-2.5.59-lch2/net/core/dev.c	20 Jan 2003 13:48:28 -0000	1.1.1.1.2.1
@@ -2945,3 +2945,67 @@
 	return call_usermodehelper(argv [0], argv, envp);
 }
 #endif
+
+static int dev_cpu_callback(struct notifier_block *nfb, unsigned long action, void * ocpu)
+{
+        struct sk_buff *list_sk, *sk_head;
+        struct net_device *list_net, *net_head;
+        struct softnet_data *queue;
+        struct sk_buff *skb;
+        unsigned int  cpu = smp_processor_id();
+	unsigned long oldcpu = (unsigned long) ocpu;
+	unsigned long flags;
+
+	if (action != CPU_OFFLINE)
+		return 0;
+
+	local_irq_save(flags);
+
+        /* Move completion queue */
+
+        list_sk = softnet_data[oldcpu].completion_queue;
+        if (list_sk != NULL) {
+                sk_head = list_sk;
+                while (list_sk->next != NULL)
+                        list_sk = list_sk->next;
+                list_sk->next = softnet_data[cpu].completion_queue;
+                softnet_data[cpu].completion_queue = sk_head;
+                softnet_data[oldcpu].completion_queue = NULL;
+        }
+
+        /* Move output_queue */
+
+        list_net = softnet_data[oldcpu].output_queue;
+        if (list_net != NULL) {
+                net_head = list_net;
+                while (list_net->next != NULL)
+                        list_net = list_net->next_sched;
+                list_net->next_sched = softnet_data[cpu].output_queue;
+                softnet_data[cpu].output_queue = net_head;
+                softnet_data[oldcpu].output_queue = NULL;
+        }
+
+	local_irq_restore(flags);
+        
+        /* Move input_pkt_queue */
+
+	queue = &softnet_data[oldcpu];
+        for (;;) {
+                skb = __skb_dequeue(&queue->input_pkt_queue);
+                if (skb == NULL)
+                        break;
+                netif_rx(skb);
+        }
+
+        return 0;
+}
+
+static struct notifier_block cpu_callback_nfb = {&dev_cpu_callback, NULL, 0 };
+
+static int __init dev_cpu_callback_init(void)
+{
+        register_cpu_notifier(&cpu_callback_nfb);
+        return 0;
+}
+
+__initcall(dev_cpu_callback_init);



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-02-03 11:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-03 11:37 [PATCH][4/6] CPU Hotplug net/ Zwane Mwaikambo
2003-02-03 11:30 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®