Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2005421imm; Thu, 24 May 2018 04:23:08 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrZrUEIHdCtZibxZpbCT2XLsSAGT1cdT5xCgVgpHd3OyEXmXsHQQ0bXwjCMrGPlhKOPeDpl X-Received: by 2002:a17:902:a716:: with SMTP id w22-v6mr6732538plq.215.1527160988349; Thu, 24 May 2018 04:23:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527160988; cv=none; d=google.com; s=arc-20160816; b=lLNhJaOCNMUJogF/E1f6O6wSlTorRKGkjLox1c8avQ9NXoGJsQLHPPuJ5WElyzeJML 5aSkT52YsnwA4czdKyFzPsPug7tKsGcS+7ABrpXL0Rd2nn+G1vLadbi6dvcnInvzq9BC Fv9YP/HrqAcgLbdp6ckOIDEZx3GDcosbyz8gcVyIIIsJbgB42w5C6swvk17pQlshRVqt F6FqPvme0AJj7Lw+aISVU80qwyEza4eMwJLZktHghdaYXSAvFi8tW8/7Raj44eWk4W+u /pOHtJ5tfKEaMkCfpNs6o1/v8Ic7i0aHTZF0hdT4ub8j/mEKykNN3NhwFhsocTw1fY2H xNaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=7C4dklgNdCAxz6t6yOHkz3tFzb9lmAdeuXS0kODjLug=; b=ljFg9PrQkgmVZ0tn9RxLfp/K8C5bSPNILAtLdKDvgXnvqk5A+qyjjeEHlozckTYEUg tFaWLZm7qpU0HgzYJlwzB7K7TMpd5qmzC/OnVxBqoOejRYre+Xeb7G1fKy5eze5s7+W6 0wkGl/ARMN0KspJbt3NGTFCvLWnBTfpuEt4fM6Hxw14ljfWkBiEfM1I431B4qYuWuUEB Tw12zjrklCLlN/V+V8A4uG4+8zODa3AwfcNMfUPUgVBxk0oKEsUMgCqgLnen3b/qENjh IyEZ7+qdnOMdQTcUn1xAGRTt6ODfSEe8vjKejwFStdTtAY38kOuJBLDLSMnEvFoBMjzH SB5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pBV1hEIA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c10-v6si1907654plz.190.2018.05.24.04.22.53; Thu, 24 May 2018 04:23:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pBV1hEIA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968799AbeEXLWI (ORCPT + 99 others); Thu, 24 May 2018 07:22:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:51534 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967845AbeEXJwV (ORCPT ); Thu, 24 May 2018 05:52:21 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DF22720847; Thu, 24 May 2018 09:52:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155541; bh=eIc3MTucBS4ssnU+Fsv51WSadU7H4XgPfoQoQEYzXBg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pBV1hEIAXEPqugJ9SJ6Bp/8/cBBt9zepP7f5AfINifg3KhgwJP2zdHk1dn1JKNQX2 Ed0KdlXa17TZuQAOu+PaqCWwJwB2UPQUt3zGxYIMwQiv6MEHSfwPnQF/eXR/OvQx8n LxrafUCXxyVUy50ZNRVg9RlkJ/P+nUnA5hl+83/Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephen Hemminger , "David S. Miller" Subject: [PATCH 4.14 026/165] hv_netvsc: defer queue selection to VF Date: Thu, 24 May 2018 11:37:12 +0200 Message-Id: <20180524093623.038208030@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stephen Hemminger [ Commit b3bf5666a51068ad5ddd89a76ed877101ef3bc16 upstream. ] 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 Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/hyperv/netvsc_drv.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -283,8 +283,19 @@ static u16 netvsc_select_queue(struct ne 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); }