Awesome, this was what I was looking for!

Regards,
Victor

On Fri, Aug 17, 2018 at 4:39 PM Vincenzo Maffione <v.maffi...@gmail.com>
wrote:

> Hi,
>   What you want to do is definitely possible using the "host rings", aka
> "sw rings".
> The idea is that netmap intercepts all the packets arriving from the NIC
> RX "hardware" ring(s). Your netmap program should then look at the packets
> and decide which ones should be forwarded to the host kernel (e.g. to
> sockets), and which ones are instead to be processed by your netmap program.
> All the packets to be forwarded to the host kernel can be transmitted to
> the "host TX ring". The host TX ring is a special ring that simply injects
> packets into the kernel.
>
> A similar thing happens for the egress side. Netmap intercepts all the
> packets that the host kernel tries to transmit on eth0. Those packets will
> show up in the "host RX ring", which is again a special ring. Your netmap
> program can then process those, for instance simply forwarding them to the
> hardware TX ring(s), so that they exit the eth0 interface.
>
> On a NIC with just 1 RX/TX hardware ring, you basically have 4 netmap
> rings. TX0 and RX0 are the hardware rings for transmission and reception.
> TX1 and RX1 are host rings, as explained above.
>
> I highly recommend to have a look at the netmap tutorial here
> https://github.com/netmap-unipi/netmap-tutorial
> Host rings are explained there. There is also a codelab with examples and
> solutions you can play with to learn the netmap API.
> From the netmap API point of view, host rings are not different from
> hardware rings.
> Also having a look at the netmap man page can help.
> Remember to disable the NIC offloadings like checksumming and TSO or
> things won't work.
>
> Cheers,
>   Vincenzo
>
> Il giorno ven 17 ago 2018 alle ore 11:33 VO Ipfix <ipfix5...@gmail.com>
> ha scritto:
>
>> Hello there, I would like to use netmap with pptk (emulated driver) to
>> generate send traffic from an interface, but still allow rx/tx to get to
>> the the kernel so that other user-space networking processes function as
>> normal. Currently, if I open an interface eg netmap:eth0, other user space
>> processes are unable to perform any networking via sockets. How could I go
>> about solving this?
>>
>> Thanks,
>> Victor
>> _______________________________________________
>> freebsd-net@freebsd.org mailing list
>> https://lists.freebsd.org/mailman/listinfo/freebsd-net
>> To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"
>>
>
>
> --
> Vincenzo
>
_______________________________________________
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to