It provides a good way to distribute traffic on queues and can help reduce buffer bloat.
This is in part of the work for code reduction and patches import from pfSense.
Next will come CodelQ scheduler implementation.
It will allow to integrate some improvements to ALTQ to current stack gluing and auto loading as module.
I don't see any locking in the code, but I see spl(9). This tells me that code isn't mpsafe. Do I mistake here?
Also, I've got some minor comments that are inlined.
|158 ↗||(On Diff #6265)|
Please change the MALLOC/FREE macros to malloc()/free(). The macros are obsoleted for > 10 years and shouldn''t be introduced in new code.
|160–161 ↗||(On Diff #6265)|
You did M_WAITOK, you don't need this check.
|349 ↗||(On Diff #6265)|
|358 ↗||(On Diff #6265)|
|479–481 ↗||(On Diff #6265)|
You don't need this "sanity" that just pollutes code. INVARIANTS in malloc(9) itself do the job much better.
Awfully sorry, I didn't mentioned couple more comments on malloc(9) usage on previous review. There shouldn't be cast and M_ZERO is preferred over bzero(). Places in code are marked.
|158 ↗||(On Diff #6268)|
Cast before malloc() isn't needed in general. It actually can hide errors at certain circumstances. Let's not introduce such new code.
|160 ↗||(On Diff #6268)|
Better use M_ZERO right at malloc(9) instead of bzero().
|348 ↗||(On Diff #6268)|
Please remove cast and use M_ZERO here as well.
|66 ↗||(On Diff #6268)|
Yeah i know on it but most ALTQ man pages are dropped and only altq general one exists in FreeBSD.
And also i am not good at man page writing.