CoDel Active Queue Management
See this article:
and this appendix with pseudocode:
CoDel is a replacement for RED for managing interface packet queues. The claim is that it addresses the bufferbloat problem. The paper states that the algorithm is simple and it has no tuning parameters: both of which are features.
A cursory source inspection makes me think this might go in mac_sched.c with its accompanying data structures and macros.