Skip to content

Commit

Permalink
macvtap: Fix macvtap_get_queue to use rxhash first
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Krishna Kumar authored and David S. Miller committed Dec 20, 2011
1 parent 89efea2 commit ef0002b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions drivers/net/macvtap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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]);
Expand Down

0 comments on commit ef0002b

Please sign in to comment.