Skip to contentSkip to conversation

*** SUBJECT HERE ***

PATCH In review Damien Millescamps 2 participants 5 messages Jul 10, 2013 3 messages not in the archive

lore
Share & tools
lore
#0 lore raw

cover *** SUBJECT HERE ***

*** 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(-)
Signature · 1 line
1.7.2.5

A message that is not in the archive (sent off-list or not yet received): cover.1373462050.git.damien.millescamps-pdR9zngts4EAvxtiuMwx3w@public.gmane.org

#2 lore raw

PATCH 1/2 eal: add flag to force unbind device

Some devices need to be unbound in order to be used via the PMD without kernel module.

---
 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(-)
lib/librte_eal/common/include/rte_pci.h +2 -0
index c3937f0..6582c25 100644
@@ -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.
lib/librte_eal/linuxapp/eal/eal_pci.c +5 -0
index 882fd6f..1d087b8 100644
@@ -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 */
Signature · 1 line
1.7.2.5

A message that is not in the archive (sent off-list or not yet received): 0f890bf9b880233a2af4844f78ccef07c5018c98.1373462050.git.damien.millescamps-pdR9zngts4EAvxtiuMwx3w@public.gmane.org

#4 lore raw

Re: [PATCH 1/2] eal: add flag to force unbind device

10/07/2013 15:14, Damien Millescamps :

Quoted 5 lines

Some devices need to be unbound in order to be used via the PMD without kernel module.

---

acked and applied

Signature · 1 line
Thomas
#5 lore raw

PATCH 2/2 eal: load libraries before creating threads

In reply to a message not in the archive

We want the threads to inherit any property that could be set while loading a plugin, such as iopl().

---
 lib/librte_eal/linuxapp/eal/eal.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)
lib/librte_eal/linuxapp/eal/eal.c +12 -12
index 8ef5671..8cb3f69 100644
@@ -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;
 }
 
Signature · 1 line
1.7.2.5

A message that is not in the archive (sent off-list or not yet received): 3acd665fb53a7624607fc863fa400b448e2bd590.1373462050.git.damien.millescamps-pdR9zngts4EAvxtiuMwx3w@public.gmane.org

#7 lore raw

Re: [PATCH 2/2] eal: load libraries before creating threads

10/07/2013 15:14, Damien Millescamps :

Quoted 5 lines

We want the threads to inherit any property that could be set while loading a plugin, such as iopl().

---

acked and applied

Signature · 1 line
Thomas