summaryrefslogtreecommitdiffstats
path: root/drivers/net/macvtap.c
diff options
context:
space:
mode:
authorKrishna Kumar <krkumar2@in.ibm.com>2011-11-23 22:17:14 +0000
committerDavid S. Miller <davem@davemloft.net>2011-12-20 13:45:55 -0500
commitef0002b577b52941fb147128f30bd1ecfdd3ff6d (patch)
tree8974f323c84eb97ebfb2ff817b7798ee96ceccc6 /drivers/net/macvtap.c
parent89efea25cdceb9093e3f7fb717d3b4063f7f8749 (diff)
downloadop-kernel-dev-ef0002b577b52941fb147128f30bd1ecfdd3ff6d.zip
op-kernel-dev-ef0002b577b52941fb147128f30bd1ecfdd3ff6d.tar.gz
macvtap: Fix macvtap_get_queue to use rxhash first
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>
Diffstat (limited to 'drivers/net/macvtap.c')
-rw-r--r--drivers/net/macvtap.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 7c88d13..58dc117 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -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]);
OpenPOWER on IntegriCloud