From owner-freebsd-current@FreeBSD.ORG Thu May 29 03:30:11 2014 Return-Path: Delivered-To: freebsd-current@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 CC349C1A for ; Thu, 29 May 2014 03:30:11 +0000 (UTC) Received: from smtp.rlwinm.de (smtp.rlwinm.de [IPv6:2a01:4f8:201:31ef::e]) (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 91D8523B4 for ; Thu, 29 May 2014 03:30:11 +0000 (UTC) Received: from t420.rlwinm.de (p20030056CE17CD000224D7FFFEDE2DAC.dip0.t-ipconnect.de [IPv6:2003:56:ce17:cd00:224:d7ff:fede:2dac]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.rlwinm.de (Postfix) with ESMTPSA id 46FF71107F for ; Thu, 29 May 2014 05:30:01 +0200 (CEST) Message-ID: <5386A9B8.20908@rlwinm.de> Date: Thu, 29 May 2014 05:30:00 +0200 From: Jan Bramkamp User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: freebsd-current@freebsd.org Subject: Re: KQueue vs Select (NetMap) References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 03:30:11 -0000 On 29.05.2014 03:04, Fred Pedrisa wrote: > Hey Guys, > > > > How does kQueue performs over select with netmap ? You are asking for a comparison between apples and oranges. Netmap is an API for high performance access to the low-level features of modern NICs. It works on batches of frames in hardware queues. The kqueue() and kevent() system calls are an event notification API. It is mostly used by application dealing with a large amount of non-blocking sockets (or other file descriptors). It reduces overhead inherent in select() and poll() by preserving state between calls. It also supports multiple types of events (read ready, write ready, timer expired, async i/o, etc.). Afaik the netmap pseudo-device supports only select() and poll(). This is no performance problem because every thread will only deal with a small number of file descriptors to netmap devices. Netmap is designed to bypass the FreeBSD IP stack (for most frames). Kqueue is designed to scale to many sockets per process within the FreeBSD IP stack.