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:
Andrew Rybchenko 2015-02-22 07:16:11 +00:00
parent 685d4bc2f2
commit 4d0b294b00
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=279144

View File

@ -1104,8 +1104,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;
}