[PATCH v5 13/34] net/ixgbe: decouple scalar and vec rxq free mbufs

Bruce Richardson bruce.richardson at intel.com
Mon Jun 9 12:43:45 CEST 2025


On Fri, Jun 06, 2025 at 06:08:52PM +0100, Anatoly Burakov wrote:
> Currently, vector Rx queue release mbufs function is only called from
> inside the scalar variant. Decouple them to allow both to be defined
> separately from each other, and provide a common function that picks
> between the two when necessary.
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
> ---
> 
> Notes:
>     v5:
>     - Add this commit
> 

One thought on the naming - not so sure about the "_common" suffix on the
function. Might it be better to keep the "ixgbe_rx_queue_release_mbufs"
name for the common function, and rename the scalar function to have a
"non_vec" suffix?

Either with above suggestion, or as you have it below:

Acked-by: Bruce Richardson <bruce.richardson at intel.com>


>  drivers/net/intel/ixgbe/ixgbe_rxtx.c | 21 ++++++++++++---------
>  1 file changed, 12 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/net/intel/ixgbe/ixgbe_rxtx.c b/drivers/net/intel/ixgbe/ixgbe_rxtx.c
> index fad4a01a10..ecd1f38ac5 100644
> --- a/drivers/net/intel/ixgbe/ixgbe_rxtx.c
> +++ b/drivers/net/intel/ixgbe/ixgbe_rxtx.c
> @@ -2970,12 +2970,6 @@ ixgbe_rx_queue_release_mbufs(struct ixgbe_rx_queue *rxq)
>  {
>  	unsigned i;
>  
> -	/* SSE Vector driver has a different way of releasing mbufs. */
> -	if (rxq->vector_rx) {
> -		ixgbe_rx_queue_release_mbufs_vec(rxq);
> -		return;
> -	}
> -
>  	if (rxq->sw_ring != NULL) {
>  		for (i = 0; i < rxq->nb_rx_desc; i++) {
>  			if (rxq->sw_ring[i].mbuf != NULL) {
> @@ -3002,11 +2996,20 @@ ixgbe_rx_queue_release_mbufs(struct ixgbe_rx_queue *rxq)
>  			}
>  }
>  
> +static void __rte_cold
> +ixgbe_rx_queue_release_mbufs_common(struct ixgbe_rx_queue *rxq)
> +{
> +	if (rxq->vector_rx)
> +		ixgbe_rx_queue_release_mbufs_vec(rxq);
> +	else
> +		ixgbe_rx_queue_release_mbufs(rxq);
> +}
> +
>  static void __rte_cold
>  ixgbe_rx_queue_release(struct ixgbe_rx_queue *rxq)
>  {
>  	if (rxq != NULL) {
> -		ixgbe_rx_queue_release_mbufs(rxq);
> +		ixgbe_rx_queue_release_mbufs_common(rxq);
>  		rte_free(rxq->sw_ring);
>  		rte_free(rxq->sw_sc_ring);
>  		rte_memzone_free(rxq->mz);
> @@ -3501,7 +3504,7 @@ ixgbe_dev_clear_queues(struct rte_eth_dev *dev)
>  		struct ixgbe_rx_queue *rxq = dev->data->rx_queues[i];
>  
>  		if (rxq != NULL) {
> -			ixgbe_rx_queue_release_mbufs(rxq);
> +			ixgbe_rx_queue_release_mbufs_common(rxq);
>  			ixgbe_reset_rx_queue(adapter, rxq);
>  			dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
>  		}
> @@ -5701,7 +5704,7 @@ ixgbe_dev_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)
>  
>  	rte_delay_us(RTE_IXGBE_WAIT_100_US);
>  
> -	ixgbe_rx_queue_release_mbufs(rxq);
> +	ixgbe_rx_queue_release_mbufs_common(rxq);
>  	ixgbe_reset_rx_queue(adapter, rxq);
>  	dev->data->rx_queue_state[rx_queue_id] = RTE_ETH_QUEUE_STATE_STOPPED;
>  
> -- 
> 2.47.1
> 


More information about the dev mailing list