Patchwork [net-next] net: Use consume_skb() to free gso segmented skb

login
register
mail settings
Submitter Sridhar Samudrala
Date April 29, 2013, 11:02 p.m.
Message ID <1367276562.23068.7.camel@sridhar.usor.ibm.com>
Download mbox | patch
Permalink /patch/240527/
State Accepted
Delegated to: David Miller
Headers show

Comments

Sridhar Samudrala - April 29, 2013, 11:02 p.m.
Use consume_skb() to free the original skb that is successfully transmitted 
as gso segmented skbs so that it is not treated as a drop due to an error.

Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
---



--
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
Eric Dumazet - April 30, 2013, 12:33 a.m.
On Mon, 2013-04-29 at 16:02 -0700, Sridhar Samudrala wrote:
> Use consume_skb() to free the original skb that is successfully transmitted 
> as gso segmented skbs so that it is not treated as a drop due to an error.
> 
> Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
> ---
> 
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 7c30dce..4040673 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -2565,8 +2565,11 @@ gso:
>  	} while (skb->next);
>  
>  out_kfree_gso_skb:
> -	if (likely(skb->next == NULL))
> +	if (likely(skb->next == NULL)) {
>  		skb->destructor = DEV_GSO_CB(skb)->destructor;
> +		consume_skb(skb);
> +		return rc;
> +	}
>  out_kfree_skb:
>  	kfree_skb(skb);
>  out:
> 

Acked-by: Eric Dumazet <edumazet@google.com>


--
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
David Miller - April 30, 2013, 4:18 a.m.
From: Sridhar Samudrala <sri@us.ibm.com>
Date: Mon, 29 Apr 2013 16:02:42 -0700

> Use consume_skb() to free the original skb that is successfully transmitted 
> as gso segmented skbs so that it is not treated as a drop due to an error.
> 
> Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>

Applied, thanks.
--
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

Patch

diff --git a/net/core/dev.c b/net/core/dev.c
index 7c30dce..4040673 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2565,8 +2565,11 @@  gso:
 	} while (skb->next);
 
 out_kfree_gso_skb:
-	if (likely(skb->next == NULL))
+	if (likely(skb->next == NULL)) {
 		skb->destructor = DEV_GSO_CB(skb)->destructor;
+		consume_skb(skb);
+		return rc;
+	}
 out_kfree_skb:
 	kfree_skb(skb);
 out: