Damien Zammit, le dim. 20 juil. 2025 11:20:33 +0000, a ecrit: > Hi, > > -------- Original Message -------- > On 20/7/25 8:54 pm, Samuel Thibault <samuel.thiba...@gnu.org> wrote: > > > > Set Receive Timeout is required. > > > > > > The immediate flag makes it begin filling the bpf buffer without any > > delay. But without the timeout set, a pending blocking read will never > > return until the whole buffer is filled because the default timeout is > > indefinitely long. > > > > But you are setting a 1s timeout, is it waiting for 1s before handing a > > non-filled buffer? If so, we really want to avoid that by using select() > > (which isn't *that* hard to call for a single fd). If not, then better > > make this delay 1m or so, there is no need for rumpnet to wake up every > > second only to find that there is nothing to read :) > > No. It's a timeval (in microseconds) so I am using (10ms*1000)us as the > timeout
Ah, I had assumed BPF_TIMEOUT_MS was the magic value for getting milliseconds. > - I tried a few values and this seemed to have best performance. Ok, that's'still a very poor approach (and having to tune it shows that it's non-longterm-proof): we have no reason to introduce such a delay. That only adds 10ms to the latency for no reason (and that 10ms can even be jitterish so will make tcp not like that). Just call select(), and you will get unblocked when you can read(). Really, it's not that hard. Samuel