From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0068.outbound.protection.outlook.com [104.47.32.68]) by dpdk.org (Postfix) with ESMTP id 95DECF91C for ; Mon, 26 Dec 2016 14:21:32 +0100 (CET) Received: from BN6PR03CA0026.namprd03.prod.outlook.com (10.175.124.12) by DM2PR0301MB0750.namprd03.prod.outlook.com (10.160.97.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.11; Mon, 26 Dec 2016 13:21:31 +0000 Received: from BN1BFFO11FD032.protection.gbl (2a01:111:f400:7c10::1:132) by BN6PR03CA0026.outlook.office365.com (2603:10b6:404:10c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.11 via Frontend Transport; Mon, 26 Dec 2016 13:21:31 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) 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.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1BFFO11FD032.mail.protection.outlook.com (10.58.144.95) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.789.10 via Frontend Transport; Mon, 26 Dec 2016 13:21:30 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.87]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id uBQDKVCY029786; Mon, 26 Dec 2016 06:21:28 -0700 From: Shreyansh Jain To: CC: , , Shreyansh Jain Date: Mon, 26 Dec 2016 18:54:01 +0530 Message-ID: <1482758645-23057-9-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482758645-23057-1-git-send-email-shreyansh.jain@nxp.com> References: <1482756644-13726-1-git-send-email-shreyansh.jain@nxp.com> <1482758645-23057-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131272320911523491; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(6009001)(336005)(7916002)(39410400002)(39380400002)(39400400002)(39840400002)(39860400002)(39850400002)(39450400003)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(104016004)(5003940100001)(85426001)(77096006)(38730400001)(69596002)(356003)(110136003)(47776003)(36756003)(8656002)(48376002)(81166006)(50226002)(81156014)(6916009)(2950100002)(50466002)(8676002)(305945005)(86362001)(2906002)(68736007)(4326007)(105606002)(189998001)(2351001)(33646002)(92566002)(76176999)(50986999)(106466001)(6666003)(8936002)(626004)(5660300001)(97736004)(7059030)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0750; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD032; 1:Zgs+n0ZnPwlVIKy2OGpXn74G5KPhySqrU+jugEynbAWhN4aigGrT76ZYZR3RTukk461QJh9uCpcWVAqX+hVHvqmZaczHNUZo0knKtBCcH1h7o8gLXGBYPrORw5wkYdl+lX9yzpkNCK7hbVCOdoUajjjAetn1ezDMEqTCOtj3M9QM+hdFNX1IFgK0pfPkE/iHtwCpt8XgVAr7qfYhd50bsCGgIvQjVwFZE//40vN/IMtBKyTnELT8xGLZBryEBUOGfSXLAIUxpob1j9T5UVCa7yEhtyUKdYzkX6z5UUHAcG0JfqRFRj+px7w0MP+CTuvSl/fvnRFQxpkSNLKkIuvBGRokpeFeda55BfnSTpd6S6leYvajClt/SNNz1cN5q/zeOIxw/tWjjE94qeVYVSJLyOTOsBzhDGbt0GwJRUhGy31O8cGIuh1NWmGLg9+7PICd+jiGVkG1bqovPSRvEkyJW620L+22ooggws6Ov0/zo06sqPbIdEAW4wVYy1njfWRnnesbO+TsM3OOpAALHRUdELLlzxuCurovKaIa2Qt0nW1C83pRHTxpv14KXN+AETvCBpK3pe4xXTRIi7rkCli7ZiX68t6WrftXiOjgZv3Oh4P7uESO/8Q22hDaznMFFRPFQzMLb0Un8JTBFJMpHLBt4OtXI0nbw1ALBQDjHztN8TueNrv4o2BYY4YaccTMR7M9yVkoJJN4ULQ5MmJbdHW2OmNgUzmuFcovkFmeb5pLVfk= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 7ed0cece-e257-4fc1-5d42-08d42d921b3a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DM2PR0301MB0750; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0750; 3:nPFJ3Z6jqac8RcFVwKfY7mFOIjADrYVfmuhFZGVN68f2dq2/qnHRyBL4XP0MDvHrhk9OVN7Gpr4yLiymy7qBzehRAuXS2CD6v0FZd3hgmPxl/KdFyTaLLbkBNH8eSnxLZvQ8D7LTYSQ/CA9dDdpAPpPxVv9NGlvFojeo3eX8NhiMIX1v7PS4rWrXC8CDhaWO+1zfGnSRq4RwDTwFtnieEYxgM/9X0gfeMfZW0uLKLNwvtLi+VWQu1yZQZwIIu21lPQEyzIQ7rpSqe4oRJiQegB+5tDP2PHskMjoQGG++/cJg8kNGX1GdIi6+62N6LaTDnWwkqqnX7rpabKrdtobEowpC0xsNrXa0XQWnacIPeWPvFDEnTHWgDlFQpcV+bvHu; 25:+CMSN+FtvRUJwzaEqiNPkXPlnHk45BuwaFkX63lnFYDRw0z7QLGuFsBT6a2TX9cMciB06IwgiubTjR2XIc8SNLSEficORYae9A/iBH2P/SoqxKmq0KolHM4FwMgzJ+ng7uShb3CyZdUFaSt8GKe+qTc02lZqN+kaovmm8DeuDq+9p6L7iJZ3fEYI5jqZFXpIMULs0gLxMma/gETsXYcBsKIeU/hQtB4MaohTuD3PyVj7H6xXH4ZHpL9oaAlGVsTZCzTHfIFxHDMCrqgnl4IJeEWwNoDTvkw5lr9HPvUPVtDMj/cvCThY1hvNF3S6PVPJWLSMJ6VVyKq8NpAj0kEI8zkbwjOucKVU+esGO8ZN59F1qP5jybGY3vm2EVMm2XDPNR7z5NgMrFFRcfYIsdZXt2AJbXcYwsyC7c72Rey8gD0TfsxtAyXwl/2guWXNVmHROsiIofN6HrvrT7PljSRKOg== X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0750; 31:Jih/ozOxIPv34SHBEmWcntzx+kio5kefdLaAHFAUM0I+R9jvFzFFxSxtcLnLFivshErHpegMDKaAq3fKXScB6V4UCUflCTXP2+bSJhJmRIINbZFY1eR/5lKfpI1ddGCNu8cEyi1oq93jM+9EoKUWbt/zWn0NF//b8DVOWSruYsGnpvXxXfA/EdmatgV6qcO4avJBz6jANlL+/O8igPQzWJPORAP9U3lz6zAHtOryFu2p9Yzydo9YVSCQHLSKRg+bUaGxCXwPrgoji3WfapQLce5qxxSt8l9jQcy+IUrBtq8= 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)(13017025)(13015025)(13018025)(13023025)(13024025)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6096035)(20161123565025)(20161123563025)(20161123559025)(20161123556025)(20161123561025); SRVR:DM2PR0301MB0750; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR0301MB0750; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0750; 4:B+jPUzrFe7DGHQmsieEqZeMXd9U/ILXgwSa7kkDf4sJHrREA2lqNz05Z3xfOWFmLvKsEulPrwDShrJLSgvtcXKPv5l0Gj2tWiRycir6JK2egLj3zkhKai56BEaXdr5uzSzBhIedzwIO73ExFvzmk9MynAYfN27/UQuHfw1I7VbCMGiyf0ZAmuYUHcK8kmuSKfRd+oKlbAmwoSDGRwxNDvyqaG1hN507itMk5Xunrkt8Anq+ejFlSlMzXm1FJsxUxGyvdZzf82/EcuL5VXwRdrhay8A2En2/iNve3n1D/HIaaxU2t2ykwU2O9YOeGighX3atLP18wpoaXA0c1Kn0ZM5yR8XQXB6+b3pULLcyNcg8vJCKPwvdYjvUj9Qf6vXG2D9vextWZtalkQT9KOKwKP3Iqcd3npfVicuS4uJNsZfMM7nXEqJFxKxrPqHpiJ6vgp2aG6AyMP3q/62DfZ1rLujKX38f71tqGYp4MOaLnfvdP++sxZH8sONDcfLE+9xNLHpOkp5HTQcweLmANrzd5e0RRsPZtP60IqRbp+0swvsuwj55uSz83FJTOAT6wSEsK6ucEDLTlGT9n9OVTWMsIokIDHeflc5BjnN6AzHo1X68LMRAdCuY1J7GJNMw01MhHSBBBqgCbR1iOVlcrh6i58LVYWPIwGEL/k6Xn4k6yJdL8tRahBmwToKqHS8a9jUCsRIllEN75pt4XR8U0HyBoRInJVw0UREdPy9P6mDFpQ6zwNfqrqPV2HBDDeSHDDS3a X-Forefront-PRVS: 016885DD9B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0750; 23:BG/7xRKXWXn9SuG1vT/YJTcQuxHX5XGLHdHV9VK?= =?us-ascii?Q?rs57rdWlmanNT8AEbsm/xZnSsCGiulg4fJAclrKDVzQi88uxDCSXi6oAJeJb?= =?us-ascii?Q?AG8Ie9UixI5RXZ09PaeX7ifDTiymaZ793Cau2BrNQdvUE06xGH+9hwEPGdyB?= =?us-ascii?Q?9aCHa2ay9+12V5quiuIiMQGXRfcoxknyD+Bn/cRIP31abuVOM2s2DMydZwmx?= =?us-ascii?Q?F6bgRu0/bmDxliBhCEI711pqNsWLmFXrSdu93y3bo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LYWjWmTLRWhT0T5meED9k0/dnnWrGeq6YevHtLmBL9wIbxnu8QqYqJdRBSH8E= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0750; 7:UowCt7mX9zjDNsEC4cD6mI3WI5Mshto1q7EmcuWDqL7mcLifUqW/zD4+xbD+u3dMp8jGnBxPm3bnwlYBTddg4Yap8WjINxRltvJLSZ26oJ29q6ed6Ca9ajAz0Z9205zwzoQqMaIEY4RUS3q5gAL63cI+s4j7NTaAJBgwXrZIRatDS+qOxipoTbvdYhqV3kL1UGkpBKCiug//xJ4NrIOkYdhTbTFB5bqoAzKq45o7ytZkwsb8SHWoLYHFPA6I0YhzZR+G2GGzPSDwKYila4xsKeNTLH8L9Vkyq93NgFAy5BQyzrAfgeMiB2FwPBAb7JLPlQCcDKI7EmX7rkXaotjlM+6bqi9jBRbWZafK2uCKXIE2+LI+Lr5PapyssfRjVDB3Ypsw3UJec/5yYHSaPs3xmKXvT15MAk/WY+jWnFZq/FEzJLZbPPbpVLDMOB78zEjqafNXDTFtYWztRRqDUn7Xfw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2016 13:21:30.8871 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0750 Subject: [dpdk-dev] [PATCH v5 08/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: Mon, 26 Dec 2016 13:21:33 -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 | 16 +++++++++------- lib/librte_eal/linuxapp/eal/eal_pci.c | 4 ++-- 5 files changed, 35 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 3a5c315..56b506e 100644 --- a/lib/librte_eal/bsdapp/eal/eal_pci.c +++ b/lib/librte_eal/bsdapp/eal/eal_pci.c @@ -352,7 +352,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; @@ -667,7 +667,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 f466448..b7be6aa 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; } @@ -263,12 +272,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 34ff3d1..e5e58dd 100644 --- a/lib/librte_eal/common/include/rte_pci.h +++ b/lib/librte_eal/common/include/rte_pci.h @@ -367,25 +367,27 @@ 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 4350134..7e092d2 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c @@ -446,7 +446,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; @@ -724,7 +724,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