From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, HK_RANDOM_FROM,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20CF5C18E5A for ; Tue, 10 Mar 2020 04:26:45 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id B3B752467D for ; Tue, 10 Mar 2020 04:26:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B3B752467D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 985371BFF4; Tue, 10 Mar 2020 05:26:43 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 2822A1BEB2 for ; Tue, 10 Mar 2020 05:26:40 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Mar 2020 21:26:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,535,1574150400"; d="scan'208";a="441156997" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga005.fm.intel.com with ESMTP; 09 Mar 2020 21:26:39 -0700 Received: from shsmsx602.ccr.corp.intel.com (10.109.6.142) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 9 Mar 2020 21:26:39 -0700 Received: from shsmsx603.ccr.corp.intel.com (10.109.6.143) by SHSMSX602.ccr.corp.intel.com (10.109.6.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 10 Mar 2020 12:26:37 +0800 Received: from shsmsx603.ccr.corp.intel.com ([10.109.6.143]) by SHSMSX603.ccr.corp.intel.com ([10.109.6.143]) with mapi id 15.01.1713.004; Tue, 10 Mar 2020 12:26:37 +0800 From: "Wang, Haiyue" To: "Ye, Xiaolong" CC: "dev@dpdk.org" , "Zhang, Qi Z" , "Yang, Qiming" , "Xing, Beilei" , "Zhao1, Wei" Thread-Topic: [PATCH v1 1/4] net/iavf: stop the PCI probe in DCF mode Thread-Index: AQHV9h4qELUmTI3eKkmDFxPZ1ksLgqg/3ySAgAE4b+D//5CegIAAk50A Date: Tue, 10 Mar 2020 04:26:37 +0000 Message-ID: References: <20200309141437.11800-1-haiyue.wang@intel.com> <20200309141437.11800-2-haiyue.wang@intel.com> <20200309153813.GC112283@intel.com> <24f139630bb94961b3c4f0f9dd88ca64@intel.com> <20200310033749.GA6272@intel.com> In-Reply-To: <20200310033749.GA6272@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v1 1/4] 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" > -----Original Message----- > From: Ye, Xiaolong > Sent: Tuesday, March 10, 2020 11:38 > To: Wang, Haiyue > Cc: dev@dpdk.org; Zhang, Qi Z ; Yang, Qiming ; Xing, > Beilei ; Zhao1, Wei > Subject: Re: [PATCH v1 1/4] net/iavf: stop the PCI probe in DCF mode >=20 > On 03/10, Wang, Haiyue wrote: > >> -----Original Message----- > >> From: Ye, Xiaolong > >> Sent: Monday, March 9, 2020 23:38 > >> To: Wang, Haiyue > >> Cc: dev@dpdk.org; Zhang, Qi Z ; Yang, Qiming ; Xing, > >> Beilei ; Zhao1, Wei > >> Subject: Re: [PATCH v1 1/4] net/iavf: stop the PCI probe in DCF mode > >> > >> On 03/09, Haiyue Wang wrote: > >> >A new DCF PMD will be introduced, which runs on Intel VF hardware, an= d > >> >it is a pure software design to control the advance functionality (su= ch > >> >as switch, ACL) for rest of the VFs. > >> > > >> >So if the DCF (Device Config Function) mode is specified by the devar= g > >> >'cap=3Ddcf', then it will stop the PCI probe in the iavf PMD. > >> > > >> >Signed-off-by: Haiyue Wang > >> >--- > >> > drivers/net/iavf/iavf_ethdev.c | 41 ++++++++++++++++++++++++++++++++= ++ > >> > 1 file changed, 41 insertions(+) > >> > > >> >diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_e= thdev.c > >> >index 34913f9c4..8ff26c0e7 100644 > >> >--- a/drivers/net/iavf/iavf_ethdev.c > >> >+++ b/drivers/net/iavf/iavf_ethdev.c > >> >@@ -1416,9 +1416,49 @@ iavf_dev_uninit(struct rte_eth_dev *dev) > >> > return 0; > >> > } > >> > > >> >+static int > >> >+handle_dcf_arg(__rte_unused const char *key, const char *value, > >> >+ __rte_unused void *arg) > >> >+{ > >> >+ bool *dcf =3D arg; > >> >+ > >> >+ if (arg =3D=3D NULL || value =3D=3D NULL) > >> >+ return -EINVAL; > >> >+ > >> >+ if (strcmp(value, "dcf") =3D=3D 0) > >> >+ *dcf =3D true; > >> >+ else > >> >+ *dcf =3D false; > >> >+ > >> >+ return 0; > >> >+} > >> >+ > >> >+static bool > >> >+check_cap_dcf_enable(struct rte_devargs *devargs) > >> >+{ > >> >+ struct rte_kvargs *kvlist; > >> >+ bool enable =3D false; > >> >+ > >> >+ if (devargs =3D=3D NULL) > >> >+ return false; > >> >+ > >> >+ kvlist =3D rte_kvargs_parse(devargs->args, NULL); > >> >+ if (kvlist =3D=3D NULL) > >> >+ return false; > >> >+ > >> >+ rte_kvargs_process(kvlist, "cap", handle_dcf_arg, &enable); > >> > >> Need error handling for failure case. > >> > > > >We just need the 'cap=3Ddcf' to check whether it is true, by default > >'enable=3Dfalse' can handle all the cases. ;-) > > >=20 > Yes, from function point of view, this could work. But it is still good p= ractice > to check the return value of the function. >=20 Make sense, will handle it in v2. > Thanks, > Xiaolong