From owner-svn-src-head@freebsd.org Thu Mar 10 05:45:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70E72ACA751; Thu, 10 Mar 2016 05:45:25 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4198BE0B; Thu, 10 Mar 2016 05:45:25 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2A5jO3K022077; Thu, 10 Mar 2016 05:45:24 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2A5jOwv022076; Thu, 10 Mar 2016 05:45:24 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201603100545.u2A5jOwv022076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 10 Mar 2016 05:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296602 - head/sys/dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Mar 2016 05:45:25 -0000 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);