diff mbox

net: release dst entry while cache-hot for GSO case too

Message ID 20091210065958.10261.89370.sendpatchset@localhost.localdomain
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Krishna Kumar Dec. 10, 2009, 6:59 a.m. UTC
From: Krishna Kumar <krkumar2@in.ibm.com>

Non-GSO code drops dst entry for performance reasons, but
the same is missing for GSO code. Drop dst while cache-hot
for GSO case too.

Signed-off-by: Krishna Kumar <krkumar2@in.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

Comments

Eric Dumazet Dec. 10, 2009, 8:21 a.m. UTC | #1
Le 10/12/2009 07:59, Krishna Kumar a écrit :
> From: Krishna Kumar <krkumar2@in.ibm.com>
> 
> Non-GSO code drops dst entry for performance reasons, but
> the same is missing for GSO code. Drop dst while cache-hot
> for GSO case too.
> 
> Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
> ---
> 
> diff -ruNp org/net/core/dev.c new/net/core/dev.c
> --- org/net/core/dev.c	2009-12-10 10:20:39.000000000 +0530
> +++ new/net/core/dev.c	2009-12-10 10:21:17.000000000 +0530
> @@ -1853,6 +1853,14 @@ gso:
>  
>  		skb->next = nskb->next;
>  		nskb->next = NULL;
> +
> +		/*
> +		 * If device doesnt need nskb->dst, release it right now while
> +		 * its hot in this cpu cache
> +		 */
> +		if (dev->priv_flags & IFF_XMIT_DST_RELEASE)
> +			skb_dst_drop(nskb);
> +
>  		rc = ops->ndo_start_xmit(nskb, dev);
>  		if (unlikely(rc != NETDEV_TX_OK)) {
>  			if (rc & ~NETDEV_TX_MASK)

Acked-by: Eric Dumazet <eric.dumazet@gmail.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 Dec. 23, 2009, 10:16 p.m. UTC | #2
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 10 Dec 2009 09:21:00 +0100

> Le 10/12/2009 07:59, Krishna Kumar a écrit :
>> From: Krishna Kumar <krkumar2@in.ibm.com>
>> 
>> Non-GSO code drops dst entry for performance reasons, but
>> the same is missing for GSO code. Drop dst while cache-hot
>> for GSO case too.
>> 
>> Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
 ...
> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied.
--
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 -ruNp org/net/core/dev.c new/net/core/dev.c
--- org/net/core/dev.c	2009-12-10 10:20:39.000000000 +0530
+++ new/net/core/dev.c	2009-12-10 10:21:17.000000000 +0530
@@ -1853,6 +1853,14 @@  gso:
 
 		skb->next = nskb->next;
 		nskb->next = NULL;
+
+		/*
+		 * If device doesnt need nskb->dst, release it right now while
+		 * its hot in this cpu cache
+		 */
+		if (dev->priv_flags & IFF_XMIT_DST_RELEASE)
+			skb_dst_drop(nskb);
+
 		rc = ops->ndo_start_xmit(nskb, dev);
 		if (unlikely(rc != NETDEV_TX_OK)) {
 			if (rc & ~NETDEV_TX_MASK)