macvtap: Fix macvtap_get_queue to use rxhash first
authorKrishna Kumar <krkumar2@in.ibm.com>
Wed, 23 Nov 2011 22:17:14 +0000 (22:17 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Dec 2011 18:45:55 +0000 (13:45 -0500)
It was reported that the macvtap device selects a
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macvtap.c

index 7c88d136e72353f13c926fd1437d49fa0bacb54e..58dc117a8d781b93ba91a258fe87de1e3bf5a7c8 100644 (file)
@@ -175,6 +175,14 @@ static struct macvtap_queue *macvtap_get_queue(struct net_device *dev,
        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_queue(struct net_device *dev,
                        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]);