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

Kundapura, Ganapati ganapati.kundapura at intel.com
Mon Aug 30 12:25:04 CEST 2021



> -----Original Message-----
> From: Jerin Jacob <jerinjacobk at gmail.com>
> Sent: 30 August 2021 15:11
> To: Kundapura, Ganapati <ganapati.kundapura at intel.com>
> Cc: Jayatheerthan, Jay <jay.jayatheerthan at intel.com>; dpdk-dev
> <dev at dpdk.org>
> Subject: Re: [PATCH v1] eventdev: change packet enqueue buffer in RX
> adapter to circular buffer
> 
> 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
Will address in next patch
> 
> > 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 ...
Will address in next patch
> 
> >
> > 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);
These are arguments to callback function dev_info->cb_fn. Passing these to another inline function,
retrieving dev_info from rx_adapter(additional parameter to inline function) and to
call the dev_info->cb_fn from inline function which is getting called only once
seems overhead just to allow more line width.
> 
> 
> 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