From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C51CFA057C; Fri, 27 Mar 2020 04:04:51 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7734B1C08C; Fri, 27 Mar 2020 04:04:49 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 7059D1C030 for ; Fri, 27 Mar 2020 04:04:42 +0100 (CET) IronPort-SDR: ExU0Cqn61Jz6sOY4B8WYtw1s+yLUOG30wLMSokIMa8ofOLWVga+Q3yIiYBPdv6MFMDIpQ82NPQ C2OtIyiz35iA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Mar 2020 20:04:41 -0700 IronPort-SDR: u8Y72sr36umpx/bghVbwa+aPg6xK+hjvHXk6oWeu80uaVuLK7UBmXGWYog3uWZy032Up1DDSwz d0Yhf08M9kZA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,310,1580803200"; d="scan'208";a="420949726" Received: from npg-dpdk-haiyue-1.sh.intel.com ([10.67.119.213]) by orsmga005.jf.intel.com with ESMTP; 26 Mar 2020 20:04:39 -0700 From: Haiyue Wang To: dev@dpdk.org, xiaolong.ye@intel.com, qi.z.zhang@intel.com, jingjing.wu@intel.com, qiming.yang@intel.com, beilei.xing@intel.com Cc: wei.zhao1@intel.com, Haiyue Wang Date: Fri, 27 Mar 2020 10:56:35 +0800 Message-Id: <20200327025641.31008-2-haiyue.wang@intel.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200327025641.31008-1-haiyue.wang@intel.com> References: <20200309141437.11800-1-haiyue.wang@intel.com> <20200327025641.31008-1-haiyue.wang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v6 1/7] net/iavf: stop the PCI probe in DCF mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" A new DCF PMD will be introduced, which runs on Intel VF hardware, and it is a pure software design to control the advance functionality (such as switch, ACL) for rest of the VFs. So if the DCF (Device Config Function) mode is specified by the devarg 'cap=dcf', then it will stop the PCI probe in the iavf PMD. Signed-off-by: Haiyue Wang Reviewed-by: Xiaolong Ye Acked-by: Jingjing Wu Acked-by: Qi Zhang --- drivers/net/iavf/iavf_ethdev.c | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 34913f9c4..c0b95e169 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -1416,9 +1416,51 @@ iavf_dev_uninit(struct rte_eth_dev *dev) return 0; } +static int +iavf_dcf_cap_check_handler(__rte_unused const char *key, + const char *value, __rte_unused void *opaque) +{ + if (strcmp(value, "dcf")) + return -1; + + return 0; +} + +static int +iavf_dcf_cap_selected(struct rte_devargs *devargs) +{ + struct rte_kvargs *kvlist; + const char *key = "cap"; + int ret = 0; + + if (devargs == NULL) + return 0; + + kvlist = rte_kvargs_parse(devargs->args, NULL); + if (kvlist == NULL) + return 0; + + if (!rte_kvargs_count(kvlist, key)) + goto exit; + + /* dcf capability selected when there's a key-value pair: cap=dcf */ + if (rte_kvargs_process(kvlist, key, + iavf_dcf_cap_check_handler, NULL) < 0) + goto exit; + + ret = 1; + +exit: + rte_kvargs_free(kvlist); + return ret; +} + static int eth_iavf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, struct rte_pci_device *pci_dev) { + if (iavf_dcf_cap_selected(pci_dev->device.devargs)) + return 1; + return rte_eth_dev_pci_generic_probe(pci_dev, sizeof(struct iavf_adapter), iavf_dev_init); } @@ -1439,6 +1481,7 @@ static struct rte_pci_driver rte_iavf_pmd = { RTE_PMD_REGISTER_PCI(net_iavf, rte_iavf_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_iavf, pci_id_iavf_map); RTE_PMD_REGISTER_KMOD_DEP(net_iavf, "* igb_uio | vfio-pci"); +RTE_PMD_REGISTER_PARAM_STRING(net_iavf, "cap=dcf"); RTE_INIT(iavf_init_log) { iavf_logtype_init = rte_log_register("pmd.net.iavf.init"); -- 2.26.0