[dpdk-dev] [PATCH 2/3] devargs: delay freeing previous devargs when overriding them
Thomas Monjalon
thomas at monjalon.net
Mon Nov 5 08:30:31 CET 2018
Hi,
05/11/2018 08:04, Darek Stojaczyk:
> -int __rte_experimental
> -rte_devargs_insert(struct rte_devargs *da)
> +void __rte_experimental
> +rte_devargs_insert(struct rte_devargs *da, struct rte_devargs **prev_da)
You should update the API section of the release notes.
> {
> - int ret;
> + struct rte_devargs *d;
> + void *tmp;
> +
> + *prev_da = NULL;
> + TAILQ_FOREACH_SAFE(d, &devargs_list, next, tmp) {
> + if (strcmp(d->bus->name, da->bus->name) == 0 &&
> + strcmp(d->name, da->name) == 0) {
> + TAILQ_REMOVE(&devargs_list, d, next);
> + *prev_da = d;
> + break;
> + }
> + }
>
> - ret = rte_devargs_remove(da);
> - if (ret < 0)
> - return ret;
Why not updating rte_devargs_remove instead of duplicating its code?
More information about the dev
mailing list