src/dpdk/drivers/net/mlx5/mlx5_rxq.c
static void
rxq_free_elts_sprq(struct mlx5_rxq_ctrl *rxq_ctrl)
{
	struct mlx5_rxq_data *rxq = &rxq_ctrl->rxq;
	const uint16_t q_n = mlx5_rxq_mprq_enabled(&rxq_ctrl->rxq) ?
		(1 << rxq->elts_n) * (1 << rxq->strd_num_n) :
		(1 << rxq->elts_n);
	const uint16_t q_mask = q_n - 1;
	uint16_t elts_ci = mlx5_rxq_mprq_enabled(&rxq_ctrl->rxq) ?
		rxq->elts_ci : rxq->rq_ci;
	uint16_t used = q_n - (elts_ci - rxq->rq_pi);
	uint16_t i;

	DRV_LOG(DEBUG, "port %u Rx queue %u freeing %d WRs",
		PORT_ID(rxq_ctrl->priv), rxq->idx, q_n);
	if (rxq->elts == NULL)
		return;
	/**
	 * Some mbuf in the Ring belongs to the application.
	 * They cannot be freed.
	 */
	if (mlx5_rxq_check_vec_support(rxq) > 0) {
		for (i = 0; i < used; ++i)
			(*rxq->elts)[(elts_ci + i) & q_mask] = NULL;
		rxq->rq_pi = elts_ci;
	}
	for (i = 0; i != q_n; ++i) {
		if ((*rxq->elts)[i] != NULL)
			rte_pktmbuf_free_seg((*rxq->elts)[i]);
		(*rxq->elts)[i] = NULL;
	}
}
/**
 * Free RX queue elements for Single-Packet RQ.
 *
 * @param rxq_ctrl
 *   Pointer to RX queue structure.
 */
Free RX queue elements for Single-Packet RQ.
@param rxq_ctrl
Pointer to RX queue structure.
Free RX queue elements for Single - Packet RQ . @param rxq_ctrl Pointer to RX queue structure .
static void
rxq_free_elts_sprq(struct mlx5_rxq_ctrl *rxq_ctrl)
{
	struct mlx5_rxq_data *rxq = &rxq_ctrl->rxq;
	const uint16_t q_n = mlx5_rxq_mprq_enabled(&rxq_ctrl->rxq) ?
		(1 << rxq->elts_n) * (1 << rxq->strd_num_n) :
		(1 << rxq->elts_n);
	const uint16_t q_mask = q_n - 1;
	uint16_t elts_ci = mlx5_rxq_mprq_enabled(&rxq_ctrl->rxq) ?
		rxq->elts_ci : rxq->rq_ci;
	uint16_t used = q_n - (elts_ci - rxq->rq_pi);
	uint16_t i;
	DRV_LOG(DEBUG, "port %u Rx queue %u freeing %d WRs",
		PORT_ID(rxq_ctrl->priv), rxq->idx, q_n);
	if (rxq->elts == NULL)
		return;
	if (mlx5_rxq_check_vec_support(rxq) > 0) {
		for (i = 0; i < used; ++i)
			(*rxq->elts)[(elts_ci + i) & q_mask] = NULL;
		rxq->rq_pi = elts_ci;
	}
	for (i = 0; i != q_n; ++i) {
		if ((*rxq->elts)[i] != NULL)
			rte_pktmbuf_free_seg((*rxq->elts)[i]);
		(*rxq->elts)[i] = NULL;
	}
}
static void rxq_free_elts_sprq ( struct mlx5_rxq_ctrl * rxq_ctrl ) { struct mlx5_rxq_data * rxq = & rxq_ctrl -> rxq ; const uint16_t q_n = mlx5_rxq_mprq_enabled ( & rxq_ctrl -> rxq ) ? ( 1 << rxq -> elts_n ) * ( 1 << rxq -> strd_num_n ) : ( 1 << rxq -> elts_n ) ; const uint16_t q_mask = q_n - 1 ; uint16_t elts_ci = mlx5_rxq_mprq_enabled ( & rxq_ctrl -> rxq ) ? rxq -> elts_ci : rxq -> rq_ci ; uint16_t used = q_n - ( elts_ci - rxq -> rq_pi ) ; uint16_t i ; DRV_LOG ( DEBUG , " " , PORT_ID ( rxq_ctrl -> priv ) , rxq -> idx , q_n ) ; if ( rxq -> elts == NULL ) return ; if ( mlx5_rxq_check_vec_support ( rxq ) > 0 ) { for ( i = 0 ; i < used ; ++ i ) ( * rxq -> elts ) [ ( elts_ci + i ) & q_mask ] = NULL ; rxq -> rq_pi = elts_ci ; } for ( i = 0 ; i != q_n ; ++ i ) { if ( ( * rxq -> elts ) [ i ] != NULL ) rte_pktmbuf_free_seg ( ( * rxq -> elts ) [ i ] ) ; ( * rxq -> elts ) [ i ] = NULL ; } }
Free RX queue elements for Single-Packet RQ.
Free RX queue elements for Single - Packet RQ .
/**
	 * Some mbuf in the Ring belongs to the application.
	 * They cannot be freed.
	 */