__netif_txq_completed_wake(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– __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 β€” the struct netdev_queue you'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 but down_cond is true. either way, nothing to do here.
  • -1 β€” the queue was left unchanged because start_thrs wasn'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