[dpdk-dev] [PATCH v1] eventdev: change packet enqueue buffer in RX adapter to circular buffer

Jerin Jacob jerinjacobk at gmail.com
Mon Aug 30 11:41:16 CEST 2021


On Fri, Aug 27, 2021 at 3:12 PM Ganapati Kundapura
<ganapati.kundapura at intel.com> wrote:
>
> RX adapter user memove() to move unprocessed events to the beginning of
> the packet enqueue buffer. The use memmove() was found to consume good
> amount of CPU cycles (about 20%).
>
> This patch removes the use of memove() while implementina a circular

Typo

> buffer to avoid copying of data. With this change RX adapter is able
> to fill the buffer of 16384 events.


Please change the subject to :
eventdev: rx-adapter: improve ...

>
> Signed-off-by: Ganapati Kundapura <ganapati.kundapura at intel.com>
> ---
>  lib/eventdev/rte_event_eth_rx_adapter.c | 84 ++++++++++++++++++++++++++-------
>  1 file changed, 68 insertions(+), 16 deletions(-)
>

>         } else {
>                 num = rxa_create_event_vector(rx_adapter, eth_rx_queue_info,
> @@ -892,9 +918,14 @@ rxa_buffer_mbufs(struct rte_event_eth_rx_adapter *rx_adapter,
>
>                 dropped = 0;
>                 nb_cb = dev_info->cb_fn(eth_dev_id, rx_queue_id,
> -                                       ETH_EVENT_BUFFER_SIZE, buf->count,
> -                                       &buf->events[buf->count], num,
> -                                       dev_info->cb_arg, &dropped);
> +                                      buf->last |
> +                                      (RTE_DIM(buf->events) & ~buf->last_mask),
> +                                      buf->count >= BATCH_SIZE ?
> +                                               buf->count - BATCH_SIZE : 0,
> +                                      &buf->events[buf->tail],
> +                                      num,
> +                                      dev_info->cb_arg,
> +                                      &dropped);


Moving this code section to a separate inline function can allow more
linewidth to consume aka
less number of lines.

Rest looks good to me.


More information about the dev mailing list