/* Read the current event from the event queue */ staticinline efx_qword_t *efx_event(struct efx_channel *channel, unsignedint index)
{ return ((efx_qword_t *) (channel->eventq.buf.addr)) +
(index & channel->eventq_mask);
}
/* See if an event is present * *Wecheckboththehighandlowdwordoftheeventforallones.We *wrotealloneswhenweclearedtheevent,andnovalideventcan *haveallonesineitheritshighorlowdwords.Thisapproachis *robustagainstreordering. * *Notethatusingasingle64-bitcomparisonisincorrect;even *thoughtheCPUreadwillbeatomic,theDMAwritemaynotbe.
*/ staticinlineint efx_event_present(efx_qword_t *event)
{ return !(EFX_DWORD_IS_ALL_ONES(event->dword[0]) |
EFX_DWORD_IS_ALL_ONES(event->dword[1]));
}
/* Returns a pointer to the specified transmit descriptor in the TX *descriptorqueuebelongingtothespecifiedchannel.
*/ staticinline efx_qword_t *
efx_tx_desc(struct efx_tx_queue *tx_queue, unsignedint index)
{ return ((efx_qword_t *) (tx_queue->txd.buf.addr)) + index;
}
/* Report whether this TX queue would be empty for the given write_count. *Mayreturnfalsenegative.
*/ staticinlinebool efx_nic_tx_is_empty(struct efx_tx_queue *tx_queue, unsignedint write_count)
{ unsignedint empty_read_count = READ_ONCE(tx_queue->empty_read_count);
/* Some statistics are computed as A - B where A and B each increase *linearlywithsomehardwarecounter(s)andthecountersareread *asynchronously.IfthecounterscontributingtoBarealwaysread *afterthosecontributingtoA,thecomputedvaluemaybelowerthan *thetruevaluebysomevariableamount,andmaydecreasebetween *subsequentcomputations. * *Weshouldneverallowstatisticstodecreaseortoexceedthetrue *value.Sincethecomputedvaluewillneverbegreaterthanthe *truevalue,wecanachievethisbyonlystoringthecomputedvalue *whenitincreases.
*/ staticinlinevoid efx_update_diff_stat(u64 *stat, u64 diff)
{ if ((s64)(diff - *stat) > 0)
*stat = diff;
}
/* Interrupts */ int efx_siena_init_interrupt(struct efx_nic *efx); int efx_siena_irq_test_start(struct efx_nic *efx); void efx_siena_fini_interrupt(struct efx_nic *efx);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.