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

From: "[email-masked]" <[email-masked]>
Date: Thu, 09 Dec 2010 09:43:03 +0300

I add the patch in attachments

On 12/09/2010 02:05 AM, Greg KH wrote:
> On Thu, Dec 09, 2010 at 01:47:41AM +0300, [email-masked] wrote:
>> Hi Greg,
>>
>> This patch is acked by David S. Miller. Greg, maybe you can commit it?
>
> What specific patch please?
>
> confused,
>
> greg k-h

Subject: [STABLE 2.6.32 PATCH] net: release dst entry while cache-hot for GSO case too
From: Andrey Vagin <[email-masked]>
To: [email-masked]
Cc: [email-masked], Krishna Kumar <[email-masked]>, "David S. Miller" <[email-masked]>, Andrey Vagin <[email-masked]>
Date: Mon, 11 Oct 2010 19:20:13 +0400

From: Krishna Kumar <[email-masked]>

commit 068a2de57ddf4f472e32e7af868613c574ad1d88 upstream.

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.

Note: Without this patch the kernel may oops if used bridged veth
devices. A bridge set skb->dst = fake_dst_ops, veth transfers this skb
to netif_receive_skb...ip_rcv_finish and it calls dst_input(skb), but
fake_dst_ops->input = NULL -> Oops

Signed-off-by: Krishna Kumar <[email-masked]>
Acked-by: Eric Dumazet <[email-masked]>
Signed-off-by: David S. Miller <[email-masked]>
Signed-off-by: Andrey Vagin <[email-masked]>
---
 net/core/dev.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 915d0ae..c325ab6 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1747,6 +1747,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)) {
 			nskb->next = skb->next;
-- 
1.7.2.1