aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netpoll.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-03-04 15:28:49 -0500
committerDavid S. Miller <davem@davemloft.net>2008-03-04 15:28:49 -0500
commitd9452e9f81e997cbd0c9bface8d2c2a4b064cc3e (patch)
tree6f0ea6264fa359293cc6093fff763305d4c0e9f4 /include/linux/netpoll.h
parentec9b6add7d81f902f6094e71f595da4a362f3348 (diff)
[NETPOLL]: Revert two bogus cleanups that broke netconsole.
Based upon a report by Andrew Morton and code analysis done by Jarek Poplawski. This reverts 33f807ba0d9259e7c75c7a2ce8bd2787e5b540c7 ("[NETPOLL]: Kill NETPOLL_RX_DROP, set but never tested.") and c7b6ea24b43afb5749cb704e143df19d70e23dea ("[NETPOLL]: Don't need rx_flags."). The rx_flags did get tested for zero vs. non-zero and therefore we do need those tests and that code which sets NETPOLL_RX_DROP et al. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netpoll.h')
-rw-r--r--include/linux/netpoll.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index a0525a1f4715..e3d79593fb3a 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -25,6 +25,7 @@ struct netpoll {
25 25
26struct netpoll_info { 26struct netpoll_info {
27 atomic_t refcnt; 27 atomic_t refcnt;
28 int rx_flags;
28 spinlock_t rx_lock; 29 spinlock_t rx_lock;
29 struct netpoll *rx_np; /* netpoll that registered an rx_hook */ 30 struct netpoll *rx_np; /* netpoll that registered an rx_hook */
30 struct sk_buff_head arp_tx; /* list of arp requests to reply to */ 31 struct sk_buff_head arp_tx; /* list of arp requests to reply to */
@@ -50,12 +51,12 @@ static inline int netpoll_rx(struct sk_buff *skb)
50 unsigned long flags; 51 unsigned long flags;
51 int ret = 0; 52 int ret = 0;
52 53
53 if (!npinfo || !npinfo->rx_np) 54 if (!npinfo || (!npinfo->rx_np && !npinfo->rx_flags))
54 return 0; 55 return 0;
55 56
56 spin_lock_irqsave(&npinfo->rx_lock, flags); 57 spin_lock_irqsave(&npinfo->rx_lock, flags);
57 /* check rx_np again with the lock held */ 58 /* check rx_flags again with the lock held */
58 if (npinfo->rx_np && __netpoll_rx(skb)) 59 if (npinfo->rx_flags && __netpoll_rx(skb))
59 ret = 1; 60 ret = 1;
60 spin_unlock_irqrestore(&npinfo->rx_lock, flags); 61 spin_unlock_irqrestore(&npinfo->rx_lock, flags);
61 62