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.sie...@atomicrules.com>
> Signed-off-by: John Miller <john.mil...@atomicrules.com>
> Signed-off-by: Ed Czeck <ed.cz...@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");

<...>

Reply via email to