HomeFreeBSD

Remove two unnecessary sleeps from the hot path in bpf(4).

Description

Remove two unnecessary sleeps from the hot path in bpf(4).

The first one never triggers because bpf_canfreebuf() can only be true for
zero-copy buffers and zero-copy buffers are not read with read(2).

The second also never triggers, because we check the free buffer before
calling ROTATE_BUFFERS(). If the hold buffer is in use the free buffer
will be NULL and there is nothing else to do besides drop the packet. If
the free buffer isn't NULL the hold buffer _is_ free and it is safe to
rotate the buffers.

Update the comment in ROTATE_BUFFERS macro to match the logic described
here.

While here fix a few typos in comments.

MFC after: 2 weeks
Sponsored by: Rubicon Communications (Netgate)

Details

Provenance
loosAuthored on
Parents
rS286141: MFC: r285113
Branches
Unknown
Tags
Unknown