April 2012
Intermediate to advanced
352 pages
8h
English
Whenever an interface transmits a packet, it sends an interrupt. Naturally, this causes its interrupt handler to execute. Here is what executes in em(4):
static void
em_msix_tx(void *arg)
{
struct tx_ring *txr = arg;
struct adapter *adapter = txr->adapter;
bool more;
++txr->tx_irq;
EM_TX_LOCK(txr);
more =
em_txeof(txr);
EM_TX_UNLOCK(txr);
if (more)
taskqueue_enqueue(txr->tq, &txr->tx_task);
else
E1000_WRITE_REG(&adapter->hw, E1000_IMS, txr->ims);
}Because of MSI, em(4) can use a different interrupt handler for post packet ...