summaryrefslogtreecommitdiffstats
path: root/drivers/net/macvtap.c
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2016-07-15 03:46:30 -0400
committerDavid S. Miller <davem@davemloft.net>2016-07-15 17:40:39 -0400
commit1b16bf42d154c8fbbab2cccc419e2ba47d700849 (patch)
treececa5157fc452af785e30c34259478f3038bc475 /drivers/net/macvtap.c
parente980a0764a16897294207eaf4556c3038768adb9 (diff)
macvtap: avoid hash calculating for single queue
We decide the rxq through calculating its hash which is not necessary if we only have one rx queue. So this patch skip this and just return queue 0. Test shows 22% improving on guest rx pps. Before: 1201504 pkts/s After: 1472731 pkts/s Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/macvtap.c')
-rw-r--r--drivers/net/macvtap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 95a13321f688..2476923b424d 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -299,6 +299,9 @@ static struct macvtap_queue *macvtap_get_queue(struct net_device *dev,
299 if (!numvtaps) 299 if (!numvtaps)
300 goto out; 300 goto out;
301 301
302 if (numvtaps == 1)
303 goto single;
304
302 /* Check if we can use flow to select a queue */ 305 /* Check if we can use flow to select a queue */
303 rxq = skb_get_hash(skb); 306 rxq = skb_get_hash(skb);
304 if (rxq) { 307 if (rxq) {
@@ -316,6 +319,7 @@ static struct macvtap_queue *macvtap_get_queue(struct net_device *dev,
316 goto out; 319 goto out;
317 } 320 }
318 321
322single:
319 tap = rcu_dereference(vlan->taps[0]); 323 tap = rcu_dereference(vlan->taps[0]);
320out: 324out:
321 return tap; 325 return tap;