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>
This commit is contained in:
committed by
David S. Miller
parent
afece1c658
commit
d1c76af9e2
@ -79,6 +79,9 @@ static int vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp,
|
||||
{
|
||||
struct sk_buff *p;
|
||||
|
||||
if (netpoll_rx_on(skb))
|
||||
return GRO_NORMAL;
|
||||
|
||||
if (skb_bond_should_drop(skb))
|
||||
goto drop;
|
||||
|
||||
@ -98,7 +101,7 @@ static int vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp,
|
||||
return dev_gro_receive(napi, skb);
|
||||
|
||||
drop:
|
||||
return 2;
|
||||
return GRO_DROP;
|
||||
}
|
||||
|
||||
int 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,
|
||||
{
|
||||
skb_gro_reset_offset(skb);
|
||||
|
||||
if (netpoll_receive_skb(skb))
|
||||
return NET_RX_DROP;
|
||||
|
||||
return napi_skb_finish(vlan_gro_common(napi, grp, vlan_tci, skb), skb);
|
||||
}
|
||||
EXPORT_SYMBOL(vlan_gro_receive);
|
||||
@ -121,9 +121,6 @@ int vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
|
||||
if (!skb)
|
||||
return NET_RX_DROP;
|
||||
|
||||
if (netpoll_receive_skb(skb))
|
||||
return NET_RX_DROP;
|
||||
|
||||
return napi_frags_finish(napi, skb,
|
||||
vlan_gro_common(napi, grp, vlan_tci, skb));
|
||||
}
|
||||
|
Reference in New Issue
Block a user