From owner-freebsd-net@FreeBSD.ORG Mon May 4 19:14:39 2015 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 887F6951 for ; Mon, 4 May 2015 19:14:39 +0000 (UTC) Received: from smtp.outgoing.loopia.se (smtp.outgoing.loopia.se [194.9.95.113]) (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 42CEF1832 for ; Mon, 4 May 2015 19:14:38 +0000 (UTC) Received: from s314.loopia.se (localhost [127.0.0.1]) by s314.loopia.se (Postfix) with ESMTP id D8CD51423AC7 for ; Mon, 4 May 2015 21:08:56 +0200 (CEST) X-Loopia-Auth: webmail X-Loopia-User: ulric@siag.nu Received: from s499.loopia.se (unknown [172.21.200.97]) by s314.loopia.se (Postfix) with ESMTP id BBDB51FFE53E; Mon, 4 May 2015 21:08:56 +0200 (CEST) Received: from s406.loopia.se (unknown [172.21.200.105]) by s499.loopia.se (Postfix) with ESMTP id B7AE4B574E6; Mon, 4 May 2015 21:08:56 +0200 (CEST) X-Virus-Scanned: amavisd-new at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1.006 X-Spam-Level: X-Spam-Status: No, score=-1.006 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, AWL=-0.006] autolearn=disabled Received: from s499.loopia.se ([172.21.200.105]) by s406.loopia.se (s406.loopia.se [172.21.200.136]) (amavisd-new, port 10024) with LMTP id ybqdfFjybEB1; Mon, 4 May 2015 21:08:56 +0200 (CEST) Received: from localhost (webmail.loopia.se [194.9.95.85]) (Authenticated sender: ulric@siag.nu) by s499.loopia.se (Postfix) with ESMTPA id 1030BB5749B; Mon, 4 May 2015 21:08:56 +0200 (CEST) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Mon, 04 May 2015 21:08:56 +0200 From: ulric@siag.nu To: Barney Cordoba Cc: Luigi Rizzo , freebsd-net@freebsd.org, owner-freebsd-net@freebsd.org Subject: Re: Fwd: netmap-ipfw on em0 em1 In-Reply-To: <1009610346.1107538.1430753353703.JavaMail.yahoo@mail.yahoo.com> References: <1009610346.1107538.1430753353703.JavaMail.yahoo@mail.yahoo.com> Message-Id: X-Sender: ulric@siag.nu User-Agent: Loopia Webmail/1.0.5 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 19:14:39 -0000 2015-05-04 17:29 skrev Barney Cordoba via freebsd-net: > It's not faster than "wedging" into the if_input()s. It simply can't > be. Your getting packets at interrupt time as soon as their processed > and  you there's no network stack involved, and your able to receive > and transmit without a process switch. At worst it's the same, without > the extra plumbing. It's not rocket science to "bypass the network > stack". > The only advantage of bringing it into user space would be that it's > easier to write threaded handlers for complex uses; but not as a > firewall (which is the limit of the context of my comment). You can do > anything in the kernel that you can do in user space. The reason a > kernel module with if_input() hooks is better is that you can use the > standard kernel without all of the netmap hacks. You can just pop it > into any kernel and it works. If my little application is N*1000 lines, the part that needs fast raw network access is N*100 lines and can get that at wirespeed with N*10 lines interfacing with Netmap, then that is IMHO an excellent proposition. I don't see how popping it into the kernel makes any sense. Ulric