From: Ben Pfaff Date: Mon, 13 Jul 2009 16:41:26 +0000 (-0700) Subject: datapath: Don't orphan packets in dp_dev transmit path. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0858ad2b9d2f594f99bb11fc9b331ce8b1de953d;hp=67ca9e6d90808f22332cf475ad01e01bf5d46c4f;p=openvswitch datapath: Don't orphan packets in dp_dev transmit path. Before commit 72ca14c1 "datapath: Fix race against workqueue in dp_dev and simplify code," the dp_dev network device had a device queue, and we would orphan packets before sticking them on the queue. This screwed up socket accounting a bit, but the effect was limited to the device queue length. Now, after that commit, the dp_dev device has no device queue, but it still orphans packets. This screws up socket accounting a *lot*, because the effect is now unlimited, since there is no queue to limit it. The solution is to not orphan packets at all. There is little need for it now since packet transmission now happens immediately, not in a workqueue whose execution may be delayed. This should fix bug #1519, which tests "netperf -t UDP_STREAM" performance, finding that an unrealistically high number of UDP packets could be sent but that none at all were received. The send rate is due to the orphaning, the receive rate presumably because at least one out of approx. 65535/1500 = 44 fragments per full packet were dropped in each case. --- diff --git a/datapath/dp_dev.c b/datapath/dp_dev.c index 5aa32f04..3902a8c5 100644 --- a/datapath/dp_dev.c +++ b/datapath/dp_dev.c @@ -86,12 +86,6 @@ 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)