[dpdk-dev] [RFC] ethdev: support Tx queue free descriptor query

Konstantin Ananyev konstantin.ananyev at huawei.com
Thu Jan 4 15:21:50 CET 2024



> > > Introduce a new API to retrieve the number of available free descriptors
> > > in a Tx queue. Applications can leverage this API in the fast path to
> > > inspect the Tx queue occupancy and take appropriate actions based on the
> > > available free descriptors.
> > >
> > > A notable use case could be implementing Random Early Discard (RED)
> > > in software based on Tx queue occupancy.
> > >
> > > Signed-off-by: Jerin Jacob <jerinj at marvell.com>
> > > ---
> > >  doc/guides/nics/features.rst         | 10 ++++
> > >  doc/guides/nics/features/default.ini |  1 +
> > >  lib/ethdev/ethdev_trace_points.c     |  3 ++
> > >  lib/ethdev/rte_ethdev.h              | 78 ++++++++++++++++++++++++++++
> > >  lib/ethdev/rte_ethdev_core.h         |  7 ++-
> > >  lib/ethdev/rte_ethdev_trace_fp.h     |  8 +++
> > >  6 files changed, 106 insertions(+), 1 deletion(-)
> >
> > Hi Jerin,
> 
> Hi Cristian,
> 
> >
> > I think having an API to get the number of free descriptors per queue is a good idea. Why have it only for TX queues and not for RX
> queues as well?
> 
> I see no harm in adding for Rx as well. I think, it is better to have
> separate API for each instead of adding argument as it is fast path
> API.
> If so, we could add a new API when there is any PMD implementation or
> need for this.

I think for RX we already have similar one:
/** @internal Get number of used descriptors on a receive queue. */
typedef uint32_t (*eth_rx_queue_count_t)(void *rxq);

 



More information about the dev mailing list