luigirizzo / netmap

Automatically exported from code.google.com/p/netmap
BSD 2-Clause "Simplified" License
1.86k stars 537 forks source link

Zero copy for RX unordered packets #598

Open YungCRC opened 5 years ago

YungCRC commented 5 years ago

Is it possible for packets on RX to be placed inside buffers in a different order than initially positioned in the ring? I'm interested in adding support for a non-Intel NIC that uses buffer pools for copying packets to memory. Due to the nature of these pools, I can't guarantee the order that the buffers will be used in. Can the buffer pointers in the ring be overwritten by the driver with new values?

giuseppelettieri commented 5 years ago

Yes, it is possible. It is not written anywhere, but the driver should set the NS_BUF_CHANGED flag in the slot when it changes the buf_idx field, to notify userspace. Currently it is done by zero-copy monitors and while handling the NS_FORWARD flag.