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 E5E9DA0613 for ; Wed, 25 Sep 2019 08:41:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4F518DE3; Wed, 25 Sep 2019 08:41:38 +0200 (CEST) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50054.outbound.protection.outlook.com [40.107.5.54]) by dpdk.org (Postfix) with ESMTP id 90E4A271 for ; Wed, 25 Sep 2019 08:41:37 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HpZH4clnWCdATc65LtDGu7W0vYV4VckUyYa58TcBrBr4wUgfuEKLMs4MqjIfIRtgXsqWxE76jsUbJKXDG0YHtKNZ8HE8gHtukL/qj1kXwJQsISZrzffLSCJu9VQHifUADvUjeSYZ9IAFvUjtaJjQeB/glrXGWvUikLPZnQ2Tbe7bHLgX6q4LHmqLaEbqOrKVQc3V8LmtSiHD1Y/9l0ODDmYgYdFIOEBt46Vxng0xl5NBgwkozXN5qwPgSPjLbQAWX3U7n2KXGPeh1mob5ZT54aX6PJ7Kx50h1ZwOq8f+7W3l8MZzyQI4IPVQm5FMkGg5aCtjwk94tu4LHE6HbunwDQ== 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=cWtE918/kKudgeVQaTpM6uAr1g+FX7TKEDBELWexej4=; b=L2IxNoq7bXYS6VccvqvmB6lwAOh4VsPGLvZna9MG5Fm5/gRHkqTpil6yMm7qHwFAYDRM1uLuDcVOsAHkCZ4oAVK1YsxRYhzTXBmIPE19tYqnJyD2Be7pwiR3pnmq6ipIGzCAsmXwYW2/L4OGNOJDFZfivvq6DmQxmf5ESOQkGFuKT1sr0rcnMSMBcZxkw9WoDzxAvQGTuTZ+TIXsYA8ERV4AGRWHyisARglIdsu+WY/OsHin3/BMNyEdmwLsPhl2LUi8QNeOczopdGGTrSGrunkVlgbismhRxykX55hU8wScFa97/hx0zfNjnfpSfSqpuIYJE8fg3K1xP5Hiz7D7sw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cWtE918/kKudgeVQaTpM6uAr1g+FX7TKEDBELWexej4=; b=r1FYMjHMmUHnJXxT7nnW5bYiRfbVx0W6pBpkDwd5wc9PFytDC2jXMTJ3mFFQLjkfsJjrM5ed88iODRN0z6AQ+f9nmMWpX3WgOmvv5HtEIlXLWyToO5YjdzLVmsQNErgVtBJCLn1Z6CDbSBVc7MvmHKwB3HqKBFe5IQprgR+S5Yc= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.188.154) by AM4PR05MB3475.eurprd05.prod.outlook.com (10.171.186.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2284.21; Wed, 25 Sep 2019 06:41:36 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::da9:65ba:1323:a39b]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::da9:65ba:1323:a39b%7]) with mapi id 15.20.2284.023; Wed, 25 Sep 2019 06:41:36 +0000 From: Slava Ovsiienko To: "vattunuru@marvell.com" , "dev@dpdk.org" CC: "gaetan.rivet@6wind.com" , "ferruh.yigit@intel.com" , "anatoly.burakov@intel.com" , Thomas Monjalon , "jerinj@marvell.com" Thread-Topic: [dpdk-dev] [PATCH v1 1/1] bus/pci: probe PCI devices in whitelisted order Thread-Index: AQHVcgYAN607loX3PUOd940LVpUVjac7851A Date: Wed, 25 Sep 2019 06:41:36 +0000 Message-ID: References: <20190923115630.7929-1-vattunuru@marvell.com> In-Reply-To: <20190923115630.7929-1-vattunuru@marvell.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=viacheslavo@mellanox.com; x-originating-ip: [95.67.35.250] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 86d952c7-b6f5-4a32-7836-08d7418369d0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600167)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:AM4PR05MB3475; x-ms-traffictypediagnostic: AM4PR05MB3475: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 01713B2841 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(346002)(39860400002)(136003)(366004)(396003)(13464003)(189003)(199004)(478600001)(14454004)(66946007)(316002)(5660300002)(66066001)(66476007)(66556008)(64756008)(66446008)(25786009)(7696005)(71200400001)(71190400001)(6506007)(53546011)(2501003)(8936002)(76116006)(81166006)(81156014)(99286004)(76176011)(2906002)(86362001)(9686003)(102836004)(55016002)(6436002)(6246003)(229853002)(4326008)(26005)(186003)(110136005)(256004)(54906003)(14444005)(52536014)(446003)(11346002)(6116002)(3846002)(486006)(476003)(74316002)(305945005)(7736002)(33656002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3475; H:AM4PR05MB3265.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: mCCtrISBMhRODQXoKfwQAqjJT4/3iuaSf04FaU9eI6smeq7rmyxNGMOgI+qzPIQANl2hdKBirGBCqAnM9jN9zxTNlGH9aQ/LXrYl0aZ6RwYVqK+lncztQ7a3DRP1+hYZNyKjtOfsburYP9ejskmsv9ueuhw06bKkJybRpQipROAhoHzrc9OV5IZDdYKHrTBi7467OyzMH6FFZyhcFMPqcBkOKWLSwC+FmqU/sX/2YTFHYZYPKUzI0vQGX4/fCNhyODnUI23gqnpJOsVvEa/y3UNiUJCPDtT3ILHVJi9G26QxFcvNpbONFgM4SqA9mfZYes/E/IR3w/axkWtLexGJoQqtTTn5x77zeIK432Jcg01rVPj0AQYHBgRqnw3SzUhvmUg6AiTQgynrl251BWLJrRcAho/NEkC8+KAcQSQiGh0= x-ms-exchange-transport-forked: True 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: 86d952c7-b6f5-4a32-7836-08d7418369d0 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Sep 2019 06:41:36.7006 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: tTBRC50CMKt+I/8Hsv3yvkMkaVSveHxPr5v2AtsX/1hDq9jyUXhK28NiO+/cDg4ZQ+mnQxYco0fgGadJptN3mtwLxkRDPonW4Dvuujwg5Gs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3475 Subject: Re: [dpdk-dev] [PATCH v1 1/1] bus/pci: probe PCI devices in whitelisted order 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: dev On Behalf Of vattunuru@marvell.com > Sent: Monday, September 23, 2019 14:57 > To: dev@dpdk.org > Cc: gaetan.rivet@6wind.com; ferruh.yigit@intel.com; > anatoly.burakov@intel.com; Thomas Monjalon ; > jerinj@marvell.com; Vamsi Attunuru > Subject: [dpdk-dev] [PATCH v1 1/1] bus/pci: probe PCI devices in whitelis= ted > order >=20 > From: Vamsi Attunuru >=20 > Current pci bus driver scans pci devices in the order that it read from s= ysfs. > Accordingly all or whitelisted devices are getting probed. >=20 > Patch modifies the probing order of whitelisted pci devices in a sequence= the > devices are whitelisted(using EAL flags). Thanks, it would be nice to have opportunity to control probing order, it might be useful for bonded devices and representors either. Acked-by: Viacheslav Ovsiienko >=20 > It ensures the eth devices that application uses are probed in device > whitelisted sequence, in turn it facilitates the packet forwarding applic= ations > to work without any packet loss or performance drop when the underneath > network ports have different bandwidths. By altering the whitelist order > applications like testpmd, l2fwd can forward the ingress traffic to egres= s port > that has of equivalent bandwidth. >=20 > Signed-off-by: Vamsi Attunuru > --- > drivers/bus/pci/pci_common.c | 67 ++++++++++++++++++++++++++++++---- > ---------- > 1 file changed, 46 insertions(+), 21 deletions(-) >=20 > diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c > index 6b46b4f..c27a0e9 100644 > --- a/drivers/bus/pci/pci_common.c > +++ b/drivers/bus/pci/pci_common.c > @@ -293,32 +293,57 @@ rte_pci_probe(void) > struct rte_pci_device *dev =3D NULL; > size_t probed =3D 0, failed =3D 0; > struct rte_devargs *devargs; > - int probe_all =3D 0; > + struct rte_pci_addr addr; > int ret =3D 0; >=20 > - if (rte_pci_bus.bus.conf.scan_mode !=3D RTE_BUS_SCAN_WHITELIST) > - probe_all =3D 1; > - > - FOREACH_DEVICE_ON_PCIBUS(dev) { > - probed++; > + if (rte_pci_bus.bus.conf.scan_mode !=3D RTE_BUS_SCAN_WHITELIST) { > + /* Probe all devices */ > + FOREACH_DEVICE_ON_PCIBUS(dev) { > + probed++; >=20 > - devargs =3D dev->device.devargs; > - /* probe all or only whitelisted devices */ > - if (probe_all) > ret =3D pci_probe_all_drivers(dev); > - else if (devargs !=3D NULL && > - devargs->policy =3D=3D RTE_DEV_WHITELISTED) > - ret =3D pci_probe_all_drivers(dev); > - if (ret < 0) { > - if (ret !=3D -EEXIST) { > - RTE_LOG(ERR, EAL, "Requested device " > - PCI_PRI_FMT " cannot be used\n", > - dev->addr.domain, dev->addr.bus, > - dev->addr.devid, dev- > >addr.function); > - rte_errno =3D errno; > - failed++; > + if (ret < 0) { > + if (ret !=3D -EEXIST) { > + RTE_LOG(ERR, EAL, "Requested > device " > + PCI_PRI_FMT " cannot be > used\n", > + dev->addr.domain, dev- > >addr.bus, > + dev->addr.devid, > + dev->addr.function); > + rte_errno =3D errno; > + failed++; > + } > + ret =3D 0; > + } > + } > + } else { > + /* Probe only whitelisted devices */ > + RTE_EAL_DEVARGS_FOREACH("pci", devargs) { > + if (devargs->policy !=3D RTE_DEV_WHITELISTED) > + continue; > + > + devargs->bus->parse(devargs->name, &addr); > + > + FOREACH_DEVICE_ON_PCIBUS(dev) { > + if (rte_pci_addr_cmp(&dev->addr, &addr)) > + continue; > + probed++; > + ret =3D pci_probe_all_drivers(dev); > + if (ret < 0) { > + if (ret !=3D -EEXIST) { > + RTE_LOG(ERR, EAL, > + "Requested device " > + PCI_PRI_FMT > + "cannot be used\n", > + dev->addr.domain, > + dev->addr.bus, > + dev->addr.devid, > + dev->addr.function); > + rte_errno =3D errno; > + failed++; > + } > + ret =3D 0; > + } > } > - ret =3D 0; > } > } >=20 > -- > 2.8.4