Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Apr 2017 11:20:07 -0400
From:      Paras Jha <dreadiscool@gmail.com>
To:        Vincenzo Maffione <v.maffione@gmail.com>
Cc:        FreeBSD Net <freebsd-net@freebsd.org>
Subject:   Re: Netmap pipe zero-copy with NIC buffer?
Message-ID:  <CAMs8r4OKYv7o0b_=eQ%2BoOeeRLg0_AG4iNB9f5qme=_GRngRvyA@mail.gmail.com>
In-Reply-To: <CA%2B_eA9ihEC6QmBsUskv8bmHkviNqQRekk2pS27zxrjba50XOYw@mail.gmail.com>
References:  <CAMs8r4O6TmHnkoMJRTKV2LZ-BejCeyvj%2BWLvc8DJAfAUWxgscQ@mail.gmail.com> <CA%2B_eA9jRKDFJnCrOyNjQFK2FXPV3E6s=D7yA0w-5k4gTBDLqqA@mail.gmail.com> <CAMs8r4M1wV4C5CCZcF=uTag8fd5cfBD6ovgabOt0VDKC6=9Qew@mail.gmail.com> <CA%2B_eA9ihEC6QmBsUskv8bmHkviNqQRekk2pS27zxrjba50XOYw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Thank you for the clarification!

On Wed, Apr 12, 2017 at 3:50 AM, Vincenzo Maffione <v.maffione@gmail.com>
wrote:

> netmap applications always bypass the kernel (network stack). There is
> only a distinction between ports opened in "native" mode and "emulated"
> mode.
> If NIC driver doesn't have native netmap support, the legacy driver is
> internally used by netmap to transmit and receive (and this is called
> "emulated mode").
> In any case (both in native and emulated mode) the netmap application sees
> netmap rings, and can zerocopy between two rings (in the same memory area)
> by simply swapping the ring slots.
>
> Of course, in emulated mode netmap internally transforms each ring slot
> into and mbuf and the other way around, possibly requiring a copy. And the
> whole thing is way slower.
> But this is unrelated to the zerocopy thing: your application isn't aware
> of the emulated or native mode and can zerocopy slots between netmap rings.
>
> Cheers,
>   Vincenzo
>
> 2017-04-12 4:04 GMT+02:00 Paras Jha <dreadiscool@gmail.com>:
>
>> Apologies, by KB I meant kernel bypass, since it is possible to open a
>> netmap port without bypassing the kernel. I didn't know if this would
>> affect it or not.
>>
>> On Sun, Apr 9, 2017 at 3:20 AM, Vincenzo Maffione <v.maffione@gmail.com>
>> wrote:
>>
>>> Hi,
>>>   Yes, when you nm_open("netmap:em3{2", ...), you're opening a netmap
>>> pipe in the same netmap memory area as the one used by
>>> nm_open("netmap:em3", ...).
>>> As a result, you can zero-copy packets from NIC rings to pipe rings.
>>>
>>> What do you mean by "KB mode"?
>>>
>>> Cheers,
>>>   Vincenzo
>>>
>>> 2017-04-08 19:56 GMT+02:00 Paras Jha <dreadiscool@gmail.com>:
>>>
>>>> Hi all,
>>>>
>>>> Is it possible to have a netmap pipe share memory with a netmap port
>>>> opened
>>>> in KB mode for zero-copy purposes?
>>>>
>>>> All the best
>>>> _______________________________________________
>>>> freebsd-net@freebsd.org mailing list
>>>> https://lists.freebsd.org/mailman/listinfo/freebsd-net
>>>> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
>>>>
>>>
>>>
>>>
>>> --
>>> Vincenzo Maffione
>>>
>>
>>
>
>
> --
> Vincenzo Maffione
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMs8r4OKYv7o0b_=eQ%2BoOeeRLg0_AG4iNB9f5qme=_GRngRvyA>