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>
This commit is contained in:
parent
89efea25cd
commit
ef0002b577
|
@ -175,6 +175,14 @@ static struct macvtap_queue *macvtap_get_queue(struct net_device *dev,
|
||||||
if (!numvtaps)
|
if (!numvtaps)
|
||||||
goto out;
|
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))) {
|
if (likely(skb_rx_queue_recorded(skb))) {
|
||||||
rxq = skb_get_rx_queue(skb);
|
rxq = skb_get_rx_queue(skb);
|
||||||
|
|
||||||
|
@ -186,14 +194,6 @@ static struct macvtap_queue *macvtap_get_queue(struct net_device *dev,
|
||||||
goto out;
|
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 */
|
/* Everything failed - find first available queue */
|
||||||
for (rxq = 0; rxq < MAX_MACVTAP_QUEUES; rxq++) {
|
for (rxq = 0; rxq < MAX_MACVTAP_QUEUES; rxq++) {
|
||||||
tap = rcu_dereference(vlan->taps[rxq]);
|
tap = rcu_dereference(vlan->taps[rxq]);
|
||||||
|
|
Loading…
Reference in New Issue