Interrupt Processing
BCM5718 Programmer’s Guide
Broadcom
®
January 29, 2016 • 5718-PG108-R
Page 229
S e c t i o n 11 : I n t e r r u p t P r o c e s s i n g
NetXtreme Legacy Interrupt Model
For reference, this section reviews the legacy NetXtreme interrupt model.
When the controller completes a transmit or a receive event, it updates a status block in host memory. This
status block contains information that tells the host which transmit buffers have been DMAed by the controller,
and which receive buffer descriptors (Rx BDs) have been consumed by a newly received packet. Normally, host
software checks this status block whenever an interrupt is generated. In addition, host software could also poll
the status block to determine whether it had been updated by the hardware since the last time it read the status
block (this is called during interrupt processing). The legacy status block format is shown in
.
Whenever the controller updates the status block, it decides whether to assert the interrupt line (INTA#). If MSI
were enabled, the controller would DMA the MSI data DWORD instead of asserting a line interrupt (or, in the
case of PCIe, instead of sending an assert interrupt message).
The controller has interrupt avoidance mechanisms (“host interrupt coalescing”) that allow the host to instruct
the controller not to generate an interrupt every time it writes a status block into host memory. In addition, it has
mechanisms that allow host software to control when and how often the status block is updated in host memory.
Since the status block updates and interrupt generation need not happen one-to-one, the following mechanism
is in place to communicate to host software if the status block was updated since it was last read by the host—
essentially avoiding race conditions:
1.
The controller DMAs the status block into host memory before a line interrupt or MSI is generated.
2.
The host interrupt service routine (ISR) reads an “update bit” at the top of the status block and checks
whether this bit is set to 1.
3.
When set to 1, the update bit of the status block indicates to host that the status block has been refreshed
by the controller.
4.
The ISR must then write a zero to clear/deassert this bit to dirty the status block, and then the ISR may
proceed to read the updated producer/consumer index pointers, etc.
5.
If the update bit is not set to 1, the interrupt may be considered as spurious and the ISR may wish to abort.
This mechanism allows host software to determine if the status block has been updated. Due to various
platform-dependent asynchronous timing issues, an ISR may occasionally see stale status block data. In this
case, the ISR may either spin and wait for the status block DMA to complete and explicitly flush the status block,
or just wait for the next line interrupt.
Table 88: NetXtreme Legacy Status Block Format
Offset
3116
150
0x00
Status Word
0x04
[31:8] Reserved 0x0
[7:0]Status Tag