IFQ_DEQ_BEGIN(9)
okay so bestie, welcome to IFQ_DEQ_BEGIN(9) from the Kernel Developer's Manual β this is the page about dequeuing an mbuf from an interface sending queue. let's get into it π
β¨
πΈ NAME πΈ
ifq_deq_begin, ifq_deq_commit, ifq_deq_rollback β dequeue an mbuf from an interface sending queue π
β¨ SYNOPSIS β¨
#include <net/if_var.h>
struct mbuf *
ifq_deq_begin(struct ifqueue *ifq);
void
ifq_deq_commit(struct ifqueue *ifq, struct mbuf *m);
void
ifq_deq_rollback(struct ifqueue *ifq, struct mbuf *m);
π DESCRIPTION π
okay so the ifq_deq_* set of functions provides a non-atomic alternative to ifq_dequeue(9). π«Ά
π¨ real talk: their use is discouraged β code should use ifq_dequeue(9) whenever possible. no cap.
ifq_deq_begin(struct ifqueue *ifq)β get a reference to the next mbuf to be transmitted from theifqinterface send queue. if an mbuf is to be transmitted, also acquire a lock on the send queue to exclude modification or freeing of the referenced mbuf. its packet header must not be modified until the mbuf has been dequeued withifq_deq_commit(). πifq_deq_commit(struct ifqueue *ifq, struct mbuf *m)β dequeue the mbufmthat was referenced by a previous call toifq_deq_begin()and release the lock onifq. βifq_deq_rollback(struct ifqueue *ifq, struct mbuf *m)β release the lock on the interface send queueifqthat was acquired while a reference tomwas being held. β©οΈ
π§ CONTEXT π§
ifq_deq_begin(), ifq_deq_commit(), and ifq_deq_rollback() can be called during autoconf, from process context, or from interrupt context. π
β RETURN VALUES β
ifq_deq_begin() returns the next mbuf to be transmitted by the interface. if no packet is available for transmission, NULL is returned. π«‘
π¦ SEE ALSO π¦
ifq_dequeue(9)π
xoxo, Debian π β March 20, 2021 β¨
π¦ where this page comes from
- nixpkgs unstable: cvs-export
- Copyright (c) 2015 David Gwynne <dlg@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms