Revert "datapath: Don't orphan packets in dp_dev transmit path."
authorBen Pfaff <blp@nicira.com>
Mon, 13 Jul 2009 18:56:26 +0000 (11:56 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 13 Jul 2009 18:56:26 +0000 (11:56 -0700)
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

index 3902a8c5f2eb21e41070eeeb8dd777f63a421b08..5aa32f0481cbbf58bfa0d9af3c7dfdece6ba40f3 100644 (file)
@@ -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)