Subject: [PATCH] net: release dst entry while cache-hot for GSO case too

From: Krishna Kumar <[email-masked]>
Date: Thu, 10 Dec 2009 12:29:58 +0530

From: Krishna Kumar <[email-masked]>

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 <[email-masked]>
---

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)