Re: [PATCH net v4 4/8] net/sched: netem: refactor dequeue into helper functions

From: Simon Horman

Date: Fri Apr 10 2026 - 07:46:48 EST


On Mon, Apr 06, 2026 at 10:25:12AM -0700, Stephen Hemminger wrote:
> Extract the tfifo removal, slot accounting, and child/direct dequeue
> paths from the monolithic netem_dequeue() into separate helpers:
>
> netem_pull_tfifo() - remove head packet from tfifo
> netem_slot_account() - update slot pacing counters
> netem_dequeue_child() - enqueue to child, then dequeue from child
> netem_dequeue_direct()- dequeue from tfifo when no child
>
> This replaces the goto-based control flow with straightforward function
> calls, making the code easier to follow and modify.
>
> No functional change intended.

Manually verified (as best I could :)

>
> Signed-off-by: Stephen Hemminger <stephen@xxxxxxxxxxxxxxxxxx>

Thanks for splitting this out.
It was very helpful.

Reviewed-by: Simon Horman <horms@xxxxxxxxxx>