From patchwork Tue Jul 25 15:29:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 108652 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp702563qge; Tue, 25 Jul 2017 08:31:12 -0700 (PDT) X-Received: by 10.84.210.79 with SMTP id z73mr22398628plh.151.1500996672369; Tue, 25 Jul 2017 08:31:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500996672; cv=none; d=google.com; s=arc-20160816; b=p3wtBeAs0XghZGibWLYgvW9hUlCJICT35Esx09i3gzDFDvqpASzip5TmP6+eIPmiuh 3jw5HudPNhL5MbSIKeacxpUcS7tZ+ErNwTFus8Yr4EvxOogPgbMpJ2YT84DzZRE4e8kN HvhOVE4cVuDAbgofcvQt3VvvTgT8fTn0co0gXz9azX2o0/xP+ACjaAPh7ngZU9QwpAbZ 3VhKCxWCXhG9nD+woADEfPpLrhalhowVrwpcwtMyzM39HCbxNlCwc1pASJGMNHw+UUvT H5R/adU9fhH1uivhowbe04MkacpZk9RBHZYb8r7Tu1BOt1+AFeCzZkqVbNTKR8AWcKOs Bz/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=V7Bk5Czj7TuTJzu71JvADAxzjcV8uqQQwkqknAJQ1JM=; b=rFnxeXDuPWEgcGqM6U16QC40RTBeUES+z63kVw/dI/B8EFm1zD1RB9XCdGSNvGuil8 scNdQM8h5+NHIoC+Mx18Q46WIHCPCEo8FEmUYMf2y6QgLUupsY5/vxvRr7genjk3N89V SLRsV64hk0yKsmjpVjuL74AgyYtS4p/MyJ4Tas64kDmgWM8xzVHAlCeuHbVRKpttKGeM aAeC/DYP05ZsOOLatjt2eBGZN0pZCpi2/M0e20jE4P6GRUmPFHnOTuiqXigmpXPNAUVU Omj070t/FpBwSFiTnZArXazYSF5xo3EagICnoCjsS/pLTsXKThxJDOBkWyJOjUkTfyX2 GkDA== ARC-Authentication-Results: i=1; mx.google.com; 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 k15si5582679pgc.928.2017.07.25.08.31.12; Tue, 25 Jul 2017 08:31:12 -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; 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 S1752705AbdGYPbJ (ORCPT + 26 others); Tue, 25 Jul 2017 11:31:09 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:53080 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752244AbdGYPbH (ORCPT ); Tue, 25 Jul 2017 11:31:07 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0MJVXP-1dbPlq3q5T-0036db; Tue, 25 Jul 2017 17:30:50 +0200 From: Arnd Bergmann To: "David S. Miller" , Michael Chan , Sathya Perla Cc: Arnd Bergmann , Thomas Gleixner , Edward Cree , Richard Cochran , Nicolas Pitre , Florian Fainelli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 1/2] bnxt_en: add CONFIG_NET_SWITCHDEV dependency Date: Tue, 25 Jul 2017 17:29:51 +0200 Message-Id: <20170725153046.44726-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:tp3PCea4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org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Without CONFIG_SWITCHDEV, we run into a compile-time error: drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c: In function 'bnxt_vf_rep_netdev_init': drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c:305:7: error: 'struct net_device' has no member named 'switchdev_ops'; did you mean 'netdev_ops'? This adds a Kconfig dependency to prevent running into this invalid configuration. Fixes: c124a62ff2dd ("bnxt_en: add support for port_attr_get and and get_phys_port_name") Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/broadcom/Kconfig | 1 + 1 file changed, 1 insertion(+) -- 2.9.0 diff --git a/drivers/net/ethernet/broadcom/Kconfig b/drivers/net/ethernet/broadcom/Kconfig index 285f8bc25682..095bb816ab48 100644 --- a/drivers/net/ethernet/broadcom/Kconfig +++ b/drivers/net/ethernet/broadcom/Kconfig @@ -194,6 +194,7 @@ config BNXT tristate "Broadcom NetXtreme-C/E support" depends on PCI depends on MAY_USE_DEVLINK + depends on NET_SWITCHDEV select FW_LOADER select LIBCRC32C ---help--- From patchwork Tue Jul 25 15:29:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 108653 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp702752qge; Tue, 25 Jul 2017 08:31:23 -0700 (PDT) X-Received: by 10.99.119.76 with SMTP id s73mr19668166pgc.374.1500996683866; Tue, 25 Jul 2017 08:31:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500996683; cv=none; d=google.com; s=arc-20160816; b=G2u0HaLCOZv014HqenQHvCyb4UE5sWRAbiDVXIa7t7rSMpi19GEuhKi9DLyoN3aXAn T7xHijsZ710n4Mwad7c3o2veER8Hnnj3fYKvg5I8KjsQZUbGQe+p39nWd1+nAmwsejpd 6xTYxJh35+hrnI7iGp+Q+oICnBDej4OukMMGTwTc2o1RVNp0ayypWJ+g5Ylcsipp/Xmx SZcSBUzGwmgu4p9NKABmQqJMmK3RUHQEWgkSblsVxoITPbyFbJN7tQLxLaL/BeT5v0e/ AdFwQC6CDuNIzLTgg1AMwHjHcYzWjr/dbZD8ctWOBtBm+4AIZ+qcQCOCfTm+hFS91qwq nKww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=vPy8vnSHPSFZQSzP7tENAWaU2EorI9iH/ZIwht6Gv+Y=; b=ALdXL9S9ND1dxv3zernvqHKkqwxIdwJpNX1/zj3SrGzjbFFCrtZ3FnmKhJz9PLaJa3 o5xzotmjVMgHyrSjrkwjAICQ0uBaCAlIR1ex/n0vKcHETy+TZYwpX53HpddBKiSrXe2s X+F6S8yayGFQfKcyxiXTpEhl4/EOL+9fZ6MnBvDN7Yeu7LeRNwFVRu2sOQ0Z2SpLDg/j 49bKaTr8Jd00+FvmChfH9aaabg+UqZRlcNPoahOZhEdc56xaUferKSnPQKbaY4RJJEFX 648s7TXlDvnqrP3LRM+LvGtmRd2Q4Vz63MjxgEc9OydQJR/2GPR8qRXNKw0WdIzHM7BN JlDA== ARC-Authentication-Results: i=1; mx.google.com; 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 v6si8978392plk.103.2017.07.25.08.31.23; Tue, 25 Jul 2017 08:31:23 -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; 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 S1752742AbdGYPbV (ORCPT + 26 others); Tue, 25 Jul 2017 11:31:21 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:51980 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752659AbdGYPbO (ORCPT ); Tue, 25 Jul 2017 11:31:14 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0MMpSB-1dVvam39TD-008cPT; Tue, 25 Jul 2017 17:31:07 +0200 From: Arnd Bergmann To: Michael Chan Cc: Arnd Bergmann , "David S. Miller" , Sathya Perla , Somnath Kotur , Deepak Khungar , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 2/2] bnxt_en: define sriov_lock unconditionally Date: Tue, 25 Jul 2017 17:29:52 +0200 Message-Id: <20170725153046.44726-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170725153046.44726-1-arnd@arndb.de> References: <20170725153046.44726-1-arnd@arndb.de> X-Provags-ID: V03:K0:Os65ijpUhTV/dIQk3h43VRxQ8qjGW5WAsq0XWXh0lfcy7Zn4XpL 6H4xdXBB6EdFsgu8kTl8yTjPmIO7Jz6Nc59LHKT9NOY/MwnZ2FyTodBlT6hyQiik/PsT9AZ bBpORvEHfP1Kzg+5PM6EyKnIRDsAcqSzwymTFdvt7feTRwr/Pargpa+o6VNVVUcxaOp0qQA AzFaCJTYYF82lOdjncLqA== X-UI-Out-Filterresults: notjunk:1; V01:K0:AuvNwQHHOn4=:f+j1cXXcIIYDKbGjvhJbXw Ar0/Ed+xBC8RT/K3uvhp7rIYPckV57TKolxsEwUGvb23HjUS52HXbZcrLAVj0Gosn3hLBiFDN 2JIVetx428ZEGijaaQUkxDUZclbTCh65qO1gzzJWLL7/9VZGpDifS+zodhxBqEWorf2MF16dy 3eCKUc5OuqhNuTXzXqi6X6tNkF//suS04ih+T/1NqPNS+s+26HFrYYMdGtjJfbJH1JoXz+mVG qVSwRC4sovmnu38kShG0zaAOLJSPvzbvvJRY/sL7ila1VFg75e5uUjjgEvIKNBXDLG4pNpMOt n5YmU7rvQz33a8rorFWIqj+VOLh0040YE1aaAsAQzBAkZPT8ged5IB83bcPnyP+MalMI+10nV 3MtWrePxp27Ndri1b4R72P4GHudO4EoVk0+oSRtwWzeTSAu8akdGcq1G5aM97/+EIi+QtnIn3 9xXk9FVWjNhQ/XWd0rWk4cm9MtmZf6sd35Rf02tNS2hMVPYdaP/8a+RCiYFGYcxLhQVwR4s4Q VNcu7G+JKNynLhgbKUpSySkA6N9o9jzH952oYrxgNdNkuoGBOrJT1E/YJKHvpajUy1cJVxXyE SE2dqBMB1SZuuXUAxj/CIcugqmWIfep349HqWkPh5SZdL0rnXoLTyeF3YFwGoMK9hKOLixMJy OTWP9KQAnDC+PiTZMqQkJ2rIaMyzBRpPZgj0e6L2k84KjP9LInTh5eHdc9ZU7mvBy76ySnyXi /IYm+CFsW/oyL95nab3hMfLu30Dm7WmdY6QZHQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The sriov_lock is used to serialize the sriov code with the vfr code. However, when SRIOV is disabled, the lock is not there at all, leading to a build error: drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c: In function 'bnxt_dl_eswitch_mode_set': drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c:410:16: error: 'struct bnxt' has no member named 'sriov_lock' We can either provide the mutex in this configuration, too, or disable both SRIOV and VFR together. This implements the first approach, since it seems like a reasonable configuration for guest kernels to have, and the extra lock will be harmless when there is no contention. Fixes: 4ab0c6a8ffd7 ("bnxt_en: add support to enable VF-representors") Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) -- 2.9.0 Signed-off-by: Arnd Bergmann diff --git a/drivers/infiniband/hw/bnxt_re/Kconfig diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 82cbe1804821..9a9f5f394341 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -7949,8 +7949,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) #ifdef CONFIG_BNXT_SRIOV init_waitqueue_head(&bp->sriov_cfg_wait); - mutex_init(&bp->sriov_lock); #endif + mutex_init(&bp->sriov_lock); bp->gro_func = bnxt_gro_func_5730x; if (BNXT_CHIP_P4_PLUS(bp)) bp->gro_func = bnxt_gro_func_5731x; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h index 2d84d5719b70..a31ef843977a 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h @@ -1239,13 +1239,12 @@ struct bnxt { wait_queue_head_t sriov_cfg_wait; bool sriov_cfg; #define BNXT_SRIOV_CFG_WAIT_TMO msecs_to_jiffies(10000) - +#endif /* lock to protect VF-rep creation/cleanup via * multiple paths such as ->sriov_configure() and * devlink ->eswitch_mode_set() */ struct mutex sriov_lock; -#endif #define BNXT_NTP_FLTR_MAX_FLTR 4096 #define BNXT_NTP_FLTR_HASH_SIZE 512