From owner-svn-src-all@freebsd.org Wed Jun 10 19:58:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FB1333DBF4; Wed, 10 Jun 2020 19:58:04 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49hyTS11K1z4Tml; Wed, 10 Jun 2020 19:58:04 +0000 (UTC) (envelope-from vmaffione@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E100C2C4; Wed, 10 Jun 2020 19:58:04 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05AJw3Dp025698; Wed, 10 Jun 2020 19:58:03 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05AJw3mj025697; Wed, 10 Jun 2020 19:58:03 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202006101958.05AJw3mj025697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 10 Jun 2020 19:58:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362020 - stable/12/sys/dev/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/sys/dev/netmap X-SVN-Commit-Revision: 362020 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2020 19:58:04 -0000 Author: vmaffione Date: Wed Jun 10 19:58:03 2020 New Revision: 362020 URL: https://svnweb.freebsd.org/changeset/base/362020 Log: MFC r361698 netmap: if_vtnet: avoid netmap ring wraparound netmap assumes the one "slot" is left unused to distinguish the empty ring and full ring conditions. This assumption was violated by vtnet_netmap_rxq_populate(). Modified: stable/12/sys/dev/netmap/if_vtnet_netmap.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/netmap/if_vtnet_netmap.h ============================================================================== --- stable/12/sys/dev/netmap/if_vtnet_netmap.h Wed Jun 10 19:57:10 2020 (r362019) +++ stable/12/sys/dev/netmap/if_vtnet_netmap.h Wed Jun 10 19:58:03 2020 (r362020) @@ -275,8 +275,8 @@ vtnet_netmap_rxq_populate(struct vtnet_rxq *rxq) /* Expose all the RX netmap buffers we can. In case of no indirect * buffers, the number of netmap slots in the RX ring matches the * maximum number of 2-elements sglist that the RX virtqueue can - * accommodate. */ - error = vtnet_netmap_kring_refill(kring, na->num_rx_desc); + * accommodate (minus 1 to avoid netmap ring wraparound). */ + error = vtnet_netmap_kring_refill(kring, na->num_rx_desc - 1); virtqueue_notify(rxq->vtnrx_vq); return error < 0 ? ENXIO : 0;