[dpdk-dev] [PATCH v8] eal_interrupts: add option for pending callback unregister

Thomas Monjalon thomas at monjalon.net
Sat Mar 9 01:40:35 CET 2019


Sorry for the delay in review.
I hoped someone else would review this patch.
Let's get this patch in DPDK 19.05, after doing some small changes (see below).

17/12/2018 13:30, Jakub Grajciar:
> use case: if callback is used to receive message form socket,
> and the message received is disconnect/error, this callback needs
> to be unregistered, but cannot because it is still active.
> 
> With this patch it is possible to mark the callback to be
> unregistered once the interrupt process is done with this
> interrupt source.
> 
> Signed-off-by: Jakub Grajciar <jgrajcia at cisco.com>
> ---
>  .../common/include/rte_interrupts.h           | 32 +++++++
>  lib/librte_eal/linuxapp/eal/eal_interrupts.c  | 85 ++++++++++++++++++-
>  lib/librte_eal/rte_eal_version.map            |  1 +
>  3 files changed, 116 insertions(+), 2 deletions(-)

We are missing the BSD implementation.
Please add at least a function returning -ENOTSUP.

> +/**
> + * It unregisters the callback according to the specified interrupt handle,
> + * after it's no longer acive. Failes if source is not active.

Suggested reword:
Unregister the callback according to the specified interrupt handle,
after it's no longer active. Fail if source is not active.

> + *
> + * @param intr_handle
> + *  pointer to the interrupt handle.
> + * @param cb

The parameter is cb_fn.
Please check doxygen with "make doc-api-html"

> + *  callback address.
> + * @param cb_arg
> + *  address of parameter for callback, (void *)-1 means to remove all
> + *  registered which has the same callback address.
> + * @param ucb_fn
> + *  callback to call before cb is unregistered (optional).
> + *  can be used to close fd and free cb_arg.
> + *
> + * @return
> + *  - On success, return the number of callback entities marked for remove.
> + *  - On failure, a negative value.
> + */
> +int __rte_experimental
> +rte_intr_callback_unregister_pending(const struct rte_intr_handle *intr_handle,
> +				rte_intr_callback_fn cb_fn, void *cb_arg,
> +				rte_intr_unregister_callback_fn ucb_fn);





More information about the dev mailing list