check_desc_avail(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

Okay so this is check_desc_avail(9) from the Kernel API Manual, and the whole mission is: check descriptor availability on a send queue πŸ’…βœ¨


✨ SYNOPSIS ✨

Here's the exact signature, character for character, bestie:

int check_desc_avail (struct adapter *adap , struct sge_txq *q , struct sk_buff *skb , unsigned int ndesc , unsigned int qid );

🫢 ARGUMENTS 🫢

  • adap β€” the adapter.
  • q β€” the send queue.
  • skb β€” the packet needing the descriptors.
  • ndesc β€” the number of Tx descriptors needed.
  • qid β€” the Tx queue number in its queue set (TXQ_OFLD or TXQ_CTRL).

πŸ¦‹ DESCRIPTION πŸ¦‹

So this function checks if the requested number of Tx descriptors is available on an SGE send queue. If the queue is already suspended or not enough descriptors are available, the packet is queued for later transmission.

πŸ”’ Important locked-queue moment, periodt: this must be called with the Tx queue locked. Do not skip that, bestie.

Here's the return-value vibe check:

  • 0 β€” enough descriptors are available.
  • 1 β€” there aren't enough descriptors, and the packet has been queued.
  • 2 β€” the caller needs to retry because there weren't enough descriptors at the beginning of the call but some freed up in the mean time.

🌈 SEE ALSO 🌈

Kernel file ./drivers/net/ethernet/chelsio/cxgb3/sge.c, plus this whole squad:


xoxo, bestie πŸ’– This was check_desc_avail(9) from the Kernel API Manual, with source/version line ./drivers/net/ethernet/chelsio..., dated October 2026 πŸŽ€βœ¨

πŸ“¦ where this page comes from