enum { /* Revisions 0-3 were Falcon A0, A1, B0 and Siena respectively. * They are not supported by this driver but these revision numbers * form part of the ethtool API for register dumping.
*/
EFX_REV_HUNT_A0 = 4,
EFX_REV_EF100 = 5,
EFX_REV_X4 = 6,
};
/* 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.addr)) +
(index & channel->eventq_mask);
}
/* See if an event is present * * We check both the high and low dword of the event for all ones. We * wrote all ones when we cleared the event, and no valid event can * have all ones in either its high or low dwords. This approach is * robust against reordering. * * Note that using a single 64-bit comparison is incorrect; even * though the CPU read will be atomic, the DMA write may not be.
*/ 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 * descriptor queue belonging to the specified channel.
*/ staticinline efx_qword_t *
efx_tx_desc(struct efx_tx_queue *tx_queue, unsignedint index)
{ return ((efx_qword_t *)(tx_queue->txd.addr)) + index;
}
/* Report whether this TX queue would be empty for the given write_count. * May return false negative.
*/ 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);
int efx_enqueue_skb_tso(struct efx_tx_queue *tx_queue, struct sk_buff *skb, bool *data_mapped);
/* Decide whether to push a TX descriptor to the NIC vs merely writing * the doorbell. This can reduce latency when we are adding a single * descriptor to an empty queue, but is otherwise pointless. * We use the write_count used for the last doorbell push, to get the * NIC's view of the tx queue.
*/ staticinlinebool efx_nic_may_push_tx_desc(struct efx_tx_queue *tx_queue, unsignedint write_count)
{ bool was_empty = efx_nic_tx_is_empty(tx_queue, write_count);
/* Some statistics are computed as A - B where A and B each increase * linearly with some hardware counter(s) and the counters are read * asynchronously. If the counters contributing to B are always read * after those contributing to A, the computed value may be lower than * the true value by some variable amount, and may decrease between * subsequent computations. * * We should never allow statistics to decrease or to exceed the true * value. Since the computed value will never be greater than the * true value, we can achieve this by only storing the computed value * when it increases.
*/ staticinlinevoid efx_update_diff_stat(u64 *stat, u64 diff)
{ if ((s64)(diff - *stat) > 0)
*stat = diff;
}
/* Interrupts */ int efx_nic_init_interrupt(struct efx_nic *efx); int efx_nic_irq_test_start(struct efx_nic *efx); void efx_nic_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.