Fix bug in VNIC causing phony number of available TX descriptors

TSO packets will signal segments TX completion in the separate CQ
descriptors. Each CQ descriptor for HW TSO will point to the same
SQ entry.
Do not invoke nicvf_put_sq_desc() for secondary segments to avoid
free_cnt corruption and eventually integer overflow that will result
in the negative free_cnt value and hence impossibility of further
transmission.

Reviewed by:   wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5535
This commit is contained in:
Zbigniew Bodek 2016-03-10 05:45:24 +00:00
parent 0196c2e86e
commit 6cac5eb749

View File

@ -722,10 +722,10 @@ nicvf_snd_pkt_handler(struct nicvf *nic, struct cmp_queue *cq,
if (mbuf != NULL) {
m_freem(mbuf);
sq->snd_buff[cqe_tx->sqe_ptr].mbuf = NULL;
nicvf_put_sq_desc(sq, hdr->subdesc_cnt + 1);
}
nicvf_check_cqe_tx_errs(nic, cq, cqe_tx);
nicvf_put_sq_desc(sq, hdr->subdesc_cnt + 1);
NICVF_TX_UNLOCK(sq);
return (0);