Re: [PATCH] net: Fix vlan_gro_frags vs netpoll and bonding paths
From: Jarek Poplawski <hidden>
Date: 2010-08-28 09:44:39
On Sat, Aug 28, 2010 at 08:13:37AM +0800, Herbert Xu wrote:
On Fri, Aug 27, 2010 at 10:50:42PM +0200, Jarek Poplawski wrote:quoted
After positive netpoll_rx_on() check in vlan_gro_receive() there is skipped part of the "common" GRO_NORMAL path, especially "pull:" in dev_gro_receive(), where at least eth header should be copied for entirely paged skbs. So, eth_type_trans() can read zeroed header only.Right, thanks for catching this.quoted
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c index 01ddb04..58289fe 100644 --- a/net/8021q/vlan_core.c +++ b/net/8021q/vlan_core.c@@ -139,13 +139,19 @@ gro_result_t vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp, if (!skb) return GRO_DROP; - if (netpoll_rx_on(skb)) { - skb->protocol = eth_type_trans(skb, skb->dev); + /* + * Complete the eth header here, mainly for skb_bond_should_drop(), + * and for netpoll_rx_on() btw. + */ + skb_gro_pull_in(skb); + skb->protocol = eth_type_trans(skb, skb->dev); + skb_gro_pull(skb, -ETH_HLEN);But this code should go into the netpoll (i.e., slow-path) case only so as not to impede performance.
I'm not sure I can understand. What about skb_bond_should_drop() mentioned in the comments? IMHO we have to impede performance a bit (and treat it similarly to non-fragmented path) just to fix it, and consider optimization of this bonding call later.
Also, we need to fix this for the non-VLAN case as well.
But the only other non-VLAN case I know was fixed already... Cheers, Jarek P.