Skip to content

Commit ab97a28

Browse files
committed
Merge branch 'sfc-more-EF100-fixes'
Edward Cree says: ==================== sfc: more EF100 fixes Fix up some bugs in the initial EF100 submission, and re-fix the hash_valid fix which was incomplete. The reset bugs are currently hard to trigger; they were found with an in-progress patch adding ethtool support, whereby ethtool --reset reliably reproduces them. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 8b61fba + e6a4391 commit ab97a28

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

drivers/net/ethernet/sfc/ef100_nic.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -431,18 +431,18 @@ static int ef100_reset(struct efx_nic *efx, enum reset_type reset_type)
431431
/* A RESET_TYPE_ALL will cause filters to be removed, so we remove filters
432432
* and reprobe after reset to avoid removing filters twice
433433
*/
434-
down_read(&efx->filter_sem);
434+
down_write(&efx->filter_sem);
435435
ef100_filter_table_down(efx);
436-
up_read(&efx->filter_sem);
436+
up_write(&efx->filter_sem);
437437
rc = efx_mcdi_reset(efx, reset_type);
438438
if (rc)
439439
return rc;
440440

441441
netif_device_attach(efx->net_dev);
442442

443-
down_read(&efx->filter_sem);
443+
down_write(&efx->filter_sem);
444444
rc = ef100_filter_table_up(efx);
445-
up_read(&efx->filter_sem);
445+
up_write(&efx->filter_sem);
446446
if (rc)
447447
return rc;
448448

@@ -739,6 +739,7 @@ const struct efx_nic_type ef100_pf_nic_type = {
739739
.rx_remove = efx_mcdi_rx_remove,
740740
.rx_write = ef100_rx_write,
741741
.rx_packet = __ef100_rx_packet,
742+
.rx_buf_hash_valid = ef100_rx_buf_hash_valid,
742743
.fini_dmaq = efx_fini_dmaq,
743744
.max_rx_ip_filters = EFX_MCDI_FILTER_TBL_ROWS,
744745
.filter_table_probe = ef100_filter_table_up,
@@ -820,6 +821,7 @@ const struct efx_nic_type ef100_vf_nic_type = {
820821
.rx_remove = efx_mcdi_rx_remove,
821822
.rx_write = ef100_rx_write,
822823
.rx_packet = __ef100_rx_packet,
824+
.rx_buf_hash_valid = ef100_rx_buf_hash_valid,
823825
.fini_dmaq = efx_fini_dmaq,
824826
.max_rx_ip_filters = EFX_MCDI_FILTER_TBL_ROWS,
825827
.filter_table_probe = ef100_filter_table_up,

drivers/net/ethernet/sfc/net_driver.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,7 @@ struct efx_async_filter_insertion {
846846
* @timer_quantum_ns: Interrupt timer quantum, in nanoseconds
847847
* @timer_max_ns: Interrupt timer maximum value, in nanoseconds
848848
* @irq_rx_adaptive: Adaptive IRQ moderation enabled for RX event queues
849+
* @irqs_hooked: Channel interrupts are hooked
849850
* @irq_rx_mod_step_us: Step size for IRQ moderation for RX event queues
850851
* @irq_rx_moderation_us: IRQ moderation time for RX event queues
851852
* @msg_enable: Log message enable flags
@@ -1004,6 +1005,7 @@ struct efx_nic {
10041005
unsigned int timer_quantum_ns;
10051006
unsigned int timer_max_ns;
10061007
bool irq_rx_adaptive;
1008+
bool irqs_hooked;
10071009
unsigned int irq_mod_step_us;
10081010
unsigned int irq_rx_moderation_us;
10091011
u32 msg_enable;

drivers/net/ethernet/sfc/nic.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ int efx_nic_init_interrupt(struct efx_nic *efx)
129129
#endif
130130
}
131131

132+
efx->irqs_hooked = true;
132133
return 0;
133134

134135
fail2:
@@ -154,6 +155,8 @@ void efx_nic_fini_interrupt(struct efx_nic *efx)
154155
efx->net_dev->rx_cpu_rmap = NULL;
155156
#endif
156157

158+
if (!efx->irqs_hooked)
159+
return;
157160
if (EFX_INT_MODE_USE_MSI(efx)) {
158161
/* Disable MSI/MSI-X interrupts */
159162
efx_for_each_channel(channel, efx)
@@ -163,6 +166,7 @@ void efx_nic_fini_interrupt(struct efx_nic *efx)
163166
/* Disable legacy interrupt */
164167
free_irq(efx->legacy_irq, efx);
165168
}
169+
efx->irqs_hooked = false;
166170
}
167171

168172
/* Register dump */

drivers/net/ethernet/sfc/rx_common.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,7 @@ void efx_remove_filters(struct efx_nic *efx)
849849
efx_for_each_channel(channel, efx) {
850850
cancel_delayed_work_sync(&channel->filter_work);
851851
kfree(channel->rps_flow_id);
852+
channel->rps_flow_id = NULL;
852853
}
853854
#endif
854855
down_write(&efx->filter_sem);

0 commit comments

Comments
 (0)