netif_txq_maybe_stop(9)
π netif_txq_maybe_stop(9) β¨
okay so bestie, welcome to the netif_txq_maybe_stop(9) page β that's the kernel API manual, and this function is literally the "should I stop this Tx queue or not" bouncer. locklessly, no cap.
πΈ NAME πΈ
netif_txq_maybe_stop β locklessly stop a Tx queue, if needed π
like, only if needed. it does a vibe check first.
π¦ SYNOPSIS π¦
netif_txq_maybe_stop (txq , get_desc , stop_thrs , start_thrs );
β¨ ARGUMENTS β¨
txqβ thestruct netdev_queueyou're stopping/starting. main character energy, honestly.get_descβ grabs the current number of free descriptors. β οΈ but read the requirements below, fr fr, don't skip them!stop_thrsβ the minimal number of available descriptors for the queue to be left enabled. cross below this and it's giving "stopped".start_thrsβ the minimal number of descriptors needed to re-enable the queue. it can be equal tostop_thrs, or higher if you wanna avoid that annoying frequent waking situation π
π DESCRIPTION π
heads up, and this is the important bit: all arguments may be evaluated multiple times, so beware of side effects!! π not me warning you twice.
get_desc must be a formula or a function call, and it must always return up-to-date information when evaluated! like, always. no stale data, no vibes-based guesswork.
it's expected to be used from ndo_start_xmit β see the comment on top of the file, iykyk. π
π₯ RETURN π₯
0β the queue was stopped π1β the queue was left enabled β-1β the queue was re-enabled (it raced with waking π)
π SEE ALSO π
- Kernel file
./include/net/netdev_queues.h struct netdev_config(9)struct netdev_stat_ops(9)struct netdev_queue_mgmt_ops(9)Lockless queue stopping / waking helpers.(9)__netif_txq_completed_wake(9)
π go read the actual header file too, bestie, it's lowkey iconic.
that's the whole page, periodt π
β shoutout to ./include/net for hosting this masterpiece, Kernel API Manual on the tin, dated October 2026. mwah π«Άπ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms