From kernel to user space (DMA)

Recently, I read a lot of websites, as well as books on 10 Gb / s network adapters, their DMA and how the Linux kernel processes data (10/100 Mb / s NIC), and a few questions came to my mind.

What will be the easiest way to send a data stream from a 10 GB / s network card to a user site (I assume that I can process data on the user's land at the same speed).

AND

Do you think that it would be nice to implement the DMA buffer inside the user space in order to read the source data directly from there (and process them, obviously, at the same speed).

or these are their best decisions that I did not think about: /

Thanks.

+7
source share
3 answers

The easiest way to use regular Linux sockets. It may not be the most effective, but it is the easiest.

There are frameworks that allow you to very efficiently receive and transmit data in user space. They map the same buffers to the NIC (DMA) and the process, so the data does not need to be copied.
This framework completely bypasses the kernel - you must interact directly with network adapters. Such structures are, for example, PF-RING and Netmap.

+6
source

I would also suggest taking a look at the PFQ structure ( https://github.com/pfq/PFQ and http://netgroup.iet.unipi.it/software/pfq/ ), which are built on top of the concepts of netmap and pf_ring and hide them. to provide simple multi-core packet processing in user space.

+2
source

I remember hearing some people at Intel talk at the Ottawa Linux symposium that did exactly what you suggested. When they measured the results compared to the regular socket interface, they were surprised to find that for many workloads this approach did not improve and was no worse (!), And then the socket interface.

I searched, but could not find the exact paper right now, but maybe this gives you a hint ...

0
source

All Articles