Thread (65 messages) 65 messages, 4 authors, 2017-04-07

Re: [PATCH v4 7/7] net/ark: Arkville PMD component integration

From: Ferruh Yigit <hidden>
Date: 2017-03-23 12:13:05

On 3/23/2017 1:03 AM, Ed Czeck wrote:
* Flesh out device configuration
* Add links dev_ops
* allow dynamic extension loading

Signed-off-by: Shepard Siegel <redacted>
Signed-off-by: John Miller <redacted>
Signed-off-by: Ed Czeck <redacted>
<...>
quoted hunk ↗ jump to hunk
 
 int
@@ -129,8 +182,86 @@ static void eth_ark_dev_info_get(struct rte_eth_dev *dev,
 	return -1;
 }
 
+static
+int
Can be in same line.
+check_for_ext(struct rte_eth_dev *dev __rte_unused,
+	      struct ark_adapter *ark __rte_unused)
__rte_unused can go away
+{
+	int found = 0;
+
+	/* Get the env */
+	const char *dllpath = getenv("ARK_EXT_PATH");
+
+	if (dllpath == NULL) {
+		ARK_DEBUG_TRACE("ARK EXT NO dll path specified\n");
+		return 0;
+	}
+	ARK_DEBUG_TRACE("ARK EXT found dll path at %s\n", dllpath);
+
+	/* Open and load the .so */
+	ark->d_handle = dlopen(dllpath, RTLD_LOCAL | RTLD_LAZY);
+	if (ark->d_handle == NULL)
+		PMD_DRV_LOG(ERR, "Could not load user extension %s\n", dllpath);
+	else
+		ARK_DEBUG_TRACE("SUCCESS: loaded user extension %s\n", dllpath);
Hi Ed,

Can you give some more details on "user extension" that loaded dynamically?

How much the driver depends on it, what happens if the library is missing?

And how do you deliver that shared library?


+
+	/* Get the entry points */
+	ark->user_ext.dev_init =
+		(void *(*)(struct rte_eth_dev *, void *, int))
+		dlsym(ark->d_handle, "dev_init");
+	ARK_DEBUG_TRACE("device ext init pointer = %p\n",
+			ark->user_ext.dev_init);
+	ark->user_ext.dev_get_port_count =
+		(int (*)(struct rte_eth_dev *, void *))
+		dlsym(ark->d_handle, "dev_get_port_count");
<...>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help