All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com
Cc: devel@linuxdriverproject.org, netdev@vger.kernel.org
Subject: [PATCH PATCH net v2 7/9] hv_netvsc: defer queue selection to VF
Date: Fri,  2 Mar 2018 13:49:07 -0800	[thread overview]
Message-ID: <20180302214909.26066-8-sthemmin@microsoft.com> (raw)
In-Reply-To: <20180302214909.26066-1-sthemmin@microsoft.com>

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>
---
 drivers/net/hyperv/netvsc_drv.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index fa6cf18e7719..5299cfb16ce2 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -298,8 +298,19 @@ static u16 netvsc_select_queue(struct net_device *ndev, struct sk_buff *skb,
 	rcu_read_lock();
 	vf_netdev = rcu_dereference(ndc->vf_netdev);
 	if (vf_netdev) {
-		txq = skb_rx_queue_recorded(skb) ? skb_get_rx_queue(skb) : 0;
-		qdisc_skb_cb(skb)->slave_dev_queue_mapping = skb->queue_mapping;
+		const struct net_device_ops *vf_ops = vf_netdev->netdev_ops;
+
+		if (vf_ops->ndo_select_queue)
+			txq = vf_ops->ndo_select_queue(vf_netdev, skb,
+						       accel_priv, fallback);
+		else
+			txq = fallback(vf_netdev, skb);
+
+		/* Record the queue selected by VF so that it can be
+		 * used for common case where VF has more queues than
+		 * the synthetic device.
+		 */
+		qdisc_skb_cb(skb)->slave_dev_queue_mapping = txq;
 	} else {
 		txq = netvsc_pick_tx(ndev, skb);
 	}
-- 
2.16.1

  parent reply	other threads:[~2018-03-02 21:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-02 21:49 [PATCH PATCH net v2 0/9] hv_netvsc: minor fixes Stephen Hemminger
2018-03-02 21:49 ` [PATCH PATCH net v2 1/9] hv_netvsc: avoid retry on send during shutdown Stephen Hemminger
2018-03-02 21:49 ` [PATCH PATCH net v2 2/9] hv_netvsc: only wake transmit queue if link is up Stephen Hemminger
2018-03-02 21:49 ` [PATCH PATCH net v2 3/9] hv_netvsc: fix error unwind handling if vmbus_open fails Stephen Hemminger
2018-03-02 21:49 ` [PATCH PATCH net v2 4/9] hv_netvsc: cancel subchannel setup before halting device Stephen Hemminger
2018-03-02 21:49 ` [PATCH PATCH net v2 5/9] hv_netvsc: fix race in napi poll when rescheduling Stephen Hemminger
2018-03-02 21:49 ` [PATCH PATCH net v2 6/9] hv_netvsc: use napi_schedule_irqoff Stephen Hemminger
2018-03-02 21:49 ` Stephen Hemminger [this message]
2018-03-02 21:49 ` [PATCH PATCH net v2 8/9] hv_netvsc: filter multicast/broadcast Stephen Hemminger
2018-03-02 21:49 ` [PATCH PATCH net v2 9/9] hv_netvsc: propagate rx filters to VF Stephen Hemminger
2018-03-02 22:34 ` [PATCH PATCH net v2 0/9] hv_netvsc: minor fixes Jakub Kicinski
2018-03-05  3:18 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180302214909.26066-8-sthemmin@microsoft.com \
    --to=stephen@networkplumber.org \
    --cc=devel@linuxdriverproject.org \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=netdev@vger.kernel.org \
    --cc=sthemmin@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.