···328328 * processing to finish, then directly poll (and ack ) the eventq.329329 * Finally reenable NAPI and interrupts.330330 *331331- * Since we are touching interrupts the caller should hold the suspend lock331331+ * This is for use only during a loopback self-test. It must not332332+ * deliver any packets up the stack as this can result in deadlock.332333 */333334void efx_process_channel_now(struct efx_channel *channel)334335{···337336338337 BUG_ON(channel->channel >= efx->n_channels);339338 BUG_ON(!channel->enabled);339339+ BUG_ON(!efx->loopback_selftest);340340341341 /* Disable interrupts and wait for ISRs to complete */342342 efx_nic_disable_interrupts(efx);···14381436 * restart the transmit interface early so the watchdog timer stops */14391437 efx_start_port(efx);1440143814411441- if (efx_dev_registered(efx))14391439+ if (efx_dev_registered(efx) && !efx->port_inhibited)14421440 netif_tx_wake_all_queues(efx->net_dev);1443144114441442 efx_for_each_channel(channel, efx)
···330330 * @eventq_mask: Event queue pointer mask331331 * @eventq_read_ptr: Event queue read pointer332332 * @last_eventq_read_ptr: Last event queue read pointer value.333333- * @magic_count: Event queue test event count334333 * @irq_count: Number of IRQs since last adaptive moderation decision335334 * @irq_mod_score: IRQ moderation score336335 * @rx_alloc_level: Watermark based heuristic counter for pushing descriptors···359360 unsigned int eventq_mask;360361 unsigned int eventq_read_ptr;361362 unsigned int last_eventq_read_ptr;362362- unsigned int magic_count;363363364364 unsigned int irq_count;365365 unsigned int irq_mod_score;
+15-7
drivers/net/sfc/nic.c
···8484static inline efx_qword_t *efx_event(struct efx_channel *channel,8585 unsigned int index)8686{8787- return ((efx_qword_t *) (channel->eventq.addr)) + index;8787+ return ((efx_qword_t *) (channel->eventq.addr)) +8888+ (index & channel->eventq_mask);8889}89909091/* See if an event is present···674673 efx_dword_t reg;675674 struct efx_nic *efx = channel->efx;676675677677- EFX_POPULATE_DWORD_1(reg, FRF_AZ_EVQ_RPTR, channel->eventq_read_ptr);676676+ EFX_POPULATE_DWORD_1(reg, FRF_AZ_EVQ_RPTR,677677+ channel->eventq_read_ptr & channel->eventq_mask);678678 efx_writed_table(efx, ®, efx->type->evq_rptr_tbl_base,679679 channel->channel);680680}···910908911909 code = EFX_QWORD_FIELD(*event, FSF_AZ_DRV_GEN_EV_MAGIC);912910 if (code == EFX_CHANNEL_MAGIC_TEST(channel))913913- ++channel->magic_count;911911+ ; /* ignore */914912 else if (code == EFX_CHANNEL_MAGIC_FILL(channel))915913 /* The queue must be empty, so we won't receive any rx916914 * events, so efx_process_channel() won't refill the···10171015 /* Clear this event by marking it all ones */10181016 EFX_SET_QWORD(*p_event);1019101710201020- /* Increment read pointer */10211021- read_ptr = (read_ptr + 1) & channel->eventq_mask;10181018+ ++read_ptr;1022101910231020 ev_code = EFX_QWORD_FIELD(event, FSF_AZ_EV_CODE);10241021···10611060 return spent;10621061}1063106210631063+/* Check whether an event is present in the eventq at the current10641064+ * read pointer. Only useful for self-test.10651065+ */10661066+bool efx_nic_event_present(struct efx_channel *channel)10671067+{10681068+ return efx_event_present(efx_event(channel, channel->eventq_read_ptr));10691069+}1064107010651071/* Allocate buffer table entries for event queue */10661072int efx_nic_probe_eventq(struct efx_channel *channel)···11731165 struct efx_tx_queue *tx_queue;11741166 struct efx_rx_queue *rx_queue;11751167 unsigned int read_ptr = channel->eventq_read_ptr;11761176- unsigned int end_ptr = (read_ptr - 1) & channel->eventq_mask;11681168+ unsigned int end_ptr = read_ptr + channel->eventq_mask - 1;1177116911781170 do {11791171 efx_qword_t *event = efx_event(channel, read_ptr);···12131205 * it's ok to throw away every non-flush event */12141206 EFX_SET_QWORD(*event);1215120712161216- read_ptr = (read_ptr + 1) & channel->eventq_mask;12081208+ ++read_ptr;12171209 } while (read_ptr != end_ptr);1218121012191211 channel->eventq_read_ptr = read_ptr;