[dpdk-dev] [PATCH v2 (v20.11) 2/2] eal: improve device probing API
Gaëtan Rivet
grive at u256.net
Mon Jun 29 11:57:11 CEST 2020
On 25/06/20 10:04 +0200, Maxime Coquelin wrote:
> This patch makes rte_dev_probe() to return the
> rte_device pointer on success and NULL on error
> instead of returning 0 on success and negative
> value on error.
>
> The goal is to avoid that the calling application
> iterates the devices list afterwards to retrieve
> the pointer. Retrieving the pointer is required
> for calling rte_dev_remove() later.
>
> Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
> ---
> app/test-pmd/testpmd.c | 2 +-
> drivers/net/failsafe/failsafe.c | 5 +++--
> lib/librte_eal/common/eal_common_dev.c | 18 ++++++++++--------
> lib/librte_eal/include/rte_dev.h | 4 ++--
> 4 files changed, 16 insertions(+), 13 deletions(-)
>
[...]
> diff --git a/lib/librte_eal/include/rte_dev.h b/lib/librte_eal/include/rte_dev.h
> index c8d985fb5c..9cf7c7fd71 100644
> --- a/lib/librte_eal/include/rte_dev.h
> +++ b/lib/librte_eal/include/rte_dev.h
> @@ -148,9 +148,9 @@ int rte_eal_hotplug_add(const char *busname, const char *devname,
> * @param devargs
> * Device arguments including bus, class and driver properties.
> * @return
> - * 0 on success, negative on error.
> + * Generic device pointer on success, NULL on error.
Hello Maxime,
Do you plan on a v3 with rte_errno support in the new API or do you
prefer to keep it this way after all?
--
Gaëtan
More information about the dev
mailing list