aboutsummaryrefslogtreecommitdiffstats
path: root/net/8021q
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 /net/8021q
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 'net/8021q')
-rw-r--r--net/8021q/vlan_core.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index 2d6e405fc498..6227248597c4 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -79,6 +79,9 @@ static int vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp,
79{ 79{
80 struct sk_buff *p; 80 struct sk_buff *p;
81 81
82 if (netpoll_rx_on(skb))
83 return GRO_NORMAL;
84
82 if (skb_bond_should_drop(skb)) 85 if (skb_bond_should_drop(skb))
83 goto drop; 86 goto drop;
84 87
@@ -98,7 +101,7 @@ static int vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp,
98 return dev_gro_receive(napi, skb); 101 return dev_gro_receive(napi, skb);
99 102
100drop: 103drop:
101 return 2; 104 return GRO_DROP;
102} 105}
103 106
104int vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, 107int vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
@@ -106,9 +109,6 @@ int vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
106{ 109{
107 skb_gro_reset_offset(skb); 110 skb_gro_reset_offset(skb);
108 111
109 if (netpoll_receive_skb(skb))
110 return NET_RX_DROP;
111
112 return napi_skb_finish(vlan_gro_common(napi, grp, vlan_tci, skb), skb); 112 return napi_skb_finish(vlan_gro_common(napi, grp, vlan_tci, skb), skb);
113} 113}
114EXPORT_SYMBOL(vlan_gro_receive); 114EXPORT_SYMBOL(vlan_gro_receive);
@@ -121,9 +121,6 @@ int vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
121 if (!skb) 121 if (!skb)
122 return NET_RX_DROP; 122 return NET_RX_DROP;
123 123
124 if (netpoll_receive_skb(skb))
125 return NET_RX_DROP;
126
127 return napi_frags_finish(napi, skb, 124 return napi_frags_finish(napi, skb,
128 vlan_gro_common(napi, grp, vlan_tci, skb)); 125 vlan_gro_common(napi, grp, vlan_tci, skb));
129} 126}