From owner-svn-src-all@FreeBSD.ORG Fri Jan 10 16:01: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 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51029153; Fri, 10 Jan 2014 16:01: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3D13E1799; Fri, 10 Jan 2014 16:01:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0AG1jYa073497; Fri, 10 Jan 2014 16:01:45 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0AG1jtC073496; Fri, 10 Jan 2014 16:01:45 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201401101601.s0AG1jtC073496@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 10 Jan 2014 16:01:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260516 - 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.17 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: Fri, 10 Jan 2014 16:01:45 -0000 Author: luigi Date: Fri Jan 10 16:01:44 2014 New Revision: 260516 URL: http://svnweb.freebsd.org/changeset/base/260516 Log: Fix netmap emulation when NICs attached to a VALE switch have a different number of tx and rx rings Submitted by: Vincenzo Maffione Modified: head/sys/dev/netmap/netmap_vale.c Modified: head/sys/dev/netmap/netmap_vale.c ============================================================================== --- head/sys/dev/netmap/netmap_vale.c Fri Jan 10 16:00:27 2014 (r260515) +++ head/sys/dev/netmap/netmap_vale.c Fri Jan 10 16:01:44 2014 (r260516) @@ -1835,12 +1835,15 @@ netmap_bwrap_register(struct netmap_adap hostna->up.na_lut_objtotal = na->na_lut_objtotal; } - /* cross-link the netmap rings */ - for (i = 0; i <= na->num_tx_rings; i++) { + /* cross-link the netmap rings + * The original number of rings comes from hwna, + * rx rings on one side equals tx rings on the other. + */ + for (i = 0; i <= na->num_rx_rings; i++) { hwna->tx_rings[i].nkr_num_slots = na->rx_rings[i].nkr_num_slots; hwna->tx_rings[i].ring = na->rx_rings[i].ring; } - for (i = 0; i <= na->num_rx_rings; i++) { + for (i = 0; i <= na->num_tx_rings; i++) { hwna->rx_rings[i].nkr_num_slots = na->tx_rings[i].nkr_num_slots; hwna->rx_rings[i].ring = na->tx_rings[i].ring; }