[PATH] ALTQ(9) codel algorithm implementation

Gleb Smirnoff glebius at FreeBSD.org
Mon Jun 17 10:04:29 UTC 2013


  Ermal,

On Fri, Jun 14, 2013 at 03:05:16PM +0200, Ermal Lu?i wrote:
E> >> I'm afraid we can't grow mbuf packet header with 8 bytes just to satisfy
E> >> the ALTQ codel algo, which would definitely have a limited usage among
E> >> FreeBSD users. Thus, "enqueue_time" should go into mbuf_tags(9) not into
E> >> mbuf packet header.
E> >>
E> >
E> > Agreed.  We don't have space for that in the mbuf header.  There's some
E> > other
E> > fields that may be repurposed though, the header pointer for example which
E> > is
E> > almost entirely unused.  With some updates to the TSO and Checksum offload
E> > mechanism I have in the pipeline the "header" field can be easily
E> > repurposed.
E> >
E> > Though I'm against an "obscure" ALTQ mechanism having its own mbuf header
E> > field
E> > as such.  It must be a generic field that can be used by others as well.
E> >
E> > Yeah i forgot to clarify that.
E> The initial implementation had the added field in tag of pf but for some
E> reason i did not investigate,
E> and this can be a more deep problem the tag not always made it up to ALTQ.
E> Hence it was put in the mbuf header.
E> 
E> I did not find a direct way on why the mbuf tag was lost.
E> Also with codel this does give lots of dropped packet hence i choose this
E> way.
E> I do not like to grow the mbuf tag as well but that was the only consistent
E> way to get this to work reliably.

My guess is, that's because in FreeBSD 10 the pf mtag isn't allocated
unconditionally, like it was in 9.x. Packets can flow through pf w/o
pf mtag.

You don't need to pollute the pf mtag, you just need to create a new tag for
the codel.

Sorry, but failure to find why smth doesn't works as expected isn't an excuse
for a gross hack that affects entire network stack.

-- 
Totus tuus, Glebius.


More information about the freebsd-net mailing list