MFC: 279144

sfxge: packet can't require more than n_dma_seg descriptors plus one

Use remaining number of DMA segment instead of maximum number in mapping
when checking space for one more TSO segment packet.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
This commit is contained in:
arybchik 2015-03-25 11:08:41 +00:00
parent 0d82d7d167
commit 8e30d2d6d2

View File

@ -1103,8 +1103,8 @@ sfxge_tx_queue_tso(struct sfxge_txq *txq, struct mbuf *mbuf,
* the remainder of the input mbuf but do not
* roll back the work we have done.
*/
if (txq->n_pend_desc >
SFXGE_TSO_MAX_DESC - (1 + SFXGE_TX_MAPPING_MAX_SEG)) {
if (txq->n_pend_desc + 1 /* header */ + n_dma_seg >
SFXGE_TSO_MAX_DESC) {
txq->tso_pdrop_too_many++;
break;
}