[RFC PATCH 3/5] eventdev: support optional dequeue callbacks
Burakov, Anatoly
anatoly.burakov at intel.com
Wed May 17 16:22:22 CEST 2023
On 4/19/2023 10:54 AM, Sivaprasad Tummala wrote:
> Add optional support for inline event processing within dequeue call.
> For a dequeue callback, events dequeued from the event port were
> passed them to a callback function if configured, to allow
> additional processing. e.g. unpack batch of packets from each event
> on dequeue, before passing back to the application.
>
> Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala at amd.com>
> ---
Hi,
> +/**
> + * @internal
> + * Structure used to hold information about the callbacks to be called for a
> + * port on dequeue.
> + */
> +struct rte_event_dequeue_callback {
> + struct rte_event_dequeue_callback *next;
> + union{
> + rte_dequeue_callback_fn dequeue;
> + } fn;
> + void *param;
> +};
...and...
> +
> +uint16_t
> +rte_event_dequeue_callbacks(uint8_t dev_id, uint8_t port_id,
> + struct rte_event *ev, uint16_t nb_events, void *opaque)
> +{
> + static uint16_t nb_rx;
> + const struct rte_event_dequeue_callback *cb = opaque;
> +
> + while (cb != NULL) {
> + nb_rx = cb->fn.dequeue(dev_id, port_id, ev,
> + nb_events, cb->param);
> + cb = cb->next;
> + }
> + return nb_rx;
Nitpicking an RFC, but this kind of looks like reimplementation for
TAILQ functionality?
--
Thanks,
Anatoly
More information about the dev
mailing list