netdev_tx_sent_queue(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… netdev_tx_sent_queue β€” the "hey bestie I queued some bytes" page

okay so real talk, this is a page from the Kernel API Manual (yes, man 9, the deep lore) and it's about telling the network stack how many bytes you just handed to the hardware. tiny function, big main character energy. let's get into it 🫢


✨ NAME ✨

netdev_tx_sent_queue β€” report the number of bytes queued to a given tx queue

like, it's the receipts function. you sent bytes, now you say so. πŸ’Œ


🌸 SYNOPSIS 🌸

void netdev_tx_sent_queue (struct netdev_queue *dev_queue , unsigned int
bytes );

no return value, no drama, just vibes and a void. periodt.


πŸŽ€ ARGUMENTS πŸŽ€

  • dev_queue β€” network device queue. this is the queue, the one, the main character. 🎯
  • bytes β€” number of bytes queued to the device queue. (count them, bestie, count them accurately πŸ”’)

πŸ¦‹ DESCRIPTION πŸ¦‹

so what you're doing here is reporting the number of bytes queued for sending/completion to the network device hardware queue. that's the whole job. it's giving "paperwork but make it kernel". πŸ“‹βœ¨

the tea on bytes: it should be a good approximation and it should exactly match the netdev_completed_queue bytes. like β€” approximation and exact match, at the same time. yes it's a little paraNOID, no I don't make the rules. 😭 keep them in sync or the accounting gets messy.

this is typically called once per packet, from ndo_start_xmit. one packet, one call, that's the rhythm. 🎡


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/linux/netdevice.h

the friend group is huge, ngl. prepare yourself, we're going through the whole contact list πŸ’€:

struct gro_node(9), napi_is_scheduled(9), napi_schedule(9), napi_schedule_irqoff(9), napi_complete_done(9), napi_synchronize(9), napi_if_scheduled_mark_missed(9), enum netdev_priv_flags(9), struct net_device(9), netdev_priv(9), netdev_from_priv(9), netif_napi_add(9), netif_napi_add_config(9), netif_napi_add_tx(9), __netif_napi_del(9), netif_napi_del(9), netif_start_queue(9), netif_wake_queue(9), netif_stop_queue(9), netif_queue_stopped(9), netdev_queue_set_dql_min_limit(9), netdev_txq_bql_enqueue_prefetchw(9), netdev_txq_bql_complete_prefetchw(9), netdev_sent_queue(9), netdev_tx_completed_queue(9), netdev_completed_queue(9), netdev_tx_reset_subqueue(9), netdev_reset_queue(9), netdev_cap_txqueue(9), netif_running(9), netif_start_subqueue(9), netif_stop_subqueue(9), __netif_subqueue_stopped(9), netif_subqueue_stopped(9), netif_wake_subqueue(9), netif_attr_test_mask(9), netif_attr_test_online(9), netif_attrmask_next(9), netif_attrmask_next_and(9), netif_is_multiqueue(9), dev_hold(9), dev_put(9), linkwatch_sync_dev(9), netif_carrier_ok(9), netif_dormant_on(9), netif_dormant_off(9), netif_dormant(9), netif_testing_on(9), netif_testing_off(9), netif_testing(9), netif_oper_up(9), netif_device_present(9), netif_tx_lock(9), __dev_uc_sync(9), __dev_uc_unsync(9), __dev_mc_sync(9), __dev_mc_unsync(9)

that's the group chat. everyone's invited. πŸŽ‰πŸ’œ


and that's the whole page!! πŸ“ this one came out of ./include/linux in October 2026 β€” go forth and report your bytes accurately, bestie. slay, and remember: approximation is fine, mismatch is not. 🧚✨

πŸ“¦ where this page comes from