[dpdk-dev] [PATCH v4 7/7] net/ark: Arkville PMD component integration

Ferruh Yigit ferruh.yigit at intel.com
Thu Mar 23 13:13:00 CET 2017


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 <shepard.siegel at atomicrules.com>
> Signed-off-by: John Miller <john.miller at atomicrules.com>
> Signed-off-by: Ed Czeck <ed.czeck at atomicrules.com>

<...>

>  
>  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");

<...>



More information about the dev mailing list