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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Dm7WmdY6QZHQ== 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