Skip to content

Commit b3bf566

Browse files
shemmingerdavem330
authored andcommitted
hv_netvsc: defer queue selection to VF
When VF is used for accelerated networking it will likely have more queues (and different policy) than the synthetic NIC. This patch defers the queue policy to the VF so that all the queues can be used. This impacts workloads like local generate UDP. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 68633ed commit b3bf566

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

drivers/net/hyperv/netvsc_drv.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,19 @@ static u16 netvsc_select_queue(struct net_device *ndev, struct sk_buff *skb,
298298
rcu_read_lock();
299299
vf_netdev = rcu_dereference(ndc->vf_netdev);
300300
if (vf_netdev) {
301-
txq = skb_rx_queue_recorded(skb) ? skb_get_rx_queue(skb) : 0;
302-
qdisc_skb_cb(skb)->slave_dev_queue_mapping = skb->queue_mapping;
301+
const struct net_device_ops *vf_ops = vf_netdev->netdev_ops;
302+
303+
if (vf_ops->ndo_select_queue)
304+
txq = vf_ops->ndo_select_queue(vf_netdev, skb,
305+
accel_priv, fallback);
306+
else
307+
txq = fallback(vf_netdev, skb);
308+
309+
/* Record the queue selected by VF so that it can be
310+
* used for common case where VF has more queues than
311+
* the synthetic device.
312+
*/
313+
qdisc_skb_cb(skb)->slave_dev_queue_mapping = txq;
303314
} else {
304315
txq = netvsc_pick_tx(ndev, skb);
305316
}

0 commit comments

Comments
 (0)