From 923229363a32a793b7198819d141477b8522cf86 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 13 Jul 2009 15:50:32 -0700 Subject: [PATCH] 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. --- datapath/datapath.c | 1 - datapath/dp_dev.c | 6 ------ 2 files changed, 7 deletions(-) diff --git a/datapath/datapath.c b/datapath/datapath.c index eb3f2d2b..5e1a352c 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -516,7 +516,6 @@ void dp_process_received_packet(struct sk_buff *skb, struct net_bridge_port *p) struct sw_flow *flow; WARN_ON_ONCE(skb_shared(skb)); - WARN_ON_ONCE(skb->destructor); /* BHs are off so we don't have to use get_cpu()/put_cpu() here. */ stats = percpu_ptr(dp->stats_percpu, smp_processor_id()); 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) -- 2.30.2