Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Dec 2013 17:40:29 -0500 (EST)
From:      Garrett Wollman <wollman@hergotha.csail.mit.edu>
To:        adrian@freebsd.org
Cc:        freebsd-net@freebsd.org
Subject:   Re: Removing queue length check in ip_output (was Re: buf_ring in HEAD is racy)
Message-ID:  <201312182240.rBIMeTUE006362@hergotha.csail.mit.edu>
In-Reply-To: <CAJ-VmomyPq_2K-MFhb7vt6MM7RBbmn7yaTzUXb7%2BN7TbW1RmHQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In article
<CAJ-VmomyPq_2K-MFhb7vt6MM7RBbmn7yaTzUXb7+N7TbW1RmHQ@mail.gmail.com>,
adrian@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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312182240.rBIMeTUE006362>