google / google/gvisor

PACKET_MMAP version 1/2 improvements

Open
#10,966 5 comments 0 reactions 0 assignees View on GitHub
area: networking type: enhancement
Dominant language
Go
Stars
19.3k
Forks
2k
Avg merge
3d 5h
Merged PRs (30d)
264

Description

### Description

The fdbased LinkEndpoint supports PACKET_MMAP, but is missing a few useful improvements:

- TX: we TX using `sendmmsg`, but should use PACKET_MMAP buffers.
- RX: the PACKET_MMAP dispatcher seems to return 1-3 packets at a time, while the recvmmsg dispatcher often returns 8. We should investigate this, as PACKET_MMAP _should_ return many packets at once and ultimately be faster than recvmmsg.

**This is specific to PACKET_MMAP TPACKET_V1 and TPACKET_V2, not V3.** V3 is unsuitable as a dispatcher because it markedly increases latency (by O(milliseconds)) in order to reduce CPU usage.

### Is this feature related to a specific bug?

No

### Do you have a specific solution in mind?

I believe we only have 32 slots (`tpFrameNR`) in the dispatcher. Could that be limiting the number of returned packets?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.