From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0044.outbound.protection.outlook.com [104.47.38.44]) by dpdk.org (Postfix) with ESMTP id 054A96A94 for ; Fri, 16 Dec 2016 14:09:18 +0100 (CET) Received: from BN6PR03CA0038.namprd03.prod.outlook.com (10.175.124.24) by BN6PR03MB2468.namprd03.prod.outlook.com (10.168.223.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.789.14; Fri, 16 Dec 2016 13:09:18 +0000 Received: from BN1AFFO11FD047.protection.gbl (2a01:111:f400:7c10::104) by BN6PR03CA0038.outlook.office365.com (2603:10b6:404:10c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.789.14 via Frontend Transport; Fri, 16 Dec 2016 13:09:18 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD047.mail.protection.outlook.com (10.58.53.62) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.771.7 via Frontend Transport; Fri, 16 Dec 2016 13:09:17 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:835; Count:10 Received: from Tophie.ap.freescale.net ([10.232.14.87]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id uBGD8BtK028345; Fri, 16 Dec 2016 06:09:14 -0700 From: Shreyansh Jain To: , CC: , , , Shreyansh Jain Date: Fri, 16 Dec 2016 18:40:50 +0530 Message-ID: <1481893853-31790-10-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1481893853-31790-1-git-send-email-shreyansh.jain@nxp.com> References: <1481636232-2300-1-git-send-email-shreyansh.jain@nxp.com> <1481893853-31790-1-git-send-email-shreyansh.jain@nxp.com> X-IncomingHeaderCount: 10 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131263673576200486; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(336005)(39840400002)(39380400002)(39860400002)(39410400002)(39850400002)(39400400002)(39450400003)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(47776003)(8666005)(85426001)(356003)(50226002)(626004)(97736004)(92566002)(33646002)(48376002)(2906002)(8936002)(575784001)(4326007)(305945005)(50466002)(5001770100001)(86362001)(81166006)(8676002)(106466001)(77096006)(38730400001)(105606002)(81156014)(5003940100001)(104016004)(2950100002)(6666003)(76176999)(36756003)(50986999)(5660300001)(68736007)(189998001)(7059030)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2468; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD047; 1:5ecEe83eu06AWIdX/dS2+Q9B4HV81fC8rvaG7FUT4xXoVIVhm7VHqAFZphATEpAfS+pfrPo9LJFxfJ1WYanadk+SG2UURu0MqkBaoeosCiGFSL2bPKO9xuxmjP0bUiH55SsFern+5w6GXM30dd1b209WTRIiWe3ypYg4a1E6hY2cOZvw0N6aYYYFis9OJ7Izoats4aV2EH4ZmQ8FtsI72czdEytSBZjngBb16GyUj1I6cTyJVFgAu/+uf9Ph9IJ3fpmMqJo0mpM5G4hpjo+xdbk2Zv804KKUYnb2EzebXe6bJK9a3nlb60MyUNhmXrt8Rt9GJmShGhiKhX5jjku1UacDbI/z41kBeebk7BTNthYKqWRSvmQPU6Upya3HrREHKu6y4PDUJaqb42O57OIQ9FMPTWyksGaooCSvulnrbZc6YRZDLFea9qxXK3Opi0FwJeMPsnxrvELTQLpPZHX+0i4k1/DbrMSdP2X6zw8IeJGj6FfEW1vClzGv5xI/nikFv+ExV0AV4ioj0wg7lpwz6x3GOBsW1o5F+rY4Mwd2ZolGmSQWLovaVMLOKwH6jTg8SO49zeYEhcWM0aihSPZuh2YCqG+R1IxgDGyih5g6GvhcFiiRyUL9MGsiz1HtWFhjNrFBOoAssRUknrft5XM5f5Yd/jJiljKFjLpVh2FN/Jn3CKIz3HX0dyZyfCJap6lh/L6XqkxVat44PUxpPRduaqLDnFbi+hIoOpMv/M4/CsO+PZXRw4Icfdar45C/idAdzzIB6qZ9zvTzCaOffUK1WQ== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 1f60821d-36d5-42c3-6f9b-08d425b4bdd2 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN6PR03MB2468; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2468; 3:mMzQw5TOF37ft+Nru5NjLjM+bR0tKPA7+T4XBch+D/vGHf2sOqCAbPE6eAV1OhTK2IOHwJ0AqeWncw5hg0SHrfMkpJMVK5c81loXI0FpyHKJipmcS+MfueKowl2wLUqtkqd8PluBwwDWuA7sb73TK/RETGSjfUkVli90+XMw9fY2G8DUfKi1ZTmcd83P7ut6G3BrpEKR5HUm1jk4l3gRf2LCdQ9nTmGIfAtuhSlj1BOJUX9upQSGMJ7JgKaqQCMExExLb53xBedokpIYvEHzPdyxdtvR2uHN1A0z6Kb7UiZFJlDaMo5eU9sPHmIv7W/J5OA77yY/FAiML86aB49xK7835cben+GselyM+x9ociok7Hc+XaZkakuaa5MMYG60; 25:NlqWFe4BteyzOKBrpTCxCBsKZt6zWxKpGiXdkqptzmHq+HDQbqi4kIdSFj1dHWTCtQ6JLGBMqTPNwdrQKF8z7j9POJdlVFqrdVI9d0mW5iK74jVrJSAWmvmVr50myXf/OWn0TVEdTDUnFySm5VeYqikiMF8R67t9cm1aAB/YF4r2j+Bf6jf2bxjlQizadkftOlI5ByXaaSe70UIwR5mFEQx0DhiV9uj3T+mxDx9MLPuKPyQz/qeuXz9ExPTEsEGwH5FMNxx8EwMOVKgSaSHND2COZvH/nkh/8lsKW5FJJ6s0D1VgQl3FnxcHXbkx4/M0UIhGljvBH9aR7t3SieTAMkfKycLxsVdBOuYpmFMbu5LUPuDroTQ1MyZbgsDv5P8c2UUiDEq2X6/YRvY8SVSkzMrLrqNno94A8vGbptsJ7DOSq560bUzC7Tw6wl+NLFafi0v//k6rSXuj3TEf3ln64A== X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2468; 31:yxziX4eROCaP/dk30Bs72K0jyWG6HrH95qfc/NO+L9Zmb6eAi1m7wvHeDpgA864I6BcJWzcUxeq+DYTorPHMuSHDhKPkZC1v98dGFYbkMr4hCWLver1R8Yd0rKeNJQcS4lAquM/U40OlU0CGJawH4eNmUDKJFjHPFMMTOZQ3KCU+sexPgeW/pPgWX1gVFRXPKp2/qpRFikm20EsgHBNcZ0Bf7RqaPNMkeUsEnZIKPTBwcaYv4uDwsMQ0IDtN/8KgpkkxdlSk0q/PzhKFj7Ot535ab/aCFIpD0uj5YDLWUrk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13018025)(13015025)(13023025)(13017025)(13024025)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6096035)(20161123556025)(20161123563025)(20161123561025)(20161123565025)(20161123559025); SRVR:BN6PR03MB2468; BCL:0; PCL:0; RULEID:(400006); SRVR:BN6PR03MB2468; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2468; 4:ygkN/T6GAo7ivojaCMsxl9ZEeFGde4e8wTGLXZQzDTwOilvGUw4Abjw6P3ZnePTkmpTg0pmKplZNVmFZNL+rr3pYag+G8LEsovoYimxIMJPSIsaImtZId04KSwgxybyAmoKlHRlicUPXYJRvrsgbCsHBC4pkUpMUDWWjMe/YhF6bMPjVHUbkpmQg5JFjHFVqudXWhCtPztevD9QXYIxaPYZcNFCcZ1I80tz7GJUjiFPOp/tWf97UzjlYpv7wrmVHHRxRJQ2RK+CV1J1hAHyalH2uitKp0TTkIX8pPMhlqxsF0E0oOAg70/RT5EZAO1T/vn/wKwoZSY6Ogv19RcwditbIiCjCRkq0oGL/eFzll8vPrc5EygEnWGtSMrBLGeIebJH03fJABegG1+hlHDuDE0FQweO/F+fwagsVkektCSQP0UIgKTqw4GgzhQDWJtQPHSvuMIRvMXaO1EA9euEI7FbKGYfgGhJ6uZndSogxsWcxV2OtthGE/XZCUrlX3DfUTFQWaPwD3VIXB5v15yF0V60PIfVQaZjFBr3ickfSp+b/AzNpyNDvBfCw357KFFRIXyDF6b0shcd/WTr9Ga7xBUU2brs005MLioPSDRZI5HoMSOesz2BULOtMZ6E3CBf1kDIh0tuqj8rPfEV5suSgwTCFofw6oAxFwGJlPsHTO5BOL6kiJ8vPQFxuGH0q0llrlKWXbI5zTnx9N8DAu6EwxtlMNzoq4jaKfQbptTxzmax6ePqXRwpu2MK0+qxw+6RV X-Forefront-PRVS: 01583E185C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2468; 23:nfcxKqUZ0fP6twheix9GSLNt+HOEdOnqK2Ije/VnR?= =?us-ascii?Q?VSlPH/fNb5uF91ET/ftRD88kzOxjwdY5nFQPW3U2hFZGRrv7xRIlCIHOnJ0F?= =?us-ascii?Q?TK+WyVQ+6o3GyJGsw/HamTkUnhAVq2ypScdH/z70G3cPp8NIhBUduDXKvHMp?= =?us-ascii?Q?9S4sAguCJi85ahznU9qghZ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ug+I19cJwjaOGBdqoE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2468; 7:+ijuNLduH01qpVFlIX8d2KSEuAxo6CaozwiQz/3wmyuHIk/k4HkWHIM5Dxn+UCMkWtqGPAr68ZkX03gxGQqyH7kxqfb4noSYpa/R4pMuNBB0zAohYc6iwc/AzTDpYWc8OPYGSQiqKj2yiDFCDmvmLl9gkd0BgSfCoLb1yqvDzg4Tr6Y3Cyw8cMUts33D7yv989vlaknuM5vrdcwMHR60kZvUagoS6TsOYES7sQ6H/QxYzRsveCrIh8l6SBiDuRCwEhVVthYT6twJxFgHsb0ExpCdLA+9l38DFim1au9F/2oSc5l9YtRpqrtLk+E/Z9F2p/Zu4wXjPjOcJjBHlg74YmycBhUHGBYsXEXylGX2Qwlzv8Nj4aCt8DfHWo0fONttpCQAmcngAw6ZkdUzcGMATqBgG3Y8LIVmbXeYGwtAR5JwGzuQBVfnn+szkY4zw0JBPzGDSrzaVqooZ/WJQpFV1A== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2016 13:09:17.3236 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB2468 Subject: [dpdk-dev] [PATCH v3 09/12] eal/pci: generalize args of PCI scan/match towards RTE device/driver 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: Fri, 16 Dec 2016 13:09:19 -0000 PCI scan and match now work on rte_device/rte_driver rather than PCI specific objects. These functions can now be plugged to the generic bus callbacks for scanning and matching devices/drivers. Signed-off-by: Shreyansh Jain --- app/test/test_pci.c | 2 +- lib/librte_eal/bsdapp/eal/eal_pci.c | 4 ++-- lib/librte_eal/common/eal_common_pci.c | 28 +++++++++++++++++++++------- lib/librte_eal/common/include/rte_pci.h | 17 ++++++++++------- lib/librte_eal/linuxapp/eal/eal_pci.c | 4 ++-- 5 files changed, 36 insertions(+), 19 deletions(-) diff --git a/app/test/test_pci.c b/app/test/test_pci.c index cda186d..f9b84db 100644 --- a/app/test/test_pci.c +++ b/app/test/test_pci.c @@ -180,7 +180,7 @@ test_pci_setup(void) TAILQ_INSERT_TAIL(&real_pci_device_list, dev, next); } - ret = rte_eal_pci_scan(); + ret = rte_eal_pci_scan(NULL); TEST_ASSERT_SUCCESS(ret, "failed to scan PCI bus"); rte_eal_pci_dump(stdout); diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c b/lib/librte_eal/bsdapp/eal/eal_pci.c index 8b3ed88..10b234e 100644 --- a/lib/librte_eal/bsdapp/eal/eal_pci.c +++ b/lib/librte_eal/bsdapp/eal/eal_pci.c @@ -361,7 +361,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf) * list. Call pci_scan_one() for each pci entry found. */ int -rte_eal_pci_scan(void) +rte_eal_pci_scan(struct rte_bus *bus __rte_unused) { int fd; unsigned dev_count = 0; @@ -676,7 +676,7 @@ rte_eal_pci_init(void) if (internal_config.no_pci) return 0; - if (rte_eal_pci_scan() < 0) { + if (rte_eal_pci_scan(NULL) < 0) { RTE_LOG(ERR, EAL, "%s(): Cannot scan PCI bus\n", __func__); return -1; } diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c index 706f91c..562c0fd 100644 --- a/lib/librte_eal/common/eal_common_pci.c +++ b/lib/librte_eal/common/eal_common_pci.c @@ -153,17 +153,22 @@ pci_unmap_resource(void *requested_addr, size_t size) } int -rte_eal_pci_match(struct rte_pci_driver *pci_drv, - struct rte_pci_device *pci_dev) +rte_eal_pci_match(struct rte_driver *drv, + struct rte_device *dev) { int match = 1; const struct rte_pci_id *id_table; + struct rte_pci_driver *pci_drv; + struct rte_pci_device *pci_dev; - if (!pci_drv || !pci_dev || !pci_drv->id_table) { - RTE_LOG(DEBUG, EAL, "Invalid PCI Driver object\n"); + if (!drv || !dev) { + RTE_LOG(DEBUG, EAL, "Invalid Device/Driver\n"); return -1; } + pci_drv = container_of(drv, struct rte_pci_driver, driver); + pci_dev = container_of(dev, struct rte_pci_device, device); + for (id_table = pci_drv->id_table; id_table->vendor_id != 0; id_table++) { /* check if device's identifiers match the driver's ones */ @@ -201,11 +206,15 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *dev) { int ret; + struct rte_driver *driver; + struct rte_device *device; struct rte_pci_addr *loc; if ((dr == NULL) || (dev == NULL)) return -EINVAL; + driver = &dr->driver; + device = &dev->device; loc = &dev->addr; RTE_LOG(INFO, EAL, "PCI device "PCI_PRI_FMT" on NUMA socket %i\n", @@ -222,11 +231,11 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, } /* The device is not blacklisted; Check if driver supports it */ - ret = rte_eal_pci_match(dr, dev); + ret = rte_eal_pci_match(driver, device); if (ret) { /* Match of device and driver failed */ RTE_LOG(DEBUG, EAL, "Driver (%s) doesn't match the device\n", - dr->driver.name); + driver->name); return 1; } @@ -268,12 +277,17 @@ rte_eal_pci_detach_dev(struct rte_pci_driver *dr, struct rte_pci_device *dev) { int ret; + struct rte_driver *driver = NULL; + struct rte_device *device; struct rte_pci_addr *loc; if ((dr == NULL) || (dev == NULL)) return -EINVAL; - ret = rte_eal_pci_match(dr, dev); + driver = &(dr->driver); + device = &(dev->device); + + ret = rte_eal_pci_match(driver, device); if (ret) { /* Device and driver don't match */ return 1; diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h index c9b113d..10108a4 100644 --- a/lib/librte_eal/common/include/rte_pci.h +++ b/lib/librte_eal/common/include/rte_pci.h @@ -363,25 +363,28 @@ rte_eal_compare_pci_addr(const struct rte_pci_addr *addr, * Scan the content of the PCI bus, and the devices in the devices * list * + * @param bus + * Reference to the PCI bus + * * @return * 0 on success, negative on error */ -int rte_eal_pci_scan(void); +int rte_eal_pci_scan(struct rte_bus *bus); /** * Match the PCI Driver and Device using the ID Table * - * @param pci_drv - * PCI driver from which ID table would be extracted - * @param pci_dev - * PCI device to match against the driver + * @param drv + * driver from which ID table would be extracted + * @param dev + * device to match against the driver * @return * 0 for successful match * !0 for unsuccessful match */ int -rte_eal_pci_match(struct rte_pci_driver *pci_drv, - struct rte_pci_device *pci_dev); +rte_eal_pci_match(struct rte_driver *drv, + struct rte_device *dev); /** * Probe the PCI bus for registered drivers. diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c index 876ba38..bafb7fb 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c @@ -485,7 +485,7 @@ parse_pci_addr_format(const char *buf, int bufsize, uint16_t *domain, * list */ int -rte_eal_pci_scan(void) +rte_eal_pci_scan(struct rte_bus *bus_p __rte_unused) { struct dirent *e; DIR *dir; @@ -763,7 +763,7 @@ rte_eal_pci_init(void) if (internal_config.no_pci) return 0; - if (rte_eal_pci_scan() < 0) { + if (rte_eal_pci_scan(NULL) < 0) { RTE_LOG(ERR, EAL, "%s(): Cannot scan PCI bus\n", __func__); return -1; } -- 2.7.4