From: Krishna Kumar Date: Wed, 23 Nov 2011 22:17:14 +0000 (+0000) Subject: macvtap: Fix macvtap_get_queue to use rxhash first X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ef0002b577b52941fb147128f30bd1ecfdd3ff6d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git macvtap: Fix macvtap_get_queue to use rxhash first It was reported that the macvtap device selects a Acked-by: Michael S. Tsirkin Signed-off-by: David S. Miller --- diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c index 7c88d136e723..58dc117a8d78 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]);