Removing queue length check in ip_output (was Re: buf_ring in HEAD is racy)

Garrett Wollman wollman at hergotha.csail.mit.edu
Wed Dec 18 22:40:32 UTC 2013


In article
<CAJ-VmomyPq_2K-MFhb7vt6MM7RBbmn7yaTzUXb7+N7TbW1RmHQ at mail.gmail.com>,
adrian at freebsd.org writes:

>.. it's totally bogus in an if_transmit / SMP world. There's no
>locking and there's no guarantee that there will be headroom in the
>queue between this point and the later call to the if_output() method.

The theory is that when transmitting fragments, it's desirable to have
all-or-nothing transmit behavior with respect to the original packet.
Transmitting incomplete fragmented packets wastes resources on the
local CPU, in the network, and on the remote system, so you should not
do so when it is possible to avoid it.

Ideally, there would be an if_reserve(ifp, N) interface that hands you
a token that you can then pass back N times to if_transmit().  But
it's not clear to me how common or necessary this is, except perhaps
on very busy authoritative DNS servers.  (Are there any other
applications for fragmented UDP these days?)  So it might not be worth
the effort.

-GAWollman



More information about the freebsd-net mailing list