summaryrefslogtreecommitdiff
path: root/patch
blob: 83a4607ef48fa7f8ff6e6316265e72dce4734874 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Fix naming conflict

--- dde/e1000e/netdev.c.orig	2012-02-24 03:45:47.000000000 +0000
+++ dde/e1000e/netdev.c	2012-02-24 03:45:52.000000000 +0000
@@ -5217,7 +5217,7 @@
  * e1000_init_module is the first routine called when the driver is
  * loaded. All it does is register with the PCI subsystem.
  **/
-static int __init e1000_init_module(void)
+static int __init e1000e_init_module(void)
 {
 	int ret;
 	printk(KERN_INFO "%s: Intel(R) PRO/1000 Network Driver - %s\n",
@@ -5230,7 +5230,7 @@
 				
 	return ret;
 }
-module_init(e1000_init_module);
+module_init(e1000e_init_module);
 
 /**
  * e1000_exit_module - Driver Exit Cleanup Routine

commit 349124a00754129a5f1e43efa84733e364bf3749
Author: Figo.zhang <zhangtianfei@leadcoretech.com>
Date:   Mon Jun 7 21:13:22 2010 +0000

    net8139: fix a race at the end of NAPI
    
    fix a race at the end of NAPI complete processing, it had
    better do __napi_complete() first before re-enable interrupt.
    
    Signed-off-by:Figo.zhang <figo1802@gmail.com>
    
    Signed-off-by: David S. Miller <davem@davemloft.net>

diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
index 9c14975..284a5f4 100644
--- dde/8139cp.c
+++ dde/8139cp.c
@@ -598,8 +598,8 @@ rx_next:
 			goto rx_status_loop;
 
 		spin_lock_irqsave(&cp->lock, flags);
-		cpw16_f(IntrMask, cp_intr_mask);
 		__napi_complete(napi);
+		cpw16_f(IntrMask, cp_intr_mask);
 		spin_unlock_irqrestore(&cp->lock, flags);
 	}
 
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index 80cd074..97d8068 100644
--- dde/8139too.c
+++ dde/8139too.c
@@ -2089,8 +2089,8 @@ static int rtl8139_poll(struct napi_struct *napi, int budget)
 		 * again when we think we are done.
 		 */
 		spin_lock_irqsave(&tp->lock, flags);
-		RTL_W16_F(IntrMask, rtl8139_intr_mask);
 		__napi_complete(napi);
+		RTL_W16_F(IntrMask, rtl8139_intr_mask);
 		spin_unlock_irqrestore(&tp->lock, flags);
 	}
 	spin_unlock(&tp->rx_lock);

Work around a bug in qemu which makes it fill the ring at initialization if a
packet comes at the wrong time.

--- dde/e1000/e1000_main.c
+++ dde/e1000/e1000_main.c
@@ -3759,6 +3759,21 @@ static irqreturn_t e1000_intr(int irq, void *data)
 	if (unlikely((!icr) || test_bit(__E1000_DOWN, &adapter->flags)))
 		return IRQ_NONE;  /* Not our interrupt */
 
+	if (unlikely(icr & E1000_ICR_RXO)) {
+		/* Receive Overrun */
+		u32 rctl;
+		int i;
+		rctl = er32(RCTL);
+		ew32(RCTL, rctl & ~E1000_RCTL_EN);
+		for (i = 0; i < adapter->num_rx_queues; i++) {
+			memset(adapter->rx_ring[i].desc, 0, adapter->rx_ring[i].size);
+			adapter->rx_ring[i].next_to_clean = 0;
+		}
+		ew32(RDH, 0);
+		ew32(RCTL, rctl);
+		adapter->netdev->stats.rx_fifo_errors++;
+	}
+
 	if (unlikely(icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC))) {
 		hw->get_link_status = 1;
 		/* guard against interrupt when we're going down */