MI_ENABLE(9E) Driver Entry Points MI_ENABLE(9E)

mi_enable, mi_disable
MAC interrupt enable and disable entry points

#include <sys/mac_provider.h>

int
prefix_intr_enable(mac_intr_handle_t driver);

int
prefix_intr_disable(mac_intr_handle_t driver);

Uncommitted - This interface is still evolving. API and ABI stability is not guaranteed.

driver
A pointer to the mac interrupt's private data that was passed in via the mi_handle member of the mac_intr(9S) structure.

The mi_enable() and mi_disable() entry points are used by the MAC framework when it wishes to disable the generation of interrupts for the ring and poll on the it through the mri_poll(9E) entry point.

These entry points should enable and disable the generation of the interrupt for the ring that is represented by driver. The driver argument corresponds to what the driver set in the mri_intr member while filling out the mac_ring_info(9S) structure and generally is used to point to a specific ring.

Importantly, this entry point is not asking to enable and disable the underlying device-level interrupt such as a PCIe MSI or MSI-X, which may be being used by multiple rings. Drivers must not implement this in terms of the DDI interrupt functions such as ddi_intr_enable(9F) and ddi_intr_disable(9F).

Instead this should be implemented through device specific means such as writing to registers or sending control messages to enable or disable the generation of interrupts for the specified ring.

When manipulating the device's control of interrupts, the driver should be careful to serialize these changes with the ongoing processing of interrupts through the interrupt handler and the mri_poll(9E) entry point. These should all be protected by the same mutex which is scoped to the ring itself when the ability to turn on and off interrupt generation may be manipulated on a per-ring basis. Failure to properly synchronize this may lead to the driver mistakenly delivering the same packet twice through both its interrupt handler and its mri_poll(9E) entry point.

Upon successful completion, the mi_enable() and mi_disable() entry points should return 0. Otherwise the appropriate error number should be returned.

mac(9E), mac_capab_rings(9E), mri_poll(9E), ddi_intr_disable(9F), ddi_intr_enable(9F), mac_intr(9S), mac_ring_info(9S)
July 2, 2022 OmniOS