netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] macvtap: Fix macvtap_get_queue to use rxhash first
@ 2011-11-24  8:17 Krishna Kumar
  2011-11-24  9:36 ` jasowang
  2011-11-24  9:59 ` Michael S. Tsirkin
  0 siblings, 2 replies; 27+ messages in thread
From: Krishna Kumar @ 2011-11-24  8:17 UTC (permalink / raw)
  To: arnd; +Cc: Krishna Kumar, mst, netdev, virtualization, levinsasha928, davem

It was reported that the macvtap device selects a
different vhost (when used with multiqueue feature)
for incoming packets of a single connection. Use
packet hash first. Patch tested on MQ virtio_net.

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
---
 drivers/net/macvtap.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff -ruNp org/drivers/net/macvtap.c new/drivers/net/macvtap.c
--- org/drivers/net/macvtap.c	2011-10-22 08:38:01.000000000 +0530
+++ new/drivers/net/macvtap.c	2011-11-16 18:34:51.000000000 +0530
@@ -175,6 +175,14 @@ static struct macvtap_queue *macvtap_get
 	if (!numvtaps)
 		goto out;
 
+	/* Check if we can use flow to select a queue */
+	rxq = skb_get_rxhash(skb);
+	if (rxq) {
+		tap = rcu_dereference(vlan->taps[rxq % numvtaps]);
+		if (tap)
+			goto out;
+	}
+
 	if (likely(skb_rx_queue_recorded(skb))) {
 		rxq = skb_get_rx_queue(skb);
 
@@ -186,14 +194,6 @@ static struct macvtap_queue *macvtap_get
 			goto out;
 	}
 
-	/* Check if we can use flow to select a queue */
-	rxq = skb_get_rxhash(skb);
-	if (rxq) {
-		tap = rcu_dereference(vlan->taps[rxq % numvtaps]);
-		if (tap)
-			goto out;
-	}
-
 	/* Everything failed - find first available queue */
 	for (rxq = 0; rxq < MAX_MACVTAP_QUEUES; rxq++) {
 		tap = rcu_dereference(vlan->taps[rxq]);

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2011-12-20 18:46 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-24  8:17 [PATCH] macvtap: Fix macvtap_get_queue to use rxhash first Krishna Kumar
2011-11-24  9:36 ` jasowang
2011-11-24  9:59 ` Michael S. Tsirkin
2011-11-24 10:13   ` jasowang
2011-11-24 10:34     ` Michael S. Tsirkin
2011-11-24 12:56       ` jasowang
2011-11-24 16:14         ` Michael S. Tsirkin
2011-11-25  3:07           ` Krishna Kumar2
2011-11-25  3:21             ` Jason Wang
2011-11-25  4:09               ` Krishna Kumar2
2011-11-25  6:35                 ` David Miller
2011-11-27 17:23                   ` Michael S. Tsirkin
2011-11-28  4:40                     ` Jason Wang
2011-12-07 16:10                   ` Michael S. Tsirkin
2011-12-07 18:52                     ` David Miller
2011-12-20 11:15                       ` Michael S. Tsirkin
2011-12-20 18:46                         ` David Miller
2011-12-08  9:46                     ` Jason Wang
2011-11-27 17:14                 ` Michael S. Tsirkin
2011-11-28  4:25                 ` Jason Wang
2011-11-28 17:42                   ` Stephen Hemminger
2011-11-25  3:09           ` Jason Wang
2011-11-24 11:14   ` Krishna Kumar2
2011-11-24 13:00     ` jasowang
2011-11-24 16:12       ` Michael S. Tsirkin
2011-11-25  2:58       ` Krishna Kumar2
2011-11-25  3:18         ` Jason Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).