OpenBSD manual page server

Manual Page Search Parameters
IFQ_ENQUEUE(9) Kernel Developer's Manual IFQ_ENQUEUE(9)

ifq_enqueue, ifq_dequeue, ifq_purge, ifq_len, ifq_empty, ifq_hdatalen, ifq_set_oactive, ifq_clr_oactive, ifq_is_oactive, ifq_restart, ifq_barrierinterface send queue API

#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);

The ifqueue API provides implementations of data structures and operations for the network stack to queue mbufs for a network driver to dequeue from its start routine for transmission.

(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.
(struct ifqueue *ifq)
Dequeue the next mbuf to be transmitted from the ifq interface send queue.
(struct ifqueue *ifq)
Free all the mbufs on the interface send queue ifq. Freed mbufs will be accounted as drops.
(struct ifqueue *ifq)
Return the number of mbufs on the interface send queue ifq. Note that 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 ().
(struct ifqueue *ifq)
Return if the interface send queue ifq is empty.
(struct ifqueue *ifq)
Return the number of bytes in the mbuf at the head of the interface send queue ifq.
(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.
(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.
(struct ifqueue *ifq)
Return if the hardware associated with the interface send queue ifq is unable to transmit more packets.
(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 () and therefore provides race free modification of the "active" mark.
(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.

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.

ifq_barrier() can be called from process context.

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.

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.

ifq_deq_begin(9), m_freem(9)

March 31, 2022 OpenBSD-current