From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 04:27:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 30900A89; Tue, 18 Feb 2014 04:27:42 +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 0249A1912; Tue, 18 Feb 2014 04:27:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1I4RfO2024876; Tue, 18 Feb 2014 04:27:41 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1I4RfiZ024875; Tue, 18 Feb 2014 04:27:41 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201402180427.s1I4RfiZ024875@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 18 Feb 2014 04:27:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262149 - 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: Tue, 18 Feb 2014 04:27:42 -0000 Author: luigi Date: Tue Feb 18 04:27:41 2014 New Revision: 262149 URL: http://svnweb.freebsd.org/changeset/base/262149 Log: two small changes: - intercept FIONBIO and FIOASYNC ioctls on netmap file descriptors. libpcap calls them to set non blocking I/O on the file descriptor, for netmap this is a no-op because there is no read/write, but not intercepting would cause fcntl() to return -1 - rate limit and put under netmap.verbose some messages that occur when threads use concurrently the same file descriptor. Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Tue Feb 18 03:42:49 2014 (r262148) +++ head/sys/dev/netmap/netmap.c Tue Feb 18 04:27:41 2014 (r262149) @@ -137,6 +137,7 @@ ports attached to the switch) #include /* defines used in kernel.h */ #include /* types used in module initialization */ #include /* cdevsw struct, UID, GID */ +#include /* FIONBIO */ #include #include /* struct socket */ #include @@ -1827,6 +1828,11 @@ netmap_ioctl(struct cdev *dev, u_long cm break; #ifdef __FreeBSD__ + case FIONBIO: + case FIOASYNC: + ND("FIONBIO/FIOASYNC are no-ops"); + break; + case BIOCIMMEDIATE: case BIOCGHDRCMPLT: case BIOCSHDRCMPLT: @@ -2002,7 +2008,9 @@ flush_tx: continue; /* only one thread does txsync */ if (nm_kr_tryget(kring)) { - D("%p lost race on txring %d, ok", priv, i); + if (netmap_verbose) + RD(2, "%p lost race on txring %d, ok", + priv, i); continue; } if (nm_txsync_prologue(kring) >= kring->nkr_num_slots) { @@ -2049,7 +2057,9 @@ do_retry_rx: kring = &na->rx_rings[i]; if (nm_kr_tryget(kring)) { - D("%p lost race on rxring %d, ok", priv, i); + if (netmap_verbose) + RD(2, "%p lost race on rxring %d, ok", + priv, i); continue; }