From: Ferruh Yigit <ferruh.yigit@intel.com>
To: dev@dpdk.org
Cc: Stephen Hemminger <sthemmin@microsoft.com>,
Shreyansh Jain <shreyansh.jain@nxp.com>,
Jan Blunck <jblunck@infradead.org>,
Ferruh Yigit <ferruh.yigit@intel.com>
Subject: [dpdk-dev] [PATCH 1/2] add rte_bus->probe
Date: Tue, 10 Jan 2017 18:02:49 +0000 [thread overview]
Message-ID: <20170110180250.10625-1-ferruh.yigit@intel.com> (raw)
In-Reply-To: <bec2dfb0-d28f-a147-d9ea-1b06139e858c@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/librte_eal/common/eal_common_bus.c | 7 ++++---
lib/librte_eal/common/include/rte_bus.h | 3 +++
lib/librte_eal/linuxapp/eal/eal_pci.c | 1 +
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common/eal_common_bus.c
index f8c2e03..e8d1143 100644
--- a/lib/librte_eal/common/eal_common_bus.c
+++ b/lib/librte_eal/common/eal_common_bus.c
@@ -145,6 +145,7 @@ rte_eal_bus_register(struct rte_bus *bus)
/* A bus should mandatorily have the scan and match implemented */
RTE_VERIFY(bus->scan);
RTE_VERIFY(bus->match);
+ RTE_VERIFY(bus->probe);
/* Initialize the driver and device list associated with the bus */
TAILQ_INIT(&(bus->driver_list));
@@ -195,19 +196,19 @@ rte_eal_bus_scan(void)
}
static int
-perform_probe(struct rte_bus *bus __rte_unused, struct rte_driver *driver,
+perform_probe(struct rte_bus *bus, struct rte_driver *driver,
struct rte_device *device)
{
int ret;
- if (!driver->probe) {
+ if (!bus->probe) {
RTE_LOG(ERR, EAL, "Driver (%s) doesn't support probe.\n",
driver->name);
/* This is not an error - just a badly implemented PMD */
return 0;
}
- ret = driver->probe(driver, device);
+ ret = bus->probe(driver, device);
if (ret < 0)
/* One of the probes failed */
RTE_LOG(ERR, EAL, "Probe failed for (%s).\n", driver->name);
diff --git a/lib/librte_eal/common/include/rte_bus.h b/lib/librte_eal/common/include/rte_bus.h
index 07c30c4..ce1f56a 100644
--- a/lib/librte_eal/common/include/rte_bus.h
+++ b/lib/librte_eal/common/include/rte_bus.h
@@ -135,6 +135,8 @@ typedef int (*bus_scan_t)(struct rte_bus *bus);
*/
typedef int (*bus_match_t)(struct rte_driver *drv, struct rte_device *dev);
+typedef int (*bus_probe_t)(struct rte_driver *drv, struct rte_device *dev);
+
/**
* A structure describing a generic bus.
*/
@@ -147,6 +149,7 @@ struct rte_bus {
const char *name; /**< Name of the bus */
bus_scan_t scan; /**< Scan for devices attached to bus */
bus_match_t match;
+ bus_probe_t probe;
/**< Match device with drivers associated with the bus */
};
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c
index 314effa..837adf6 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -726,6 +726,7 @@ rte_eal_pci_ioport_unmap(struct rte_pci_ioport *p)
struct rte_bus pci_bus = {
.scan = rte_eal_pci_scan,
.match = rte_eal_pci_match,
+ .probe = rte_eal_pci_probe,
};
RTE_REGISTER_BUS(pci, pci_bus);
--
2.9.3
next prev parent reply other threads:[~2017-01-10 18:03 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-07 18:17 [dpdk-dev] [PATCH v2 0/8] device abstraction and VMBUS support infrastructure Stephen Hemminger
2017-01-07 18:17 ` [dpdk-dev] [PATCH 1/8] ethdev: increase length ethernet device internal name Stephen Hemminger
2017-01-07 18:17 ` [dpdk-dev] [PATCH 2/8] i40e: don't refer to eth_dev->pci_dev Stephen Hemminger
2017-01-10 12:08 ` Jan Blunck
2017-01-10 17:57 ` Stephen Hemminger
2017-01-11 7:55 ` Jan Blunck
2017-01-07 18:17 ` [dpdk-dev] [PATCH 3/8] vmxnet3: " Stephen Hemminger
2017-01-10 12:10 ` Jan Blunck
2017-01-07 18:17 ` [dpdk-dev] [PATCH 4/8] cxgbe: " Stephen Hemminger
2017-01-10 12:12 ` Jan Blunck
2017-01-07 18:17 ` [dpdk-dev] [PATCH 5/8] nfp: " Stephen Hemminger
2017-01-10 12:13 ` Jan Blunck
2017-01-07 18:17 ` [dpdk-dev] [PATCH 6/8] qat: " Stephen Hemminger
2017-01-10 12:15 ` Jan Blunck
2017-01-07 18:17 ` [dpdk-dev] [PATCH 7/8] ethdev: break ethernet driver and pci_driver connection Stephen Hemminger
2017-01-10 13:59 ` Ferruh Yigit
2017-01-10 17:58 ` Ferruh Yigit
2017-01-10 18:02 ` Ferruh Yigit [this message]
2017-01-10 18:02 ` [dpdk-dev] [PATCH 2/2] separate bus and functionality driver structs Ferruh Yigit
2017-01-11 4:53 ` [dpdk-dev] [PATCH 1/2] add rte_bus->probe Shreyansh Jain
2017-01-11 15:03 ` Ferruh Yigit
2017-01-12 5:28 ` Shreyansh Jain
2017-01-10 16:11 ` [dpdk-dev] [PATCH 7/8] ethdev: break ethernet driver and pci_driver connection Jan Blunck
2017-01-10 18:03 ` Stephen Hemminger
2017-01-07 18:17 ` [dpdk-dev] [PATCH 8/8] eal: VMBUS infrastructure Stephen Hemminger
2017-01-10 17:27 ` Jan Blunck
2017-01-10 18:05 ` Stephen Hemminger
2017-01-11 14:49 ` Jan Blunck
2017-01-11 21:13 ` Jan Blunck
2017-01-12 1:20 ` Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170110180250.10625-1-ferruh.yigit@intel.com \
--to=ferruh.yigit@intel.com \
--cc=dev@dpdk.org \
--cc=jblunck@infradead.org \
--cc=shreyansh.jain@nxp.com \
--cc=sthemmin@microsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).