carta
ifdi_rxq_setup(9)

ifdi_rxq_setup9

Device dependent configuration functions

Part of ifdi_attach_post(9).

Usage

Mandatory Functions

int

int

int

Optional Functions

int

int

Mandatory Functions

int

int

int

Optional Functions

void

void

int

int

int

int

Mandatory Functions

void

void

void

int

void

int

void

uint64_t

void

Optional Functions

void

Mandatory Functions

void

void

void

IOV Support

init

void

void

int

Optional Functions

void

Optional Service Routines

void

void

Additional Functions

void

int

int

Functions

The above named functions are device dependent configuration functions. These routines are registered with iflib by the driver and are called from the corresponding iflib function to configure device specific functions and registers.

Device Dependent Functions

Soft Queue Setup and Teardown

ifdi_tx_queues_alloc()

Mandatory function that is called during iflib_attach to allocate transmit queues. vaddrs and paddrs are arrays of virtual and physical addresses respectively of the hardware transmit queues. ntxqs is the number of queues per qset. ntxqsets is the number of qsets.

ifdi_rx_queues_alloc()

Mandatory function that is called during iflib_attach to allocate receive queues. vaddrs and paddrs are arrays of virtual and physical addresses respectively of the hardware receive queues. nrxqs is the number of queues per qset. nrxqsets is the number of qsets.

ifdi_queues_free()

Mandatory function that frees the allocated queues and associated transmit buffers.

ifdi_txq_setup()

Optional function for each transmit queue that handles device specific initialization.

ifdi_rxq_setup()

Optional function for each receive queue that handles device specific initialization.

Device Setup and Teardown

ifdi_attach_pre()

Mandatory function implemented by the driver to perform any attach logic that procedes interrupt and queue allocation, queue setup, and interrupt assignment.

ifdi_attach_post()

Mandatory function implemented by the driver to perform any attach logic that occurs after ifdi_attach_pre, and iflib's queue setup and MSI/MSIX(X) or legacy interrupt assignment.

ifdi_detach()

Mandatory function that frees any resources allocated by the driver in ifdi_attach_pre and ifdi_attach_post.

ifdi_vlan_register()

Optional function called by the VLAN config eventhandler. vtag is the new VLAN tag.

ifdi_vlan_unregister()

Optional function called by the VLAN unconfig eventhandler.

ifdi_power_prepare()

Optional function called before iflib performs the terminal stop used for detach, suspend, or shutdown. The event argument is one of IFLIB_POWER_DETACH, IFLIB_POWER_SUSPEND, or IFLIB_POWER_SHUTDOWN. Drivers should use this hook only to establish policy which must precede the stop and must not start, stop, or alter queue DMA; the default implementation does nothing. If it returns an error, it must undo any partial policy change before returning.

ifdi_suspend()

Optional function called after iflib has stopped queue DMA and drained its private configuration taskqueue. It performs suspend-specific firmware, wake, PHY, and low-power work. An error is returned to the bus, and iflib attempts to resume the stopped interface.

ifdi_shutdown()

Optional function called after the same terminal stop and taskqueue drain as ifdi_suspend(). Shutdown errors are returned without attempting rollback.

ifdi_resume()

Optional function that restores suspend-specific device state while the datapath remains stopped. This function is also called to roll back a failed suspend. It must not assume that a PCI power-state transition or configuration-space restore has occurred since ifdi_suspend(). After it succeeds, iflib initializes the datapath exactly once when the interface is administratively up and leaves an administratively-down interface stopped.

Device Configuration Functions

ifdi_init()

Mandatory function that will initialize and bring up the hardware. For example, it will reset the chip and enable the receiver unit. Iflib marks the interface running after the callback returns successfully; the driver must not modify the driver flags itself. If initialization cannot complete, the driver must leave the hardware stopped or in a state in which ifdi_stop() can safely quiesce it, and call iflib_init_failed() before returning. Iflib treats this report conservatively and invokes the driver stop method before retrying initialization or releasing queue mappings.

ifdi_stop()

Mandatory function that performs a terminal stop and disables all traffic on the interface. The driver must stop DMA before returning; iflib releases the TX and RX buffers after the callback. The method commonly issues a global reset and may also put the PHY or device into its administratively-down state.

ifdi_multi_set()

Programs the interfaces multicast addresses

ifdi_media_status()

Media Ioctl Callback. Function is called whenever the user queries the status of the interface using ifconfig(8). The driver sets the appropriate link type and speed in ifmr->ifm_active.

ifdi_mtu_set()

Sets the mtu interface to the value of the second function parameter mtu.

ifdi_media_change()

Function is called when the user changes speed/duplex using the media/mediaopt option with ifconfig(8). It is not called while the device is suspending or suspended; iflib rejects such a media change with EBUSY.

ifdi_promisc_set()

Enables or disables promisc settings depending upon the flags value. flags contains the interface's ifnet(9) flags.

ifdi_get_counter()

Returns the value for counter cnt depending upon counter type.

ifdi_update_admin_status()

Sets the link_up state to TRUE or FALSE depending upon the OS link state. A real check of the hardware only happens with a link interrupt.

ifdi_media_set()

Need to define

Interrupt Enable/Disable

ifdi_intr_enable()

Mandatory function that enables all interrupts.

ifdi_intr_disable()

Mandatory function that disables all interrupts.

ifdi_queue_intr_enable()

Mandatory function that enables interrupts on queue qid.

iov_init()

Initialize num_vfs VFs.

io_uninit()

Tear down the context for all VFs.

ifdi_vflr_handle()

Handle any VFs that have reset themselves via a Function Level Reset (FLR).

ifdi_vf_add()

Set parameters in params in VF vfnum.

Service Routines

ifdi_timer()

Optional timer routine that will be run every 500ms.

ifdi_watchdog_reset()

Optional function to run when a transmit queue is hung.

Additional Functions

ifdi_led_func()
ifdi_sysctl_int_delay()
ifdi_i2c_req()

History

  • FreeBSD 16.0-CURRENT (2026-10-27): the text shown here
  • FreeBSD 15.1-RELEASE to FreeBSD 13.3-RELEASE
  • FreeBSD 13.2-RELEASE to FreeBSD 13.0-RELEASE
  • FreeBSD 12.4-RELEASE
  • FreeBSD 12.3-RELEASE
  • FreeBSD 12.2-RELEASE
  • FreeBSD 12.1-RELEASE
  • FreeBSD 12.0-RELEASE

Authors

This manual page was written by Nicole Graziano

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.