netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [STABLE 2.6.32 PATCH] net: release dst entry while cache-hot for GSO case too
@ 2010-10-11 15:20 Andrey Vagin
  2010-10-11 15:40 ` Michael Tokarev
  0 siblings, 1 reply; 13+ messages in thread
From: Andrey Vagin @ 2010-10-11 15:20 UTC (permalink / raw)
  To: stable; +Cc: netdev, Krishna Kumar, David S. Miller, Andrey Vagin

From: Krishna Kumar <krkumar2@in.ibm.com>

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 <krkumar2@in.ibm.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
---
 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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-12-21  0:14 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-11 15:20 [STABLE 2.6.32 PATCH] net: release dst entry while cache-hot for GSO case too Andrey Vagin
2010-10-11 15:40 ` Michael Tokarev
2010-10-11 15:46   ` Eric Dumazet
2010-10-11 15:59     ` David Miller
2010-10-11 16:19       ` Andrew Vagin
2010-10-11 16:30         ` Eric Dumazet
2010-10-11 16:55           ` Michael Tokarev
2010-10-26 18:54           ` David Miller
2010-12-08 22:47             ` avagin
2010-12-08 23:05               ` Greg KH
2010-12-09  6:43                 ` [stable] " avagin
2010-12-09 18:19                   ` Greg KH
2010-12-21  0:07                     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).