* [dpdk-dev] [PATCH 0/2] *** SUBJECT HERE ***
@ 2013-07-10 13:14 Damien Millescamps
2013-07-10 13:14 ` [dpdk-dev] [PATCH 1/2] eal: add flag to force unbind device Damien Millescamps
2013-07-10 13:14 ` [dpdk-dev] [PATCH 2/2] eal: load libraries before creating threads Damien Millescamps
0 siblings, 2 replies; 5+ messages in thread
From: Damien Millescamps @ 2013-07-10 13:14 UTC (permalink / raw)
To: dev
*** BLURB HERE ***
Damien Millescamps (2):
eal: add flag to force unbind device
eal: load libraries before creating threads
lib/librte_eal/common/include/rte_pci.h | 2 ++
lib/librte_eal/linuxapp/eal/eal.c | 24 ++++++++++++------------
lib/librte_eal/linuxapp/eal/eal_pci.c | 5 +++++
3 files changed, 19 insertions(+), 12 deletions(-)
--
1.7.2.5
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH 1/2] eal: add flag to force unbind device
2013-07-10 13:14 [dpdk-dev] [PATCH 0/2] *** SUBJECT HERE *** Damien Millescamps
@ 2013-07-10 13:14 ` Damien Millescamps
2013-07-10 15:52 ` Thomas Monjalon
2013-07-10 13:14 ` [dpdk-dev] [PATCH 2/2] eal: load libraries before creating threads Damien Millescamps
1 sibling, 1 reply; 5+ messages in thread
From: Damien Millescamps @ 2013-07-10 13:14 UTC (permalink / raw)
To: dev
Some devices need to be unbound in order to be used via the PMD
without kernel module.
Signed-off-by: Damien Millescamps <damien.millescamps@6wind.com>
---
lib/librte_eal/common/include/rte_pci.h | 2 ++
lib/librte_eal/linuxapp/eal/eal_pci.c | 5 +++++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h
index c3937f0..6582c25 100644
--- a/lib/librte_eal/common/include/rte_pci.h
+++ b/lib/librte_eal/common/include/rte_pci.h
@@ -157,6 +157,8 @@ struct rte_pci_driver {
#define RTE_PCI_DRV_NEED_IGB_UIO 0x0001
/** Device driver must be registered several times until failure */
#define RTE_PCI_DRV_MULTIPLE 0x0002
+/** Device needs to be unbound even if no module is provided */
+#define RTE_PCI_DRV_FORCE_UNBIND 0x0004
/**
* 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 882fd6f..1d087b8 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -745,6 +745,11 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *d
/* map the NIC resources */
if (pci_uio_map_resource(dev) < 0)
return -1;
+ } else if (dr->drv_flags & RTE_PCI_DRV_FORCE_UNBIND &&
+ rte_eal_process_type() == RTE_PROC_PRIMARY) {
+ /* unbind current driver, bind ours */
+ if (pci_unbind_kernel_driver(dev) < 0)
+ return -1;
}
/* reference driver structure */
--
1.7.2.5
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH 2/2] eal: load libraries before creating threads
2013-07-10 13:14 [dpdk-dev] [PATCH 0/2] *** SUBJECT HERE *** Damien Millescamps
2013-07-10 13:14 ` [dpdk-dev] [PATCH 1/2] eal: add flag to force unbind device Damien Millescamps
@ 2013-07-10 13:14 ` Damien Millescamps
2013-07-10 15:52 ` Thomas Monjalon
1 sibling, 1 reply; 5+ messages in thread
From: Damien Millescamps @ 2013-07-10 13:14 UTC (permalink / raw)
To: dev
We want the threads to inherit any property that could be set while
loading a plugin, such as iopl().
Signed-off-by: Damien Millescamps <damien.millescamps@6wind.com>
---
lib/librte_eal/linuxapp/eal/eal.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index 8ef5671..8cb3f69 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -687,6 +687,18 @@ rte_eal_init(int argc, char **argv)
if (rte_eal_pci_init() < 0)
rte_panic("Cannot init PCI\n");
+ TAILQ_FOREACH(solib, &solib_list, next) {
+ solib->lib_handle = dlopen(solib->name, RTLD_NOW);
+ if ((solib->lib_handle == NULL) && (solib->name[0] != '/')) {
+ /* relative path: try again with "./" prefix */
+ char sopath[PATH_MAX];
+ snprintf(sopath, sizeof(sopath), "./%s", solib->name);
+ solib->lib_handle = dlopen(sopath, RTLD_NOW);
+ }
+ if (solib->lib_handle == NULL)
+ RTE_LOG(WARNING, EAL, "%s\n", dlerror());
+ }
+
RTE_LOG(DEBUG, EAL, "Master core %u is ready (tid=%x)\n",
rte_config.master_lcore, (int)thread_id);
@@ -712,18 +724,6 @@ rte_eal_init(int argc, char **argv)
eal_thread_init_master(rte_config.master_lcore);
- TAILQ_FOREACH(solib, &solib_list, next) {
- solib->lib_handle = dlopen(solib->name, RTLD_NOW);
- if ((solib->lib_handle == NULL) && (solib->name[0] != '/')) {
- /* relative path: try again with "./" prefix */
- char sopath[PATH_MAX];
- snprintf(sopath, sizeof(sopath), "./%s", solib->name);
- solib->lib_handle = dlopen(sopath, RTLD_NOW);
- }
- if (solib->lib_handle == NULL)
- RTE_LOG(WARNING, EAL, "%s\n", dlerror());
- }
-
return fctret;
}
--
1.7.2.5
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH 1/2] eal: add flag to force unbind device
2013-07-10 13:14 ` [dpdk-dev] [PATCH 1/2] eal: add flag to force unbind device Damien Millescamps
@ 2013-07-10 15:52 ` Thomas Monjalon
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2013-07-10 15:52 UTC (permalink / raw)
To: Damien Millescamps; +Cc: dev
10/07/2013 15:14, Damien Millescamps :
> Some devices need to be unbound in order to be used via the PMD
> without kernel module.
>
> Signed-off-by: Damien Millescamps <damien.millescamps@6wind.com>
> ---
acked and applied
--
Thomas
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH 2/2] eal: load libraries before creating threads
2013-07-10 13:14 ` [dpdk-dev] [PATCH 2/2] eal: load libraries before creating threads Damien Millescamps
@ 2013-07-10 15:52 ` Thomas Monjalon
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2013-07-10 15:52 UTC (permalink / raw)
To: Damien Millescamps; +Cc: dev
10/07/2013 15:14, Damien Millescamps :
> We want the threads to inherit any property that could be set while
> loading a plugin, such as iopl().
>
> Signed-off-by: Damien Millescamps <damien.millescamps@6wind.com>
> ---
acked and applied
--
Thomas
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-07-10 15:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-10 13:14 [dpdk-dev] [PATCH 0/2] *** SUBJECT HERE *** Damien Millescamps
2013-07-10 13:14 ` [dpdk-dev] [PATCH 1/2] eal: add flag to force unbind device Damien Millescamps
2013-07-10 15:52 ` Thomas Monjalon
2013-07-10 13:14 ` [dpdk-dev] [PATCH 2/2] eal: load libraries before creating threads Damien Millescamps
2013-07-10 15:52 ` Thomas Monjalon
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).