Zero copy data transfer from Linuxulator to FreeBSD?
Lundberg, Johannes
johannes at brilliantservice.co.jp
Fri Apr 1 15:18:22 UTC 2016
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 at iet.unipi.it> wrote:
>
>
> On Fri, Apr 1, 2016 at 5:02 PM, Lundberg, Johannes <
> johannes at 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 at 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 at freebsd.org mailing list
>> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
>> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org
>> "
>
>
>
>
> --
> -----------------------------------------+-------------------------------
> Prof. Luigi RIZZO, rizzo at 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.
More information about the freebsd-hackers
mailing list