From owner-freebsd-hackers@freebsd.org Sat Apr 2 09:19:11 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8EEEB006AA for ; Sat, 2 Apr 2016 09:19:11 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (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 825621D89 for ; Sat, 2 Apr 2016 09:19:11 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id DA58A1FE023; Sat, 2 Apr 2016 11:19:08 +0200 (CEST) Subject: Re: Zero copy data transfer from Linuxulator to FreeBSD? To: "Lundberg, Johannes" , Luigi Rizzo References: <56FE2E87.9090806@selasky.org> Cc: "freebsd-hackers@freebsd.org" From: Hans Petter Selasky Message-ID: <56FF8F46.3040301@selasky.org> Date: Sat, 2 Apr 2016 11:22:14 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Apr 2016 09:19:11 -0000 On 04/01/16 17:18, Lundberg, Johannes wrote: > Hi Luigi > > Since this is an embedded device running on battery every bit counts. > However, this is kind of a temporary solution so I'm considering accepting > it.. > > At any rate, I am generally curious what mechanism there are for > transferring data between Linux and native process in FreeBSD.. > Hi, libusb has only one copy to/from userspace. libusb v1.0 and v0.1 has some allocation during operation, while libusb v2.0 API doesn't. There was an optimisation done recently about IOCTLs allocating memory for the data argument. Maybe that is what is causing the problem you saw? Refer to SYS_IOCTL_SMALL_SIZE in sys/kern/ . --HPS