From owner-freebsd-hackers@freebsd.org Fri Apr 19 17:18:07 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C63CA1572FF9 for ; Fri, 19 Apr 2019 17:18:07 +0000 (UTC) (envelope-from wojtek@puchar.net) Received: from puchar.net (puchar.net [194.1.144.90]) (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 44382888CA; Fri, 19 Apr 2019 17:18:07 +0000 (UTC) (envelope-from wojtek@puchar.net) Received: Received: from 127.0.0.1 (localhost [127.0.0.1]) by puchar.net (8.15.2/8.15.2) with ESMTPS id x3JHI4W1053436 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 19 Apr 2019 19:18:04 +0200 (CEST) (envelope-from puchar-wojtek@puchar.net) Received: from localhost (puchar-wojtek@localhost) by puchar.net (8.15.2/8.15.2/Submit) with ESMTP id x3JHI4ji053433; Fri, 19 Apr 2019 19:18:04 +0200 (CEST) (envelope-from puchar-wojtek@puchar.net) Date: Fri, 19 Apr 2019 19:18:04 +0200 (CEST) From: Wojciech Puchar To: Kurt Lidl cc: freebsd-hackers@freebsd.org Subject: Re: openvpn and system overhead In-Reply-To: <8e238882-1779-41ed-92fd-33abf2667d18@FreeBSD.org> Message-ID: References: <0cc6e0ac-a9a6-a462-3a1e-bfccfd41e138@grosbein.net> <8e238882-1779-41ed-92fd-33abf2667d18@FreeBSD.org> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 44382888CA X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2019 17:18:07 -0000 >> from/to tun device, as well as send/recv would have multipacket version - >> it would mean speeding it up at least 4 times. > > Well, FreeBSD does have sendmmsg()/recvmmsg(), which allows for > sending/receiving multiple packets per system call. I do not know if > the "tun" device allows for send/recv type processing, or just > read/write. > i will have a look at openvpn code next weekend. tun doesn't have this but this would bit still a bit speedup. > Don't get me wrong -- having in-kernel processing, like ipsec does, is far > superior to doing it as a userland daemon, IMHO. Just pointing out Having everything in kernel isn't superior. Having low overhead system call interface would be. Sad to say but system call overhead in FreeBSD is high.