__netif_txq_completed_wake(9)
π __netif_txq_completed_wake β from the Kernel API Manual, bestie π
okay so picture this: you're deep in the kernel networking trenches and you need to wake a Tx queue without locks β only if it actually needs it. That's literally this function. It's giving "low-level but make it chic." π¦
β¨ SYNOPSIS β¨
__netif_txq_completed_wake (txq , pkts , bytes , get_desc , start_thrs ,
down_cond );
no cap, that's the whole call. six args, zero drama (well... mostly). π
π ARGUMENTS π
txqβ thestruct netdev_queueyou're stopping or starting. main character of the whole operation, honestly.pktsβ how many packets got completed. count 'em, report 'em.bytesβ how many bytes got completed. the byte girlies deserve representation too. πget_descβ gets you the current number of free descriptors. but bestie, read the requirements below, this one has RULES. πstart_thrsβ the minimum number of descriptors needed to re-enable the queue. think of it as the vibe check threshold.down_condβ the "down condition": a predicate that says nope, don't wake the queue up even if descriptors are available. like do-not-disturb mode for your Tx queue. π
πΈ DESCRIPTION πΈ
So here's the tea: all arguments may be evaluated multiple times. multiple times!! so don't go putting anything in there that gets weird when it runs more than once.
And get_desc is extra special β it must be a formula or a function call, and it must always return up-to-date information when evaluated. like, fresh-fresh. not stale. not cached. current. the function will be calling it and it needs the truth, the whole truth, and nothing but. β¨
As for what it actually does: it reports the completed pkts/bytes to BQL. that's the moment. slay. π
β RETURN β
0β the queue was woken up π (you did it, bestie)1β the queue was already enabled, or it's disabled butdown_condis true. either way, nothing to do here.-1β the queue was left unchanged becausestart_thrswasn't reached. not today, not with that descriptor count. π
π¦ 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_maybe_stop(9)
like, go read them. they're all in the same friend group, iykyk. π«Ά
fr fr β remember: get_desc has to be re-evaluable and always current, and every argument might get evaluated more than once. no side effects, no lying descriptors, periodt. π
and that's the whole page, bestie! source lives at ./include/net, dated October 2026, and it's all part of the Kernel API Manual β catch you in the next manpage, 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