aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netpoll.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2009-03-16 13:50:02 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-16 13:50:02 -0400
commitd1c76af9e2434fac3add561e26c61b06503de986 (patch)
treecbedc7c96c4b7db3d7a5a8300117804c5e0230d9 /include/linux/netpoll.h
parentafece1c6587010cc81d1a43045c855774e8234a3 (diff)
GRO: Move netpoll checks to correct location
As my netpoll fix for net doesn't really work for net-next, we need this update to move the checks into the right place. As it stands we may pass freed skbs to netpoll_receive_skb. This patch also introduces a netpoll_rx_on function to avoid GRO completely if we're invoked through netpoll. This might seem paranoid but as netpoll may have an external receive hook it's better to be safe than sorry. I don't think we need this for 2.6.29 though since there's nothing immediately broken by it. This patch also moves the GRO_* return values to netdevice.h since VLAN needs them too (I tried to avoid this originally but alas this seems to be the easiest way out). This fixes a bug in VLAN where it continued to use the old return value 2 instead of the correct GRO_DROP. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netpoll.h')
-rw-r--r--include/linux/netpoll.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index e38d3c9dccda..de99025f2c5d 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -63,6 +63,13 @@ static inline int netpoll_rx(struct sk_buff *skb)
63 return ret; 63 return ret;
64} 64}
65 65
66static inline int netpoll_rx_on(struct sk_buff *skb)
67{
68 struct netpoll_info *npinfo = skb->dev->npinfo;
69
70 return npinfo && (npinfo->rx_np || npinfo->rx_flags);
71}
72
66static inline int netpoll_receive_skb(struct sk_buff *skb) 73static inline int netpoll_receive_skb(struct sk_buff *skb)
67{ 74{
68 if (!list_empty(&skb->dev->napi_list)) 75 if (!list_empty(&skb->dev->napi_list))
@@ -99,6 +106,10 @@ static inline int netpoll_rx(struct sk_buff *skb)
99{ 106{
100 return 0; 107 return 0;
101} 108}
109static inline int netpoll_rx_on(struct sk_buff *skb)
110{
111 return 0;
112}
102static inline int netpoll_receive_skb(struct sk_buff *skb) 113static inline int netpoll_receive_skb(struct sk_buff *skb)
103{ 114{
104 return 0; 115 return 0;