|Driver Entry Points
mi_disable — MAC interrupt
enable and disable entry points
Uncommitted - This interface is still evolving. API and ABI stability is not guaranteed.
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
entry points should return
0. Otherwise the
appropriate error number should be returned.
|July 2, 2022