IFLIBDI(9)
π NAME π
iflibdi β Device Independent Configuration Functions
okay so bestie, welcome to IFLIBDI(9), straight outta the Kernel Developer's Manual π this is the page that explains the device independent configuration functions β the ones that don't care what hardware you're running on, they just work. main character energy fr fr.
β¨ SYNOPSIS β¨
#include <ifdi_if.h>
π Device Independent Functions π
int
iflib_device_attach(device_t dev);
int
iflib_device_detach(device_t dev);
int
iflib_device_suspend(device_t dev);
int
iflib_device_resume(device_t dev);
int
iflib_device_register(device_t dev, void *softc, if_shared_ctx_t sctx,
if_ctx_t *ctxp);
int
iflib_device_deregister(if_ctx_t ctx);
int
iflib_irq_alloc(if_ctx_t ctx, if_irq_t irq_info, int rid,
driver_filter_t filter, void *filter_arg, driver_intr_t handler,
void *arg, char *name);
int
iflib_irq_alloc_generic(if_ctx_t ctx, if_irq_t irq, int rid,
intr_type_t type, driver_filter_t *filter, void *filter_arg,
int qid, char *name);
void
iflib_led_create(if_ctx_t ctx);
void
iflib_tx_intr_deferred(if_ctx_t ctx, int txqid);
void
iflib_rx_intr_deferred(if_ctx_t ctx, int rxqid);
void
iflib_link_intr_deferred(if_ctx_t ctx);
void
iflib_link_state_change(if_ctx_t ctx, int linkstate);
void
iflib_add_int_delay_sysctl(if_ctx_t ctx, const char *, const char *,
if_int_delay_info_t, int, int);
β Global Variables β
extern struct if_txrx
(yes, that's the whole line, no cap π)
πΈ DATA STRUCTURES πΈ
The if_ctx_t structure is the device independent data structure that holds all the statistics and identifying information used to transmit and receive data packets. The interface is associated with an array of queues assigned sequentially. Each queue has its own transmit (iflib_txq_t) and receive (iflib_rxq_t) queue. The transmit queue is used to hold packets while the interface is in the process of sending another. The receive queue is used to receive packets that are awaiting processing.
π The if_ctx_t Structure π
The fields of struct if_ctx_t are as follows:
if_softc(void) β a pointer to the driver's private state block.ifc_dev(device_t) β the underlying device structure.ifc_ip(if_t) β a link back to the interface structureifc_cpus(cpuset_t)ifc_mutex(struct mtx) β mutex lock used to maintain data integrityifc_mtx_name(char *) β the name of the mutexifc_txqs(iflib_txq_t) β device independent transmit queue maintained internally byiflibifc_rxqs(iflib_rxq_t) β device independent receive queue maintained internally byiflibifc_qsets(iflib_qset_t) β output queue that contains a single transmit (ifc_txq_t) and receive (ifc_rxq_t) queueifc_if_flags(uint32_t) β flags describing the operational parameter of the interfaceifc_in_detach(int)ifc_link_state(int) β describes the current link state of the Ethernet interface. Its possible values are either active or inactive.ifc_link_irq(int)ifc_vlan_attach_event(eventhandler_tag)ifc_vlan_detach_event(eventhandler_tag)ifc_pause_frames(int)ifc_watchdog_events(int)ifc_mac(uint8_t)ifc_msix_mem(struct resource *)ifc_legacy_irq(struct if_irq)ifc_admin_task(struct grouptask) β taskqueue task scheduled for link state change events of the interfaceifc_filter_info(struct iflib_filter_info) β statistics and information relating to the interface device filterifc_media(struct ifmedia)ifc_txrx(struct if_txrx)
π₯ FUNCTIONS π₯
The above named functions are found exclusively in iflib. They are independent of the underlying hardware type or configuration. iconic behavior tbh π«Ά
π Device Independent Functions π
iflib_device_attach()β this function initiates a device registration with theiflibframework. It calls theiflib_registerfunction, which is responsible for allocating and initializing theif_ctx_tstructure.iflib_device_detach()β shutdown and detach the device. Unregister vlan events, drain any dependent tasks, and release irq, pci, and msix memory. it's giving "pack your bags, we're leaving" πiflib_device_suspend()β suspend a device by calling the device dependent suspend function andbus_generic_suspend.iflib_device_resume()β resume a device by calling the device dependent resume function, theiflib_init_lockedfunction, andbus_generic_resume. wake up bestie, we're back β¨iflib_device_register()β register a device with theiflibframework. Allocate and initialize theif_ctx_tstructure. Setup and initialize the MSI or MSI/X interrupt queues if necessary. Allocate memory for queues and qset structure setup.iflib_device_irq_alloc()β allocate an interrupt resource for a givenridvalue with an associated filter and handler function.iflib_device_irq_alloc_generic()β performs the same function asiflib_device_irq_allocalong with the additional functionality of adding a taskgroup. The data fields and callback function are determined by the type of interrupt, such asIFLIB_INTR_TX,IFLIB_INTR_RX, andIFLIB_INTR_ADMIN.iflib_led_create()β callsled_createto initialize thectx->ifc_led_devfieldiflib_tx_intr_deferred()β callsGROUPTASK_ENQUEUEto enqueue the transfer queuesift_task.iflib_rx_intr_deferred()β callsGROUPTASK_ENQUEUEto enqueue the receive queuesifr_task.iflib_link_intr_deferred()β callsGROUPTASK_ENQUEUEto enqueue the link taskiflib_link_state_change()β change the interface link status to eitherLINK_STATE_UPorLINK_STATE_DOWNas specified by the second argument to the function.
π Interface Link States π
The following link states are currently defined:
LINK_STATE_UPβ the link is up. π₯LINK_STATE_DOWNβ the link is down. π
and back to the function list:
iflib_add_int_delay_sysctl()β modifies settings to user defined values for a given set of variables.
π SEE ALSO π
π«Ά AUTHORS π«Ά
This manual page was written by Nicole Graziano β thank you queen, we stan an author who documents things π
and that's the whole page bestie, you ate that. this one shipped with Debian, dated May 24, 2017, and it lives under the name IFLIBDI(9). go forth and configure, device-independently. periodt. πβ¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms