IFQ_ENQUEUE(9)

πŸ“¦ in nixpkgs unstable

🌸 NAME 🌸

okay bestie, welcome to IFQ_ENQUEUE(9) β€” the ifq_enqueue(9) page from the Kernel Developer's Manual, and it's literally the whole interface send queue API πŸ’…

It covers these icons: ifq_enqueue, ifq_dequeue, ifq_purge, ifq_len, ifq_empty, ifq_hdatalen, ifq_set_oactive, ifq_clr_oactive, ifq_is_oactive, ifq_restart, and ifq_barrier β€” the interface send queue API, no cap ✨


✨ SYNOPSIS ✨

#include <net/if_var.h>

int
ifq_enqueue(struct ifqueue *ifq, struct mbuf *m);

struct mbuf *
ifq_dequeue(struct ifqueue *ifq);

unsigned int
ifq_purge(struct ifqueue *ifq);

unsigned int
ifq_len(struct ifqueue *ifq);

unsigned int
ifq_empty(struct ifqueue *ifq);

int
ifq_hdatalen(struct ifqueue *ifq);

void
ifq_set_oactive(struct ifqueue *ifq);

void
ifq_clr_oactive(struct ifqueue *ifq);

unsigned int
ifq_is_oactive(struct ifqueue *ifq);

void
ifq_restart(struct ifqueue *ifq);

void
ifq_barrier(struct ifqueue *ifq);

πŸ’… DESCRIPTION πŸ’…

The ifqueue API gives the network stack implementations of data structures and operations for queueing mbufs so a network driver can dequeue from its start routine for transmission. it's giving plumbing but make it iconic 🫢

  • ifq_enqueue(struct ifqueue *ifq, struct mbuf *m) β€” enqueue mbuf m on the ifq interface send queue. if the queue rejects the packet, it will be freed with m_freem(9) and counted as a drop. sad but documented 😭
  • ifq_dequeue(struct ifqueue *ifq) β€” dequeue the next mbuf to be transmitted from the ifq interface send queue. next up, bestie πŸ’Œ
  • ifq_purge(struct ifqueue *ifq) β€” free all the mbufs on the interface send queue ifq. freed mbufs will be accounted as drops. clean slate, but make it counted πŸ’€
  • ifq_len(struct ifqueue *ifq) β€” return the number of mbufs on the interface send queue ifq. note: while ifq_len() may report that mbufs are on the queue, the current queue discipline may not make them available for dequeueing with ifq_dequeue() or ifq_deq_begin(). iykyk πŸ‘€
  • ifq_empty(struct ifqueue *ifq) β€” return if the interface send queue ifq is empty. vibe check: empty or not? πŸ•³οΈ
  • ifq_hdatalen(struct ifqueue *ifq) β€” return the number of bytes in the mbuf at the head of the interface send queue ifq. head-of-line size reveal ✨
  • ifq_set_oactive(struct ifqueue *ifq) β€” ifq_set_oactive() is called by the relevant driver to mark the hardware associated with the interface send queue ifq as unable to transmit more packets. busy hardware era πŸ”₯
  • ifq_clr_oactive(struct ifqueue *ifq) β€” ifq_clr_oactive() is called by the relevant driver to clear the "active" mark on the hardware associated with the interface send queue ifq, meaning it is now able to transmit packets. she's back online πŸ’–
  • ifq_is_oactive(struct ifqueue *ifq) β€” return if the hardware associated with the interface send queue ifq is unable to transmit more packets. yes/no, can she send? πŸ¦‹
  • ifq_restart(struct ifqueue *ifq) β€” dispatch a call to ifq_clr_oactive() and the interface's start routine. this call is serialised with other calls to the start routine via if_start() and therefore provides race free modification of the "active" mark. main character energy in the queue serialiser πŸ‘‘
  • ifq_barrier(struct ifqueue *ifq) β€” ifq_barrier() guarantees that any work currently running in the interface queue serialiser (e.g. work dispatched by ifq_restart() or the interface's start routine) has finished before ifq_barrier() returns. waiting for the group chat to stop typing before you speak, fr fr 🫧

πŸ•°οΈ CONTEXT πŸ•°οΈ

ifq_enqueue(), ifq_dequeue(), ifq_purge(), ifq_len(), ifq_empty(), ifq_hdatalen(), ifq_set_oactive(), ifq_clr_oactive(), ifq_is_oactive(), and ifq_restart() can be called during autoconf, from process context, or from interrupt context. flexible queens 🌈

ifq_barrier() can be called from process context. just her, in process context, being patient πŸ’œ


🎁 RETURN VALUES 🎁

  • ifq_enqueue() returns 0 if the mbuf was successfully queued, or non-zero if mbuf was freed. πŸ“
  • ifq_dequeue() returns the next mbuf to be transmitted by the interface. if no packet is available for transmission, NULL is returned. 😭
  • ifq_purge() returns the number of mbufs that were removed from the queue and freed. the receipts 🧾
  • ifq_len() returns the number of mbufs on the queue. πŸ’Œ
  • ifq_empty() returns a non-zero value if the queue is empty, otherwise 0. πŸ•³οΈ
  • ifq_hdatalen() returns the size of a packet on the queue, or 0 if the queue is empty; πŸ“
  • ifq_is_oactive() returns a non-zero value if the hardware associated with the interface send queue is unable to transmit more packets, otherwise 0. ⭐

πŸ‘€ SEE ALSO πŸ‘€

ifq_deq_begin(9), m_freem(9) β€” go read these next, bestie, it's giving required reading πŸ“š


okay that's the whole page β€” source/version Debian, dated March 31, 2022, and yes she ate πŸ’…βœ¨ periodt

πŸ“¦ where this page comes from
  • nixpkgs unstable: cvs-export
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms