src/dpdk/drivers/net/nfp/nfp_net.c
int
nfp_net_tx_free_bufs(struct nfp_net_txq *txq)
{
	uint32_t qcp_rd_p;
	int todo;

	PMD_TX_LOG(DEBUG, "queue %u. Check for descriptor with a complete"
		   " status", txq->qidx);

	/* Work out how many packets have been sent */
	qcp_rd_p = nfp_qcp_read(txq->qcp_q, NFP_QCP_READ_PTR);

	if (qcp_rd_p == txq->rd_p) {
		PMD_TX_LOG(DEBUG, "queue %u: It seems harrier is not sending "
			   "packets (%u, %u)", txq->qidx,
			   qcp_rd_p, txq->rd_p);
		return 0;
	}

	if (qcp_rd_p > txq->rd_p)
		todo = qcp_rd_p - txq->rd_p;
	else
		todo = qcp_rd_p + txq->tx_count - txq->rd_p;

	PMD_TX_LOG(DEBUG, "qcp_rd_p %u, txq->rd_p: %u, qcp->rd_p: %u",
		   qcp_rd_p, txq->rd_p, txq->rd_p);

	if (todo == 0)
		return todo;

	txq->rd_p += todo;
	if (unlikely(txq->rd_p >= txq->tx_count))
		txq->rd_p -= txq->tx_count;

	return todo;
}
/*
 * nfp_net_tx_free_bufs - Check for descriptors with a complete
 * status
 * @txq: TX queue to work with
 * Returns number of descriptors freed
 */
Check for descriptors with a complete
status
@txq: TX queue to work with
Returns number of descriptors freed
Check for descriptors with a complete status @txq : TX queue to work with Returns number of descriptors freed
int
nfp_net_tx_free_bufs(struct nfp_net_txq *txq)
{
	uint32_t qcp_rd_p;
	int todo;
	PMD_TX_LOG(DEBUG, "queue %u. Check for descriptor with a complete"
		   " status", txq->qidx);
	qcp_rd_p = nfp_qcp_read(txq->qcp_q, NFP_QCP_READ_PTR);
	if (qcp_rd_p == txq->rd_p) {
		PMD_TX_LOG(DEBUG, "queue %u: It seems harrier is not sending "
			   "packets (%u, %u)", txq->qidx,
			   qcp_rd_p, txq->rd_p);
		return 0;
	}
	if (qcp_rd_p > txq->rd_p)
		todo = qcp_rd_p - txq->rd_p;
	else
		todo = qcp_rd_p + txq->tx_count - txq->rd_p;
	PMD_TX_LOG(DEBUG, "qcp_rd_p %u, txq->rd_p: %u, qcp->rd_p: %u",
		   qcp_rd_p, txq->rd_p, txq->rd_p);
	if (todo == 0)
		return todo;
	txq->rd_p += todo;
	if (unlikely(txq->rd_p >= txq->tx_count))
		txq->rd_p -= txq->tx_count;
	return todo;
}
int nfp_net_tx_free_bufs ( struct nfp_net_txq * txq ) { uint32_t qcp_rd_p ; int todo ; PMD_TX_LOG ( DEBUG , " " " " , txq -> qidx ) ; qcp_rd_p = nfp_qcp_read ( txq -> qcp_q , NFP_QCP_READ_PTR ) ; if ( qcp_rd_p == txq -> rd_p ) { PMD_TX_LOG ( DEBUG , " " " " , txq -> qidx , qcp_rd_p , txq -> rd_p ) ; return 0 ; } if ( qcp_rd_p > txq -> rd_p ) todo = qcp_rd_p - txq -> rd_p ; else todo = qcp_rd_p + txq -> tx_count - txq -> rd_p ; PMD_TX_LOG ( DEBUG , " " , qcp_rd_p , txq -> rd_p , txq -> rd_p ) ; if ( todo == 0 ) return todo ; txq -> rd_p += todo ; if ( unlikely ( txq -> rd_p >= txq -> tx_count ) ) txq -> rd_p -= txq -> tx_count ; return todo ; }
nfp_net_tx_free_bufs - Check for descriptors with a complete
 status
 @txq: TX queue to work with
 Returns number of descriptors freed
nfp_net_tx_free_bufs - Check for descriptors with a complete status @txq : TX queue to work with Returns number of descriptors freed
/* Work out how many packets have been sent */