From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30089.outbound.protection.outlook.com [40.107.3.89]) by dpdk.org (Postfix) with ESMTP id 7CFFD1B5BF for ; Tue, 26 Jun 2018 14:48:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gM6JOBC1TBctik8OL+3H5LrNOxV6nUL57QmtZzmS+kw=; b=ot9ixdIUxRVYUvS4LDRYZ+Er83cFPJ6ByVRvSfStNHccIoJ0jVdzYPZGDIX1XWNlyWchvF6PRkIEE4YurH6Lzva3HgFkpEAni6AIml8K7Pf2Ez/jepdRsO5kxzPesB7CREZbGs1Pzgd4vi2l2ztHrOcAtalbFLAkhn8ptKFJoYA= Received: from DB7PR05MB4426.eurprd05.prod.outlook.com (52.134.109.15) by DB7PR05MB4377.eurprd05.prod.outlook.com (52.134.108.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.24; Tue, 26 Jun 2018 12:48:50 +0000 Received: from DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::4c94:2db9:b8c5:cc6b]) by DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::4c94:2db9:b8c5:cc6b%5]) with mapi id 15.20.0884.025; Tue, 26 Jun 2018 12:48:50 +0000 From: Shahaf Shuler To: Pavan Nikhilesh , "jerin.jacob@caviumnetworks.com" , "gaetan.rivet@6wind.com" , Thomas Monjalon CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] eal/devargs: add option to supply PCI dev args Thread-Index: AQHUBGOUcZ3Z2Rc4nUO/FevGexVrn6RyivAg Date: Tue, 26 Jun 2018 12:48:49 +0000 Message-ID: References: <20180615044359.20692-1-pbhagavatula@caviumnetworks.com> In-Reply-To: <20180615044359.20692-1-pbhagavatula@caviumnetworks.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR05MB4377; 7:Dp6oT74w10CmQPXSn54cILYJsPPTqKG7VeuIEErzkQHUD4QjSRNIb3Ln6DDvprw7WBsXszjNU/6PIX1AWSmUbSGj+97Z30z1/LLwA3aEpoMrNiH6f+8bYdkG/PZSJv0q67mbhLHHfzaNS9bGCOSU6FjQyifGPmiiPOhuewMLksMRYVgv+66UPA8iI7SeUf9atC5Omu4/it5RXohjioK935z74jNu8bEHxnzdB06o1F3TwaVZC92xE5jN6FfVVOZv x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 7568c33d-2b6e-4408-746d-08d5db632a59 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600026)(711020)(48565401081)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB4377; x-ms-traffictypediagnostic: DB7PR05MB4377: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:DB7PR05MB4377; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB4377; x-forefront-prvs: 071518EF63 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(376002)(39860400002)(136003)(366004)(199004)(189003)(2906002)(33656002)(110136005)(68736007)(186003)(26005)(5250100002)(6246003)(305945005)(25786009)(6506007)(4326008)(102836004)(66066001)(229853002)(106356001)(7736002)(53936002)(105586002)(74316002)(7696005)(5660300001)(2900100001)(81156014)(2501003)(86362001)(316002)(76176011)(6116002)(478600001)(3846002)(8936002)(81166006)(486006)(9686003)(2201001)(6436002)(99286004)(8676002)(476003)(55016002)(14454004)(11346002)(446003)(14444005)(256004)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB4377; H:DB7PR05MB4426.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: hy+/P1w1ViLUWRpcfrbJoDz7Oc94eG0JIosRvg4jL5Qd/quxFAcljmKNTrBVCtTOU54V5EH+yrnjZ+dMYlWqNLACVj2SyQoFzVZlQvitoo9WXBUNbTIKac/MEasWyn+evwc5/sbT9fjd7cEEha7MzvSarnTzrwEuiKRqcw5SvaAuqNsN+9qDiiQ+NMgB84OpWuAB2kon++4PBZc2VrkXYDSJit05k+NdCbjFNimz15jh8EebkmkmT17vxxaKE2sOfy7pErGdj1kDEYyAWgr3dpMdRtiMS1yFEVYUQY/UTxDhRjJCKVzi5p/pZCNOdEguDRsKoErcLPBRCFBz+H/a1qfCy30vAJRBI1Ps0GRlM+0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7568c33d-2b6e-4408-746d-08d5db632a59 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jun 2018 12:48:49.9912 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB4377 Subject: Re: [dpdk-dev] [PATCH v2] eal/devargs: add option to supply PCI dev args 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: , X-List-Received-Date: Tue, 26 Jun 2018 12:48:51 -0000 Hi Pavan, Friday, June 15, 2018 7:44 AM, Pavan Nikhilesh: > Subject: [dpdk-dev] [PATCH v2] eal/devargs: add option to supply PCI dev > args >=20 > Currently, the only way of supplying device argument to a pci device is t= o > whitelist it i.e. -w 000X:00:0X.0,self_test=3D1. This is not a very feasi= ble method > as whitelisting a device has its own side effects i.e only the whiteliste= d pci > devices are probed. >=20 > Add a new eal command line option --pci-args to pass device args without = the > need to whitelist the devices. > --pci-args 000X:00:0X.0,self_test=3D1 >=20 > Signed-off-by: Pavan Nikhilesh Tested-by: Shahaf Shuler It seems to work.=20 Please see small comments below > --- > v2 Changes: > - Document the option usage in eal_common_usage. > - Update commit log to be more informative. >=20 > lib/librte_eal/common/eal_common_devargs.c | 3 +++ > lib/librte_eal/common/eal_common_options.c | 9 +++++++++ > lib/librte_eal/common/eal_options.h | 2 ++ > lib/librte_eal/common/include/rte_dev.h | 1 + > lib/librte_eal/common/include/rte_devargs.h | 1 + > 5 files changed, 16 insertions(+) Should we also update the manual of testpmd (doc/guides/testpmd_app_ug/run_= app.rst ) for the new eal arg? >=20 > diff --git a/lib/librte_eal/common/eal_common_devargs.c > b/lib/librte_eal/common/eal_common_devargs.c > index b0434158b..a56bfeea0 100644 > --- a/lib/librte_eal/common/eal_common_devargs.c > +++ b/lib/librte_eal/common/eal_common_devargs.c > @@ -156,6 +156,9 @@ rte_devargs_add(enum rte_devtype devtype, const > char *devargs_str) > bus =3D devargs->bus; > if (devargs->type =3D=3D RTE_DEVTYPE_BLACKLISTED_PCI) > devargs->policy =3D RTE_DEV_BLACKLISTED; > + else if (devargs->type =3D=3D RTE_DEVTYPE_WHITELISTED_PCI) > + devargs->policy =3D RTE_DEV_WHITELISTED; > + > if (bus->conf.scan_mode =3D=3D RTE_BUS_SCAN_UNDEFINED) { > if (devargs->policy =3D=3D RTE_DEV_WHITELISTED) > bus->conf.scan_mode =3D RTE_BUS_SCAN_WHITELIST; > diff --git a/lib/librte_eal/common/eal_common_options.c > b/lib/librte_eal/common/eal_common_options.c > index ecebb2923..31eebaa53 100644 > --- a/lib/librte_eal/common/eal_common_options.c > +++ b/lib/librte_eal/common/eal_common_options.c > @@ -76,6 +76,7 @@ eal_long_options[] =3D { > {OPT_VMWARE_TSC_MAP, 0, NULL, > OPT_VMWARE_TSC_MAP_NUM }, > {OPT_LEGACY_MEM, 0, NULL, OPT_LEGACY_MEM_NUM }, > {OPT_SINGLE_FILE_SEGMENTS, 0, NULL, > OPT_SINGLE_FILE_SEGMENTS_NUM}, > + {OPT_PCI_DEVARGS, 1, NULL, OPT_PCI_DEVARGS_NUM}, > {0, 0, NULL, 0 } > }; >=20 > @@ -1224,6 +1225,12 @@ eal_parse_common_option(int opt, const char > *optarg, > case OPT_SINGLE_FILE_SEGMENTS_NUM: > conf->single_file_segments =3D 1; > break; > + case OPT_PCI_DEVARGS_NUM: > + if (eal_option_device_add(RTE_DEVTYPE_NORMAL, > + optarg) < 0) { > + return -1; > + } > + break; >=20 > /* don't know what to do, leave this to caller */ > default: > @@ -1360,6 +1367,8 @@ eal_common_usage(void) > " --"OPT_VDEV" Add a virtual device.\n" > " The argument format is [,key= =3Dval,...]\n" > " (ex: --vdev=3Dnet_pcap0,iface=3Deth2).\n" > + " --"OPT_PCI_DEVARGS" Pass key-value arguments to a pc= i > device\n" > + " The argument format is > [,key=3Dval,...]\n" > " -d LIB.so|DIR Add a driver or driver directory\n" > " (can be used multiple times)\n" > " --"OPT_VMWARE_TSC_MAP" Use VMware TSC map instead > of native RDTSC\n" > diff --git a/lib/librte_eal/common/eal_options.h > b/lib/librte_eal/common/eal_options.h > index 211ae06ae..d52d38e32 100644 > --- a/lib/librte_eal/common/eal_options.h > +++ b/lib/librte_eal/common/eal_options.h > @@ -59,6 +59,8 @@ enum { > OPT_LEGACY_MEM_NUM, > #define OPT_SINGLE_FILE_SEGMENTS "single-file-segments" > OPT_SINGLE_FILE_SEGMENTS_NUM, > +#define OPT_PCI_DEVARGS "pci-args" > + OPT_PCI_DEVARGS_NUM, > OPT_LONG_MAX_NUM > }; >=20 > diff --git a/lib/librte_eal/common/include/rte_dev.h > b/lib/librte_eal/common/include/rte_dev.h > index 3879ff3ca..fb3e5033f 100644 > --- a/lib/librte_eal/common/include/rte_dev.h > +++ b/lib/librte_eal/common/include/rte_dev.h > @@ -124,6 +124,7 @@ enum rte_kernel_driver { > * Device policies. > */ > enum rte_dev_policy { > + RTE_DEV_NORMAL, > RTE_DEV_WHITELISTED, > RTE_DEV_BLACKLISTED, > }; > diff --git a/lib/librte_eal/common/include/rte_devargs.h > b/lib/librte_eal/common/include/rte_devargs.h > index 58fbd90a2..78c600bf2 100644 > --- a/lib/librte_eal/common/include/rte_devargs.h > +++ b/lib/librte_eal/common/include/rte_devargs.h > @@ -29,6 +29,7 @@ extern "C" { > * Type of generic device > */ > enum rte_devtype { > + RTE_DEVTYPE_NORMAL, /* Normal dev with special pci args */ What is "Normal" device? Can we find a better name?=20 > RTE_DEVTYPE_WHITELISTED_PCI, > RTE_DEVTYPE_BLACKLISTED_PCI, > RTE_DEVTYPE_VIRTUAL, > -- > 2.17.1