From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 00:10:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78D7863E; Tue, 11 Nov 2014 00:10:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 65D22125; Tue, 11 Nov 2014 00:10:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAB0Ajbb078300; Tue, 11 Nov 2014 00:10:45 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAB0Ajqs078299; Tue, 11 Nov 2014 00:10:45 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201411110010.sAB0Ajqs078299@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Tue, 11 Nov 2014 00:10:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274361 - head/sys/dev/netmap X-SVN-Group: head 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.18-1 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: Tue, 11 Nov 2014 00:10:45 -0000 Author: luigi Date: Tue Nov 11 00:10:44 2014 New Revision: 274361 URL: https://svnweb.freebsd.org/changeset/base/274361 Log: - fix typo: use ring size from the rx ring, not the tx one (they should be the same, but just in case); - reuse the previously computed len-1 value Modified: head/sys/dev/netmap/netmap_pipe.c Modified: head/sys/dev/netmap/netmap_pipe.c ============================================================================== --- head/sys/dev/netmap/netmap_pipe.c Mon Nov 10 23:56:06 2014 (r274360) +++ head/sys/dev/netmap/netmap_pipe.c Tue Nov 11 00:10:44 2014 (r274361) @@ -197,10 +197,10 @@ netmap_pipe_txsync(struct netmap_kring * if (m < 0) m += txkring->nkr_num_slots; limit = m; - m = rxkring->nkr_num_slots - 1; /* max avail space on destination */ + m = lim_rx; /* max avail space on destination */ busy = j - rxkring->nr_hwcur; /* busy slots */ if (busy < 0) - busy += txkring->nkr_num_slots; + busy += rxkring->nkr_num_slots; m -= busy; /* subtract busy slots */ ND(2, "m %d limit %d", m, limit); if (m < limit)