svn commit: r296602 - head/sys/dev/vnic

Zbigniew Bodek zbb at FreeBSD.org
Thu Mar 10 05:45:25 UTC 2016


Author: zbb
Date: Thu Mar 10 05:45:24 2016
New Revision: 296602
URL: https://svnweb.freebsd.org/changeset/base/296602

Log:
  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

Modified:
  head/sys/dev/vnic/nicvf_queues.c

Modified: head/sys/dev/vnic/nicvf_queues.c
==============================================================================
--- head/sys/dev/vnic/nicvf_queues.c	Thu Mar 10 05:23:46 2016	(r296601)
+++ head/sys/dev/vnic/nicvf_queues.c	Thu Mar 10 05:45:24 2016	(r296602)
@@ -722,10 +722,10 @@ nicvf_snd_pkt_handler(struct nicvf *nic,
 	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);


More information about the svn-src-head mailing list