]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r286140:
authorloos <loos@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 17 Aug 2015 18:43:39 +0000 (18:43 +0000)
committerloos <loos@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 17 Aug 2015 18:43:39 +0000 (18:43 +0000)
commitef8d9d8d61ecd8bd207732a2973e6fd752d528fa
tree6b69779dcbaa864c776085f468c6706ab8b317ef
parent077bf8b65ebb5f024a4b499297b422696d55c10c
MFC r286140:
  Remove the sleep from the buffer allocation routine.

  The buffer must be allocated (or even changed) before the interface is set
  and thus, there is no need to verify if the buffer is in use.

MFC r286142:
  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 r286243:
  Add a KASSERT() to make sure we wont rotate the buffers twice (rotate the
  buffers while the hold buffer is in use).

  Sponsored by: Rubicon Communications (Netgate)

git-svn-id: svn://svn.freebsd.org/base/stable/10@286856 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/net/bpf.c
sys/net/bpf.h
sys/net/bpf_buffer.c