0

How do you find the DMA address of the network-adapter, then is it possible to mmap that address and then read and write to it?

  • Are you writing a kernel-space device driver, or a user-space program? The answer is different depending on which it is. – zwol Dec 22 '20 at 20:14
  • 1
    You might want to look at PACKET_MMAP: https://www.kernel.org/doc/Documentation/networking/packet_mmap.txt. It might be helpful to explain what you are trying to accomplish. – JimD. Dec 22 '20 at 20:16
  • I suspect _Jim D_ is on to something. Which makes this question an XY problem: https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem What you _probably_ want to do is map the _kernel_ socket buffers into userspace to achieve some "zero copy" or "kernel bypass" That is what `PACKET_MMAP` is for. Trying to map the controller into userspace to feed it raw commands is not the way to achieve that (e.g. How would you field an interrupt?) – Craig Estey Dec 22 '20 at 20:21
  • Have you checked DPDK (https://www.dpdk.org/about/)? – 0andriy Dec 22 '20 at 22:30
  • Good point -- I've glanced at DPDK, and I've written AF_XDP, however it requires an upgraded kernel on most systems and DRV mode might not be supported -- and I suppose PACKET_MMAP is the goal then, TX wasn't working for V3, what do you think about SKB-mode AF_XDP vs PACKET_MMAP? – Tyler Curtis Jowers Dec 23 '20 at 23:27

0 Answers0