src/dpdk/drivers/net/mlx5/mlx5_txq.c
void
txq_free_elts(struct mlx5_txq_ctrl *txq_ctrl)
{
	const uint16_t elts_n = 1 << txq_ctrl->txq.elts_n;
	const uint16_t elts_m = elts_n - 1;
	uint16_t elts_head = txq_ctrl->txq.elts_head;
	uint16_t elts_tail = txq_ctrl->txq.elts_tail;
	struct rte_mbuf *(*elts)[elts_n] = &txq_ctrl->txq.elts;

	DRV_LOG(DEBUG, "port %u Tx queue %u freeing WRs",
		PORT_ID(txq_ctrl->priv), txq_ctrl->txq.idx);
	txq_ctrl->txq.elts_head = 0;
	txq_ctrl->txq.elts_tail = 0;
	txq_ctrl->txq.elts_comp = 0;

	while (elts_tail != elts_head) {
		struct rte_mbuf *elt = (*elts)[elts_tail & elts_m];

		MLX5_ASSERT(elt != NULL);
		rte_pktmbuf_free_seg(elt);
#ifdef RTE_LIBRTE_MLX5_DEBUG
		/* Poisoning. */
		memset(&(*elts)[elts_tail & elts_m],
		       0x77,
		       sizeof((*elts)[elts_tail & elts_m]));
#endif
		++elts_tail;
	}
}
/**
 * Free TX queue elements.
 *
 * @param txq_ctrl
 *   Pointer to TX queue structure.
 */
Free TX queue elements.
@param txq_ctrl
Pointer to TX queue structure.
Free TX queue elements . @param txq_ctrl Pointer to TX queue structure .
void
txq_free_elts(struct mlx5_txq_ctrl *txq_ctrl)
{
	const uint16_t elts_n = 1 << txq_ctrl->txq.elts_n;
	const uint16_t elts_m = elts_n - 1;
	uint16_t elts_head = txq_ctrl->txq.elts_head;
	uint16_t elts_tail = txq_ctrl->txq.elts_tail;
	struct rte_mbuf *(*elts)[elts_n] = &txq_ctrl->txq.elts;
	DRV_LOG(DEBUG, "port %u Tx queue %u freeing WRs",
		PORT_ID(txq_ctrl->priv), txq_ctrl->txq.idx);
	txq_ctrl->txq.elts_head = 0;
	txq_ctrl->txq.elts_tail = 0;
	txq_ctrl->txq.elts_comp = 0;
	while (elts_tail != elts_head) {
		struct rte_mbuf *elt = (*elts)[elts_tail & elts_m];
		MLX5_ASSERT(elt != NULL);
		rte_pktmbuf_free_seg(elt);
#ifdef RTE_LIBRTE_MLX5_DEBUG
		memset(&(*elts)[elts_tail & elts_m],
		       0x77,
		       sizeof((*elts)[elts_tail & elts_m]));
#endif
		++elts_tail;
	}
}
void txq_free_elts ( struct mlx5_txq_ctrl * txq_ctrl ) { const uint16_t elts_n = 1 << txq_ctrl -> txq . elts_n ; const uint16_t elts_m = elts_n - 1 ; uint16_t elts_head = txq_ctrl -> txq . elts_head ; uint16_t elts_tail = txq_ctrl -> txq . elts_tail ; struct rte_mbuf * ( * elts ) [ elts_n ] = & txq_ctrl -> txq . elts ; DRV_LOG ( DEBUG , " " , PORT_ID ( txq_ctrl -> priv ) , txq_ctrl -> txq . idx ) ; txq_ctrl -> txq . elts_head = 0 ; txq_ctrl -> txq . elts_tail = 0 ; txq_ctrl -> txq . elts_comp = 0 ; while ( elts_tail != elts_head ) { struct rte_mbuf * elt = ( * elts ) [ elts_tail & elts_m ] ; MLX5_ASSERT ( elt != NULL ) ; rte_pktmbuf_free_seg ( elt ) ; #ifdef RTE_LIBRTE_MLX5_DEBUG memset ( & ( * elts ) [ elts_tail & elts_m ] , 0x77 , sizeof ( ( * elts ) [ elts_tail & elts_m ] ) ) ; #endif ++ elts_tail ; } }
Free TX queue elements.
Free TX queue elements .
/* Poisoning. */