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 ADAFAA04B5; Thu, 10 Sep 2020 09:54:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 96DA21BFA2; Thu, 10 Sep 2020 09:54:09 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id D8840255 for ; Thu, 10 Sep 2020 09:54:07 +0200 (CEST) IronPort-SDR: gar63Jxd/i70YU8wVHdB2YZcEeOTCLCi2uomyXMGxhAUMj5RU1k4MWnCgH7rgyNF0j28+7mrn2 c0hBRMrebInQ== X-IronPort-AV: E=McAfee;i="6000,8403,9739"; a="157768307" X-IronPort-AV: E=Sophos;i="5.76,412,1592895600"; d="scan'208";a="157768307" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2020 00:54:06 -0700 IronPort-SDR: ITICdFuG3KVIsspT24ad48NumvKdvyx/Eet23KZHOn8HsRLcKjU7aOtMR4/SsMSbO5HMtVB44Y Yg6z0uaPriDA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,412,1592895600"; d="scan'208";a="329241911" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga004.fm.intel.com with ESMTP; 10 Sep 2020 00:54:04 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 10 Sep 2020 00:54:03 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 10 Sep 2020 00:54:03 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.176) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Thu, 10 Sep 2020 00:54:02 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E14CkR1R596MBZmHGFBIV3ymKMFBnLZ+EShKMCAyJfLy7XUd/zxgkcxyPZ91sqODqicU5EOXNpd6VOprIGLqK7FjwX71IyGoeAaPxtiJnojzcsf0/Z9lbyEprolBpdc+zDUwa3U4vK5kiEJvSP1Us/p5UTqXWK00DDbJ4pzDUHB8bYDxnylTMy+7IxYmB3xRZ2u6FHcY7dh8R2/dXBzWyFffEWIGthHEDzQSSNqqJAATae1b/5KSJKSJUEkAmjZNVD7xcNJd4bK6LWPSb+KplPOlKkBvpr29ABapHZmXXTho/kjE1vgOWndZgGuRV5Y2K1XaKL7+KvD9fbAUKU0tGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cg6z8yDR9XtPrWKNXzjZRORbHqJsvW+xv/ydVAqlnU4=; b=eVU/ks91N6/GgxrHAdntV82G9KS82QUZ3FrVBtvt/hFc7k7MtToKKGcIRlDQ12K2H8M3Un9DL8qWs82+CtU89F60k39c5g5RBu3NKjXUYi89Iy5mPhQTLHB0UYYQKdk/6Bw3qmVU8jA+zMejYhARAW5ekIzQpP77w16Fm4P2cCz99Tk0rPq6aRRKBSsv8KtdRUvNYaNJ5Mhhe1q4H9KlT1BhOJGJwSQXMPKvYS8dxoovSnjEAb9wS5r1itqayG1HfLqCdaOAdwp04hxjzCeqN4ECg/YZr1mQUrnD+clOVI03nMdZ6qTgONc9oA77F6QRcjDsvDkcJVDXaEKjVIwTgw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cg6z8yDR9XtPrWKNXzjZRORbHqJsvW+xv/ydVAqlnU4=; b=UxfsEk+3ehUalLXME9tw7fADB/65H7dCUTYIInSAxeNQr1oYqKegml2tEoU4VfM+RAQ2r15W6DiO1bgnlm/rR+yH/V5ykk78TC1kf744kA1ljutqObHjcfSsa9On6YRxxuLesMt1p6nTnp0c1MrNf+vre0n4f2don7wGiLIVvgM= Received: from BN8PR11MB3795.namprd11.prod.outlook.com (2603:10b6:408:82::31) by BN8PR11MB3633.namprd11.prod.outlook.com (2603:10b6:408:8a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Thu, 10 Sep 2020 07:53:59 +0000 Received: from BN8PR11MB3795.namprd11.prod.outlook.com ([fe80::dd0f:7f49:bc5f:2fde]) by BN8PR11MB3795.namprd11.prod.outlook.com ([fe80::dd0f:7f49:bc5f:2fde%5]) with mapi id 15.20.3348.019; Thu, 10 Sep 2020 07:53:59 +0000 From: "Wang, Haiyue" To: "Su, Simei" , "Zhang, Qi Z" , "Yang, Qiming" CC: "dev@dpdk.org" , "Xing, Beilei" Thread-Topic: [PATCH v1 2/3] net/ice: add devarg for ACL ipv4 rule number Thread-Index: AQHWh0XNoXFPdxVZN0Sz6bzF5vaToKlhf4Og Date: Thu, 10 Sep 2020 07:53:58 +0000 Message-ID: References: <1599723455-353059-1-git-send-email-simei.su@intel.com> <1599723455-353059-3-git-send-email-simei.su@intel.com> In-Reply-To: <1599723455-353059-3-git-send-email-simei.su@intel.com> Accept-Language: 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.5.1.3 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.55.46.36] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fcd3e44f-4417-4895-a489-08d8555ead2b x-ms-traffictypediagnostic: BN8PR11MB3633: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4502; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: LqGF0AMVxc6bpqfDYORIQuW78lcRrLYzgK1/Hdlo7Hc3sStf8jkml22unFvdrvqskB3DLNuEtOP48qsetM5AgnUDJeMp0OKjDqg8S1Cxb1UMdTVap0uR6Z3iKbklrSAQjAlXPGqfIPRmQndy0eyWc5OainYT6SKlK8zg/xkGPVZwfXc4xQCn4SIH37IIC5Q9uc6b6WL5CghH/tHMAsYGEzJr+Tj+BK1/njtcJ8vfB+Rzcn9gIpiZX2prACxK45uG7StvjwEmgd6TlYh0vzOA6C2FrXrt6rrqtsSRCwiO9YjukFw6xontZ55VnSgjc7YaC6ttidwDtRjCwD5QzqUsSg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR11MB3795.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(376002)(396003)(366004)(39860400002)(136003)(53546011)(7696005)(9686003)(316002)(6636002)(55016002)(52536014)(8676002)(54906003)(110136005)(5660300002)(71200400001)(86362001)(8936002)(4326008)(76116006)(83380400001)(33656002)(6506007)(26005)(107886003)(64756008)(478600001)(66476007)(186003)(2906002)(66446008)(66556008)(66946007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: ytqu2HlkzxZ4Psxtru0fAmc2VkpU29QVwr/qfRa9DER0zLLZUVDTeWSKT+wuqVQt/zUCV/+BgfXZ3qPKFpVSvvaal7l3rJ90segFQVfrraibdo83LgpSGMy83oXlp7XyAb6Xn8YsM88Hp5qXtZVFLD+xirjW0F1SQa+CqR+mFrQDL6CCOdihm1jLhu/zCmYGnHzuyKt8yKVjhuc/0YoheiFgeEkpvbUcJC9cHWnXSed6Al2n3vKDXIpDf/GFVB7q4vQ98NZaO3KFarrZDYwNPA+iWTln72Ni9qXP9if1TzJsqr16T/6EAyVWfmJeZje3YMRpycQUw7jQahQvokjH/PG5MHASbMoxLcUg3/RK33aHrOB0gm6B1AT38xNDPVd1PoRYUqU/omQTiTlMZEwqt4vQTVRMFE3ZSEv/mz229kAX1k6FXqYv+XOEgpKp5dLn9XoDhAMYz58NPPvDdd9IsCQ5bzNWqLraFEQzcBe825RbQsSdQQ2mfA2u03A0lyZEGrv3ENM/27anBmj5V4i7H8q0GEwPiecqu+SgZH8Xe5LNMkIt8Gv+EwwHjKmI3kTeS3ttY25CftVkNC9nIwrfxcwUEldiEJUng66Hjuj/Br84QjQZG4MLoKAVmlrTGL84XvZK62aHbA9z2NXH4PMjSg== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR11MB3795.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fcd3e44f-4417-4895-a489-08d8555ead2b X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Sep 2020 07:53:59.1521 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Uhhpl+OAG8WbiemB9t9vEt3icN6L5MFcaoJmNuNhys+EDPWxjhkS4jm20oSEJ1jfls/T8uZ8OlmphF2VcChPxA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR11MB3633 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v1 2/3] net/ice: add devarg for ACL ipv4 rule number 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: Su, Simei > Sent: Thursday, September 10, 2020 15:38 > To: Zhang, Qi Z ; Yang, Qiming > Cc: dev@dpdk.org; Wang, Haiyue ; Xing, Beilei ; Su, > Simei > Subject: [PATCH v1 2/3] net/ice: add devarg for ACL ipv4 rule number >=20 > This patch enables devargs for ACL ipv4 rule number and refactor > DCF capability selection API to be more flexible. >=20 > Signed-off-by: Simei Su > --- >=20 > static int > -ice_dcf_cap_check_handler(__rte_unused const char *key, > - const char *value, __rte_unused void *opaque) > +handle_dcf_arg(__rte_unused const char *key, const char *value, > + __rte_unused void *arg) > { > - if (strcmp(value, "dcf")) > - return -1; > + 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; >=20 > return 0; > } >=20 > -static int > -ice_dcf_cap_selected(struct rte_devargs *devargs) > +static bool > +check_cap_dcf_enable(struct rte_devargs *devargs) > { > struct rte_kvargs *kvlist; > - const char *key =3D "cap"; > - int ret =3D 0; > + bool enable =3D false; >=20 > if (devargs =3D=3D NULL) > - return 0; > + return false; >=20 > kvlist =3D rte_kvargs_parse(devargs->args, NULL); > if (kvlist =3D=3D NULL) > - return 0; > - > - if (!rte_kvargs_count(kvlist, key)) > - goto exit; > - > - /* dcf capability selected when there's a key-value pair: cap=3Ddcf */ > - if (rte_kvargs_process(kvlist, key, > - ice_dcf_cap_check_handler, NULL) < 0) > - goto exit; > + return false; >=20 > - ret =3D 1; > + rte_kvargs_process(kvlist, ICE_DCF_CAP, handle_dcf_arg, &enable); >=20 > -exit: > rte_kvargs_free(kvlist); > - return ret; > + > + return enable; > } >=20 > static int eth_ice_dcf_pci_probe(__rte_unused struct rte_pci_driver *pci= _drv, > struct rte_pci_device *pci_dev) > { > - if (!ice_dcf_cap_selected(pci_dev->device.devargs)) > - return 1; > + if (!check_cap_dcf_enable(pci_dev->device.devargs)) > + return 1; /* continue to probe */ >=20 I didn't see how flexible about DCF capability selection. ;-) And you add the unneeded comment "/* continue to probe */" that I did befor= e. > return rte_eth_dev_pci_generic_probe(pci_dev, > sizeof(struct ice_dcf_adapter), > diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h > index 758caa8..13f4167 100644 > --- a/drivers/net/ice/ice_ethdev.h > +++ b/drivers/net/ice/ice_ethdev.h > @@ -447,6 +447,7 @@ struct ice_devargs { > int pipe_mode_support; > int flow_mark_support; > uint8_t proto_xtr[ICE_MAX_QUEUE_NUM]; > + int acl_ipv4_rules_num; > }; >=20 > /** > -- > 1.8.3.1