IFLIBDI(9)
π IFLIBDI(9) β Device Independent Configuration Functions π
okay so bestie, this is the Kernel Developer's Manual page for iflibdi, and it's giving very much βkernel-core, device-independent, no dramaβ energy. Let's get into it π
πΈ NAME πΈ
iflibdi β Device Independent Configuration Functions
β¨ 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
π«Ά DATA STRUCTURES π«Ά
The if_ctx_t Structure is the device independent data structure that contains 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. Slay, queues π
π 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 by iflibifc_rxqsβ(iflib_rxq_t)Device independent receive queue maintained internally by iflibifc_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. No cap, they really said βhardware? never heard of herβ π
π Device Independent Functions π
iflib_device_attach()β Function initiates a device registration with the iflib framework. 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.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.iflib_device_register()β Register a device with the iflib framework. 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_irq_alloc()β Allocate an interrupt resource for a givenridvalue with an associated filter and handler function.iflib_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.
- Interface Link States The following link states are currently defined:
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
mwah π β this page comes from Debian, dated May 21, 2019, under the IFLIBDI(9) banner. periodt.
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms