Date: Fri, 1 Apr 2016 08:18:05 -0700 From: "Lundberg, Johannes" <johannes@brilliantservice.co.jp> To: Luigi Rizzo <rizzo@iet.unipi.it> Cc: Hans Petter Selasky <hp@selasky.org>, "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org> Subject: Re: Zero copy data transfer from Linuxulator to FreeBSD? Message-ID: <CAASDrV=x8NrnXJFf%2BXEMH8ikO6c1ANbpvzb-2qVnOMuHpqyjkA@mail.gmail.com> In-Reply-To: <CA%2BhQ2%2Bh2VMVFm-wCECt2VUdZFYaAvBVYTmM89zGLsRVeO-=qnA@mail.gmail.com> References: <CAASDrVncEFU1tXxjEf3PuNSb8uLMbj_dZw9CbH1_79hk79TDDQ@mail.gmail.com> <56FE2E87.9090806@selasky.org> <CAASDrVmwqdp5nFixwuyozbUbPZ7XbK2MvEvNAtZ5e3AjdCK=kg@mail.gmail.com> <CA%2BhQ2%2Bh2VMVFm-wCECt2VUdZFYaAvBVYTmM89zGLsRVeO-=qnA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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.. On Fri, Apr 1, 2016 at 8:10 AM, Luigi Rizzo <rizzo@iet.unipi.it> wrote: > > > On Fri, Apr 1, 2016 at 5:02 PM, Lundberg, Johannes < > johannes@brilliantservice.co.jp> wrote: > >> Well, I did something similar a couple of years ago where I grab raw data >> from a special infrared camera with proprietary USB driver. I sent the raw >> data to a FreeBSD process using sockets where it is processed and becomes >> the input data for the gesture recognition software API. It was kind of >> unstable due to poorly written proprietary driver so I couldn't use it >> that >> much. >> >> Now there's a new device with totally new driver and I thought I'd give it >> a try again. From my previous attempts I think I came to the conclusion >> that shm can not be used between a Linux and a native process... >> >> Raw data transfer rate is something like 100 Mbit/sec (2.4 Mbit at 45 >> fps). >> >> I think the driver allocates memory for the data and transfers it there >> from the USB device so I guess zero copy would be impossible.. At least if >> I could do it with one copy would be nice.. >> > > > With those low data rates the number of copies is completely > irrelevant > > on modern hardware. Save yourself the trouble of > unnecessary optimizations and just privilege simplicity. > > cheers > luigi > > >> Something like: >> >> USB device -> Linux driver's memory -> [IPC] -> native process >> >> >> On Fri, Apr 1, 2016 at 1:17 AM, Hans Petter Selasky <hp@selasky.org> >> wrote: >> >> > On 04/01/16 04:38, Lundberg, Johannes wrote: >> > >> >> Hi >> >> >> >> I have a USB driver that runs in Linux mode and I want to transfer >> data to >> >> a native program for processing. >> >> >> >> I think that shared memory is not possible, what are other (zero copy) >> >> options? >> >> >> >> Thanks! >> >> >> >> >> > Can you explain a bit how the current program moves data around? >> > >> > --HPS >> > >> >> -- >> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- >> 秘密保持について:この電子メールは、名宛人に送信したものであり、秘匿特権の対象となる情報を含んでいます。 >> もし、名宛人以外の方が受信された場合、このメールの破棄、およびこのメールに関する一切の開示、 >> 複写、配布、その他の利用、または記載内容に基づくいかなる行動もされないようお願い申し上げます。 >> --- >> CONFIDENTIALITY NOTE: The information in this email is confidential >> and intended solely for the addressee. >> Disclosure, copying, distribution or any other action of use of this >> email by person other than intended recipient, is prohibited. >> If you are not the intended recipient and have received this email in >> error, please destroy the original message. >> _______________________________________________ >> freebsd-hackers@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org >> " > > > > > -- > -----------------------------------------+------------------------------- > Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. dell'Informazione > http://www.iet.unipi.it/~luigi/ . Universita` di Pisa > TEL +39-050-2217533 . via Diotisalvi 2 > Mobile +39-338-6809875 . 56122 PISA (Italy) > -----------------------------------------+------------------------------- > -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 秘密保持について:この電子メールは、名宛人に送信したものであり、秘匿特権の対象となる情報を含んでいます。 もし、名宛人以外の方が受信された場合、このメールの破棄、およびこのメールに関する一切の開示、 複写、配布、その他の利用、または記載内容に基づくいかなる行動もされないようお願い申し上げます。 --- CONFIDENTIALITY NOTE: The information in this email is confidential and intended solely for the addressee. Disclosure, copying, distribution or any other action of use of this email by person other than intended recipient, is prohibited. If you are not the intended recipient and have received this email in error, please destroy the original message. & ޭy$z盱+Zמ7ӭפ^=a ޭy$z盱+7y~naiɚY+/~nh^qyiy&Wyv M54nxN[ff߭盱+,+a#>'zOy @xy$z&j)fj|y-@y}:M4Dz{ޖ^~&֯b ryǢ_j)bLv٨( ^rj)bLv٨( ^r>N8M\ӝj"Jv+ar*azqH K]# ]]n+l XЍkif&".z ^"{^wamzN)Wyv>-~,pDHJ'w C^4E zZ)y7Z'elf&Eo)Xj (Wl"L[(=ӯbE-5^NJ('j۫z
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAASDrV=x8NrnXJFf%2BXEMH8ikO6c1ANbpvzb-2qVnOMuHpqyjkA>
