Skip to contentSkip to conversation

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

PATCH Applied Krishna Kumar 3 participants 3 messages Dec 10, 2009 – Dec 23, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

From: Krishna Kumar <[email protected]>

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.

---

net/core/dev.c +8 -0
diff -ruNp org/net/core/dev.c new/net/core/dev.c
@@ -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 on v1 1/1
#1 lore raw
Quoted 17 lines · Krishna Kumar

From: Krishna Kumar <[email protected]>

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.

---

diff -ruNp org/net/core/dev.c new/net/core/dev.c

net/core/dev.c +1 -0
@@ -1853,6 +1853,14 @@ gso:
 
 		skb->next = nskb->next;
 		nskb->next = NULL;
+

net/core/dev.c gso: · line 1866

Quoted 10 lines
net/core/dev.c +7 -0
+		/*
+		 * 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)