diff mbox

ixgbe: Replace LRO with GRO

Message ID 20090117130404.GA17810@gondor.apana.org.au
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Herbert Xu Jan. 17, 2009, 1:04 p.m. UTC
On Sat, Jan 17, 2009 at 08:52:56PM +1100, Herbert Xu wrote:
> 
> > > However, it is not very clear what is causing this loss.  BTW,
> > > did you apply the fix b0059b50b70dc3a908bea4ece2f9494a22200018
> > > (gro: Fix page ref count for skbs freed normally) on both sides?
> > > That one is required to make igb or ixgbe work properly.
> > Ah - doesn't seem like I have this fix. Jeff will have to pull this in our test tree.
> 
> OK, although this bug should only manifest itself if aggregation
> occurs, which apparently isn't the case according to the dump.

Doh, it looks like the bug fix itself was broken.  In fact, I
think you do have the fix as it results in exactly what you were
seeing.

Please apply this on top of it.

gro: Fix merging of paged packets

The previous fix to paged packets broke the merging because it
reset the skb->len before we added it to the merged packet.  This
wasn't detected because it simply resulted in the truncation of
the packet while the missing bit is subsequently retransmitted.

The fix is to store skb->len before we clobber it.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


Cheers,

Comments

Emil Tantilov Jan. 20, 2009, 11 p.m. UTC | #1
Herbert Xu wrote:
> On Sat, Jan 17, 2009 at 08:52:56PM +1100, Herbert Xu wrote:
>> 
>>>> However, it is not very clear what is causing this loss.  BTW,
>>>> did you apply the fix b0059b50b70dc3a908bea4ece2f9494a22200018
>>>> (gro: Fix page ref count for skbs freed normally) on both sides?
>>>> That one is required to make igb or ixgbe work properly.
>>> Ah - doesn't seem like I have this fix. Jeff will have to pull this
>>> in our test tree. 
>> 
>> OK, although this bug should only manifest itself if aggregation
>> occurs, which apparently isn't the case according to the dump.
> 
> Doh, it looks like the bug fix itself was broken.  In fact, I
> think you do have the fix as it results in exactly what you were
> seeing.
> 
> Please apply this on top of it.
> 
> gro: Fix merging of paged packets
> 
> The previous fix to paged packets broke the merging because it
> reset the skb->len before we added it to the merged packet.  This
> wasn't detected because it simply resulted in the truncation of
> the packet while the missing bit is subsequently retransmitted.
> 
> The fix is to store skb->len before we clobber it.
> 
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
> 
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 65eac77..9127c47 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -2588,8 +2588,9 @@ int skb_gro_receive(struct sk_buff **head,
>  	struct sk_buff *skb) struct sk_buff *nskb;
>  	unsigned int headroom;
>  	unsigned int hlen = p->data - skb_mac_header(p);
> +	unsigned int len = skb->len;
> 
> -	if (hlen + p->len + skb->len >= 65536)
> +	if (hlen + p->len + len >= 65536)
>  		return -E2BIG;
> 
>  	if (skb_shinfo(p)->frag_list)
> @@ -2651,9 +2652,9 @@ merge:
> 
>  done:
>  	NAPI_GRO_CB(p)->count++;
> -	p->data_len += skb->len;
> -	p->truesize += skb->len;
> -	p->len += skb->len;
> +	p->data_len += len;
> +	p->truesize += len;
> +	p->len += len;
> 
>  	NAPI_GRO_CB(skb)->same_flow = 1;
>  	return 0;
> 
> Cheers,


With this patch applied I am no longer seeing the packet loss. I will run some more tests to make sure nothing else is broken, but looks like the original issue is resolved.

Sorry for the late response BTW - I was out on vacation and was only able to do limited testing over the weekend.

Thanks,
Emil--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 65eac77..9127c47 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -2588,8 +2588,9 @@  int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb)
 	struct sk_buff *nskb;
 	unsigned int headroom;
 	unsigned int hlen = p->data - skb_mac_header(p);
+	unsigned int len = skb->len;
 
-	if (hlen + p->len + skb->len >= 65536)
+	if (hlen + p->len + len >= 65536)
 		return -E2BIG;
 
 	if (skb_shinfo(p)->frag_list)
@@ -2651,9 +2652,9 @@  merge:
 
 done:
 	NAPI_GRO_CB(p)->count++;
-	p->data_len += skb->len;
-	p->truesize += skb->len;
-	p->len += skb->len;
+	p->data_len += len;
+	p->truesize += len;
+	p->len += len;
 
 	NAPI_GRO_CB(skb)->same_flow = 1;
 	return 0;