[PATH] ALTQ(9) codel algorithm implementation

Gleb Smirnoff glebius at FreeBSD.org
Fri Jun 14 09:51:27 UTC 2013


  Ermal,

On Mon, Jun 10, 2013 at 03:43:12PM +0200, Ermal Lu?i wrote:
E> at location [1] can be found a patch for Codel[3] algorithm implementation.
E> 
E> Triggered by a mail to the mailing lists[2] of OpenBSD i completed the
E> implementation for FreeBSD.
E> 
E> It allows to use codel as the single configured discipline on an interface.
E> Also it can be used as a sub discipline of existing queueing disciplines
E> already present.
E> 
E> The work has been tested and confirmed working without issues in pfSense.
E> 
E> Any objections on pushing this into FreeBSD?
E> 
E> [1]
E> https://github.com/pfsense/pfsense-tools/blob/master/patches/RELENG_10_0/altq_codel.diff
E> [2] http://permalink.gmane.org/gmane.os.openbsd.tech/29745
E> [3] http://www.bufferbloat.net/projects/codel/wiki

I'm afraid we can't grow mbuf packet header with 8 bytes just to satisfy
the ALTQ codel algo, which would definitely have a limited usage among
FreeBSD users. Thus, "enqueue_time" should go into mbuf_tags(9) not into
mbuf packet header.

Smaller problems noticed:

- codel_alloc() doesn't check return from malloc(). And fairq_class_create(),
  priq_class_create(), rmc_newclass() and hfsc_class_create()
  don't check return from codel_alloc().
- Need newline before function name in codel_Newton_step().
- Spaces instead of tab in declaration of struct codel_ifstats and struct codel_opts.
- Diff chunk to fairq_add_altq() is okay, but is entirely unrelated to overall
  patch. Should be committed separately and old MALLOC() macro should be removed.

Assuming all above is taken into account, IMHO, the patch is okay to be included
into FreeBSD. Thanks!

Some grumbling: the altq_codel.c is polluted with spl(9) and has a lot of
ifdef __NetBSD__, uses legacy u_intXX_t types instead of C99, uses strange
macro m_pktlen() and so on. Same thing as the rest of ALTQ code. If someone
can mechanically polish altq, that would be nice.

-- 
Totus tuus, Glebius.


More information about the freebsd-net mailing list