From owner-svn-src-head@FreeBSD.ORG Tue Nov 5 00:56:08 2013 Return-Path: Delivered-To: svn-src-head@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 ESMTP id 3EB30DAE; Tue, 5 Nov 2013 00:56:08 +0000 (UTC) (envelope-from luigi@FreeBSD.org) 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 2AD352FDE; Tue, 5 Nov 2013 00:56:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA50u8xv018964; Tue, 5 Nov 2013 00:56:08 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA50u8v7018963; Tue, 5 Nov 2013 00:56:08 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201311050056.rA50u8v7018963@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 5 Nov 2013 00:56:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257665 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 05 Nov 2013 00:56:08 -0000 Author: luigi Date: Tue Nov 5 00:56:07 2013 New Revision: 257665 URL: http://svnweb.freebsd.org/changeset/base/257665 Log: fix a bug when a device has 1 tx (or rx) queue and more than one queue of a different type. Submitted by: Vincenzo Maffione MFC after: 3 days Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Tue Nov 5 00:50:59 2013 (r257664) +++ head/sys/dev/netmap/netmap.c Tue Nov 5 00:56:07 2013 (r257665) @@ -2684,7 +2684,7 @@ netmap_poll(struct cdev *dev, int events struct netmap_adapter *na; struct ifnet *ifp; struct netmap_kring *kring; - u_int i, check_all, want_tx, want_rx, revents = 0; + u_int i, check_all_tx, check_all_rx, want_tx, want_rx, revents = 0; u_int lim_tx, lim_rx, host_forwarded = 0; struct mbq q = { NULL, NULL, 0 }; void *pwait = dev; /* linux compatibility */ @@ -2759,7 +2759,8 @@ netmap_poll(struct cdev *dev, int events * there are pending packets to send. The latter can be disabled * passing NETMAP_NO_TX_POLL in the NIOCREG call. */ - check_all = (priv->np_qlast == NETMAP_HW_RING) && (lim_tx > 1 || lim_rx > 1); + check_all_tx = (priv->np_qlast == NETMAP_HW_RING) && (lim_tx > 1); + check_all_rx = (priv->np_qlast == NETMAP_HW_RING) && (lim_rx > 1); if (priv->np_qlast != NETMAP_HW_RING) { lim_tx = lim_rx = priv->np_qlast; @@ -2833,7 +2834,7 @@ flush_tx: nm_kr_put(kring); } if (want_tx && retry_tx) { - selrecord(td, check_all ? + selrecord(td, check_all_tx ? &na->tx_si : &na->tx_rings[priv->np_qfirst].si); retry_tx = 0; goto flush_tx; @@ -2879,7 +2880,7 @@ do_retry_rx: } if (retry_rx) { retry_rx = 0; - selrecord(td, check_all ? + selrecord(td, check_all_rx ? &na->rx_si : &na->rx_rings[priv->np_qfirst].si); goto do_retry_rx; }