Force interrupts to core 0 on network drivers
authorKevin Klues <klueska@parcad.millennium.berkeley.edu>
Fri, 23 Apr 2010 23:28:31 +0000 (16:28 -0700)
committerKevin Klues <klueska@cs.berkeley.edu>
Thu, 3 Nov 2011 00:35:44 +0000 (17:35 -0700)
Also make the ne2k driver work with MPTABLES disabled

kern/arch/i686/e1000.c
kern/arch/i686/e1000.h
kern/arch/i686/ne2k.c

index d599e01..956941b 100644 (file)
@@ -569,7 +569,9 @@ void e1000_setup_interrupts() {
 
        // Enable irqs for the e1000
 #ifdef __CONFIG_DISABLE_MPTABLES__
-       send_kernel_message(E1000_IRQ_CPU, enable_e1000_irq, 0,0,0, KMSG_IMMEDIATE);
+       // This will route the interrupts automatically to CORE 0
+       // Call send_kernel_message if you want to route them somewhere else
+       enable_e1000_irq(NULL,0,0,0,0);
 #else 
        ioapic_route_irq(e1000_irq, E1000_IRQ_CPU);     
 #endif
index 344529f..4fd5540 100644 (file)
@@ -10,7 +10,7 @@
 #define e1000_interrupt_debug(...)     //printk(__VA_ARGS__)  
 #define e1000_frame_debug(...)         //printk(__VA_ARGS__)  
 
-#define E1000_IRQ_CPU          1
+#define E1000_IRQ_CPU          0
 
 #define INTEL_VENDOR_ID                0x8086
 #define INTEL_DEV_ID0          0x100E  // Real E1000
index db4aeee..4be26c5 100644 (file)
@@ -202,7 +202,13 @@ void ne2k_setup_interrupts() {
        // Kernel based interrupt stuff
        register_interrupt_handler(interrupt_handlers, KERNEL_IRQ_OFFSET + ne2k_irq, ne2k_interrupt_handler, (void *)0);
        
-       ioapic_route_irq(ne2k_irq, 1);  
+#ifdef __CONFIG_DISABLE_MPTABLES__
+       pic_unmask_irq(ne2k_irq);
+       unmask_lapic_lvt(LAPIC_LVT_LINT0);
+       enable_irq();
+#else
+       ioapic_route_irq(ne2k_irq, 0);  
+#endif
        
        SET_PAGE_0();