Bug 38 - Use pkt_buf (buffer for packets from guest/container) as ringbuffer
Summary: Use pkt_buf (buffer for packets from guest/container) as ringbuffer
Alias: None
Product: passt
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All Linux
: Low enhancement
Assignee: nobody
Depends on:
Reported: 2022-11-10 12:59 UTC by Stefano Brivio
Modified: 2022-11-10 12:59 UTC (History)
0 users

See Also:


Description Stefano Brivio 2022-11-10 12:59:02 UTC
At the moment, tap_handler_passt() reads a batch of packets into pkt_buf, and tries to ensure that there's one full packet at the end of it by blocking recv() calls requesting a given amount of bytes.

This doesn't actually guarantee what we want, at least in theory, and also the blocking recv() calls are not really nice to have there.

We could instead use pkt_buf as ringbuffer: read a given amount of data, scan for packets, and if one packet at the end isn't complete at the end, just keep a pointer to it and deal with it later.

See also:

Note You need to log in before you can comment on or make changes to this bug.