Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1444019

[PATCH net-next 1/2] macvtap: avoid hash calculating for single queue

From Jason Wang <jasowang@redhat.com>
Newsgroups linux.kernel
Subject [PATCH net-next 1/2] macvtap: avoid hash calculating for single queue
Date 2016-07-15 09:50 +0200
Message-ID <rV62L-47o-33@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 drivers/net/macvtap.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 95a1332..2476923 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,
 	if (!numvtaps)
 		goto out;
 
+	if (numvtaps == 1)
+		goto single;
+
 	/* Check if we can use flow to select a queue */
 	rxq = skb_get_hash(skb);
 	if (rxq) {
@@ -316,6 +319,7 @@ static struct macvtap_queue *macvtap_get_queue(struct net_device *dev,
 		goto out;
 	}
 
+single:
 	tap = rcu_dereference(vlan->taps[0]);
 out:
 	return tap;
-- 
1.8.3.1

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH net-next 1/2] macvtap: avoid hash calculating for single queue Jason Wang <jasowang@redhat.com> - 2016-07-15 09:50 +0200
  [PATCH net-next 2/2] macvtap: switch to use skb array Jason Wang <jasowang@redhat.com> - 2016-07-15 09:50 +0200
    Re: [PATCH net-next 2/2] macvtap: switch to use skb array David Miller <davem@davemloft.net> - 2016-07-15 23:50 +0200
  Re: [PATCH net-next 1/2] macvtap: avoid hash calculating for  single queue David Miller <davem@davemloft.net> - 2016-07-15 23:50 +0200

csiph-web