From 00c030a5971ee311a474529407b3751b1fbacbcf Mon Sep 17 00:00:00 2001
From: Ben Pfaff <blp@nicira.com>
Date: Mon, 13 Jul 2009 11:56:26 -0700
Subject: [PATCH] Revert "datapath: Don't orphan packets in dp_dev transmit
 path."

This reverts commit 0858ad2b9d2f594f99bb11fc9b331ce8b1de953d.
Although that commit partially fixed a performance regression
relative to the Linux bridge, it introduced other problems that
were not apparent in the performance testing (e.g.
WARN_ON_ONCE(skb->destructor) now triggers in dp_process_received_packet()).
The fix is not completely obvious, so reverting now to ensure stability
while investigating the problem.
---
 datapath/dp_dev.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/datapath/dp_dev.c b/datapath/dp_dev.c
index 3902a8c5f..5aa32f048 100644
--- a/datapath/dp_dev.c
+++ b/datapath/dp_dev.c
@@ -86,6 +86,12 @@ static int dp_dev_xmit(struct sk_buff *skb, struct net_device *netdev)
 	struct dp_dev *dp_dev = dp_dev_priv(netdev);
 	struct pcpu_lstats *lb_stats;
 
+	/* By orphaning 'skb' we will screw up socket accounting slightly, but
+	 * the effect is limited to the device queue length.  If we don't
+	 * do this, then the sk_buff will be destructed eventually, but it is
+	 * harder to predict when. */
+	skb_orphan(skb);
+
 	/* dp_process_received_packet() needs its own clone. */
 	skb = skb_share_check(skb, GFP_ATOMIC);
 	if (!skb)
-- 
2.47.0