From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3A0C6A054F; Tue, 16 Mar 2021 09:59:31 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A60722428A7; Tue, 16 Mar 2021 09:58:58 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 774EA24288E for ; Tue, 16 Mar 2021 09:58:57 +0100 (CET) Received: by shelob.oktetlabs.ru (Postfix, from userid 122) id 52D2D7F5AA; Tue, 16 Mar 2021 11:58:57 +0300 (MSK) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shelob.oktetlabs.ru X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_DISCARD autolearn=no autolearn_force=no version=3.4.2 Received: from aros.oktetlabs.ru (aros.oktetlabs.ru [192.168.38.17]) by shelob.oktetlabs.ru (Postfix) with ESMTP id 3D51D7F5BC; Tue, 16 Mar 2021 11:58:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 3D51D7F5BC Authentication-Results: shelob.oktetlabs.ru/3D51D7F5BC; dkim=none; dkim-atps=neutral From: Andrew Rybchenko To: Ferruh Yigit Cc: dev@dpdk.org, Vijay Kumar Srivastava Date: Tue, 16 Mar 2021 11:58:31 +0300 Message-Id: <20210316085832.942481-8-andrew.rybchenko@oktetlabs.ru> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210316085832.942481-1-andrew.rybchenko@oktetlabs.ru> References: <20210311110325.3291203-1-andrew.rybchenko@oktetlabs.ru> <20210316085832.942481-1-andrew.rybchenko@oktetlabs.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4 7/8] net/sfc: skip driver probe for incompatible device class X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Vijay Kumar Srivastava Driver would be probed only for the net device class. Signed-off-by: Vijay Kumar Srivastava Signed-off-by: Andrew Rybchenko --- doc/guides/nics/sfc_efx.rst | 8 ++++++++ drivers/net/sfc/sfc.h | 1 + drivers/net/sfc/sfc_ethdev.c | 7 +++++++ drivers/net/sfc/sfc_kvargs.c | 1 + 4 files changed, 17 insertions(+) diff --git a/doc/guides/nics/sfc_efx.rst b/doc/guides/nics/sfc_efx.rst index b6047cf5c7..cf1269cc03 100644 --- a/doc/guides/nics/sfc_efx.rst +++ b/doc/guides/nics/sfc_efx.rst @@ -357,6 +357,14 @@ allow option like "-a 02:00.0,arg1=value1,...". Case-insensitive 1/y/yes/on or 0/n/no/off may be used to specify boolean parameters value. +- ``class`` [net|vdpa] (default **net**) + + Choose the mode of operation of ef100 device. + **net** device will work as network device and will be probed by net/sfc driver. + **vdpa** device will work as vdpa device and will be probed by vdpa/sfc driver. + If this parameter is not specified then ef100 device will operate as + network device. + - ``rx_datapath`` [auto|efx|ef10|ef10_essb] (default **auto**) Choose receive datapath implementation. diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h index c2945b6ba2..b48a818adb 100644 --- a/drivers/net/sfc/sfc.h +++ b/drivers/net/sfc/sfc.h @@ -22,6 +22,7 @@ #include "efx.h" #include "sfc_efx_mcdi.h" +#include "sfc_efx.h" #include "sfc_debug.h" #include "sfc_log.h" diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index 00a0fd3d02..23828c24ff 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -2161,6 +2161,13 @@ sfc_eth_dev_init(struct rte_eth_dev *dev) const struct rte_ether_addr *from; int ret; + if (sfc_efx_dev_class_get(pci_dev->device.devargs) != + SFC_EFX_DEV_CLASS_NET) { + SFC_GENERIC_LOG(DEBUG, + "Incompatible device class: skip probing, should be probed by other sfc driver."); + return 1; + } + sfc_register_dp(); logtype_main = sfc_register_logtype(&pci_dev->addr, diff --git a/drivers/net/sfc/sfc_kvargs.c b/drivers/net/sfc/sfc_kvargs.c index c42b326ab0..0efa92ed28 100644 --- a/drivers/net/sfc/sfc_kvargs.c +++ b/drivers/net/sfc/sfc_kvargs.c @@ -28,6 +28,7 @@ sfc_kvargs_parse(struct sfc_adapter *sa) SFC_KVARG_TX_DATAPATH, SFC_KVARG_FW_VARIANT, SFC_KVARG_RXD_WAIT_TIMEOUT_NS, + SFC_EFX_KVARG_DEV_CLASS, NULL, }; -- 2.30.1