[PATCH] ethdev: remove callback checks from fast path

Morten Brørup mb at smartsharesystems.com
Wed Apr 30 09:26:51 CEST 2025


> From: Sunil Kumar Kori <skori at marvell.com>
> Sent: Tuesday, 29 April 2025 20.12
> 
> rte_eth_fp_ops contains ops for fast path APIs. Each API
> validates availability of callback and then invoke it.
> 
> Removing these NULL checks instead using dummy callbacks.

The description should mention the motivation for this patch: mbuf recycling performance optimization.

A few nits below.

> +RTE_EXPORT_INTERNAL_SYMBOL(rte_eth_rx_queue_count_dummy)
> +uint32_t
> +rte_eth_rx_queue_count_dummy(void *queue __rte_unused)
> +{
> +	return -ENOTSUP;
> +}

Instead of type casting back and forth, change the type of the RX queue count callback [1]:
-typedef uint32_t (*eth_rx_queue_count_t)(void *rxq);
+typedef int (*eth_rx_queue_count_t)(void *rxq);

So it resembles the TX queue count callback, eth_tx_queue_count_t, which already returns int.

[1]: https://elixir.bootlin.com/dpdk/v25.03/source/lib/ethdev/rte_ethdev_core.h#L48

Although my suggestion is formally an API change, I suppose changing from unsigned to signed should be acceptable.

> +RTE_EXPORT_INTERNAL_SYMBOL(rte_eth_recycle_rx_descriptors_refill_dummy
> )
> +void
> +rte_eth_recycle_rx_descriptors_refill_dummy(void *queue __rte_unused,
> +		uint16_t nb __rte_unused)
> +{
> +

This empty line looks strange. Perhaps add a comment /* No action. */ to indicate that no code is missing here.

> +}



More information about the dev mailing list