From owner-freebsd-hackers@FreeBSD.ORG Mon Jun 21 08:51:08 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D2AF816A4DC for ; Mon, 21 Jun 2004 08:51:08 +0000 (GMT) Received: from oasis.uptsoft.com (oasis.uptsoft.com [217.20.165.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id DA5FE43D45 for ; Mon, 21 Jun 2004 08:51:07 +0000 (GMT) (envelope-from devnull@oasis.uptsoft.com) Received: (from devnull@localhost) by oasis.uptsoft.com (8.11.6/linuxconf) id i5L8p6b09359 for freebsd-hackers@freebsd.org; Mon, 21 Jun 2004 11:51:06 +0300 Date: Mon, 21 Jun 2004 11:51:06 +0300 From: Sergey Lyubka To: freebsd-hackers@freebsd.org Message-ID: <20040621115106.A7011@oasis.uptsoft.com> Mail-Followup-To: freebsd-hackers@freebsd.org References: <20040616173848.A8939@oasis.uptsoft.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20040616173848.A8939@oasis.uptsoft.com>; from devnull@uptsoft.com on Wed, Jun 16, 2004 at 05:38:48PM +0300 X-OS: FreeBSD 4.5-STABLE Subject: Re: memory mapped packet capturing - bpf replacement ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2004 08:51:09 -0000 Discussion on -current, "read vs mmap", explained this. If userland process does pre-fault allocated memory, ng_mmq appears to be considerably faster than pcap: # ./benchmark rl0 /dev/mmq15 20000 desc rcvd dropped seen totlen pps time (sec) mmq 76865 0 20000 1196617 17231 4.461 pcap 73337 37199 20000 1200000 16527 4.438 I will do more tests though. Question to the netgraph hackers. ng_mmq acts like ng_hole, i.e. it discards all mbufs passed to it. If I connect it directly to ng_ether, the network stack stops working. The question is - how to make it `transparent', so event the "lower" hook is connected, mbufs are still passed to upper network stack layers ? Is it possible without additional copies like ng_tee/ng_hub do ? -sergey