/* Reclaims Tx descriptors that the SGE has indicated it has processed, and frees the associated buffers if possible. Called with the Tx queue's lock held.  */
static unsigned int reclaim_completed_tx(struct adapter *adapter, struct sge_txq *q, unsigned int chunk)
/* Reclaims Tx descriptors that the SGE has indicated it has processed, and frees the associated buffers if possible. Called with the Tx queue's lock held.  */
static unsigned int reclaim_completed_tx(struct adapter *adapter, struct sge_txq *q, unsigned int chunk)
{
	unsigned int reclaim = q->processed - q->cleaned;
	reclaim = min(chunk, reclaim);
	if (reclaim) {
		free_tx_desc(adapter, q, reclaim);
		q->cleaned += reclaim;
		q->in_use -= reclaim;
	}
	return q->processed - q->cleaned;
}