It provides a good way to distribute traffic on queues and can help reduce buffer bloat.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
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.
sys/net/altq/altq_fairq.c | ||
---|---|---|
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) | Same here. |
358 ↗ | (On Diff #6265) | here |
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. |
Is that also going to come from DragonFlyBSD?
It will allow to integrate some improvements to ALTQ to current stack gluing and auto loading as module.
Thank you for your work.
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.
sys/net/altq/altq_fairq.c | ||
---|---|---|
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. |
sys/net/altq/altq_fairq.c | ||
---|---|---|
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. |
Update to take into account the comments on malloc casting and removing bzero().
Added the changes to altq(4) manual page.