From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 14:57:17 2014 Return-Path: Delivered-To: svn-src-head@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 3263876C; Fri, 6 Jun 2014 14:57:17 +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 1FDD12A39; Fri, 6 Jun 2014 14:57:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56EvHdr077199; Fri, 6 Jun 2014 14:57:17 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56EvGcj077198; Fri, 6 Jun 2014 14:57:16 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201406061457.s56EvGcj077198@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 6 Jun 2014 14:57:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267163 - 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.18 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: Fri, 06 Jun 2014 14:57:17 -0000 Author: luigi Date: Fri Jun 6 14:57:16 2014 New Revision: 267163 URL: http://svnweb.freebsd.org/changeset/base/267163 Log: remove two debugging messages, align comments with the code in our development trunk Modified: head/sys/dev/netmap/netmap_generic.c Modified: head/sys/dev/netmap/netmap_generic.c ============================================================================== --- head/sys/dev/netmap/netmap_generic.c Fri Jun 6 14:49:00 2014 (r267162) +++ head/sys/dev/netmap/netmap_generic.c Fri Jun 6 14:57:16 2014 (r267163) @@ -81,18 +81,25 @@ __FBSDID("$FreeBSD$"); #include #include -#define rtnl_lock() D("rtnl_lock called"); -#define rtnl_unlock() D("rtnl_unlock called"); +#define rtnl_lock() ND("rtnl_lock called"); +#define rtnl_unlock() ND("rtnl_unlock called"); #define MBUF_TXQ(m) ((m)->m_pkthdr.flowid) #define MBUF_RXQ(m) ((m)->m_pkthdr.flowid) #define smp_mb() /* - * mbuf wrappers + * FreeBSD mbuf allocator/deallocator in emulation mode: + * + * We allocate EXT_PACKET mbuf+clusters, but need to set M_NOFREE + * so that the destructor, if invoked, will not free the packet. + * In principle we should set the destructor only on demand, + * but since there might be a race we better do it on allocation. + * As a consequence, we also need to set the destructor or we + * would leak buffers. */ /* - * we allocate an EXT_PACKET + * mbuf wrappers */ #define netmap_get_mbuf(len) m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR|M_NOFREE) @@ -808,5 +815,5 @@ generic_netmap_attach(struct ifnet *ifp) struct netmap_adapter * netmap_getna(if_t ifp) { - return (NA((struct ifnet *)ifp)); + return (NA((struct ifnet *)ifp)); }