Damien Zammit, le dim. 20 juil. 2025 10:34:16 +0000, a ecrit: > -------- Original Message -------- > > Damien Zammit, le dim. 20 juil. 2025 02:49:16 +0000, a ecrit: > > > + flag = 0; > > > + err = rump_sys_ioctl (nd->bpf_fd, BIOCIMMEDIATE, &flag); > > > + if (err < 0) > > > + { > > > + mach_print("ERROR: biocimmediate failed\n"); > > > + errno = rump_errno2host(err); > > > + return errno; > > > + } > > > + > > > + /* We need this timeout for blocking requests to flush even if not > > full */ > > > + err = rump_sys_ioctl (nd->bpf_fd, BIOCSRTIMEOUT, &timeout); > > > > ? Is that not BIOCIMMEDIATE that achieves this? You are talking about > > incomming packets, right? rarpd for instance only uses BIOCIMMEDIATE, > > not BIOCSRTIMEOUT? > > 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 :) Samuel