Skip to content

Commit c0795bf

Browse files
ecree-solarflaredavem330
authored andcommitted
sfc: on MC reset, clear PIO buffer linkage in TXQs
Otherwise, if we fail to allocate new PIO buffers, our TXQs will try to use the old ones, which aren't there any more. Fixes: 183233b "sfc: Allocate and link PIO buffers; map them with write-combining" Signed-off-by: Edward Cree <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 217f97e commit c0795bf

File tree

1 file changed

+16
-0
lines changed
  • drivers/net/ethernet/sfc

1 file changed

+16
-0
lines changed

drivers/net/ethernet/sfc/ef10.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,17 @@ static int efx_ef10_link_piobufs(struct efx_nic *efx)
619619
return rc;
620620
}
621621

622+
static void efx_ef10_forget_old_piobufs(struct efx_nic *efx)
623+
{
624+
struct efx_channel *channel;
625+
struct efx_tx_queue *tx_queue;
626+
627+
/* All our existing PIO buffers went away */
628+
efx_for_each_channel(channel, efx)
629+
efx_for_each_channel_tx_queue(tx_queue, channel)
630+
tx_queue->piobuf = NULL;
631+
}
632+
622633
#else /* !EFX_USE_PIO */
623634

624635
static int efx_ef10_alloc_piobufs(struct efx_nic *efx, unsigned int n)
@@ -635,6 +646,10 @@ static void efx_ef10_free_piobufs(struct efx_nic *efx)
635646
{
636647
}
637648

649+
static void efx_ef10_forget_old_piobufs(struct efx_nic *efx)
650+
{
651+
}
652+
638653
#endif /* EFX_USE_PIO */
639654

640655
static void efx_ef10_remove(struct efx_nic *efx)
@@ -1018,6 +1033,7 @@ static void efx_ef10_reset_mc_allocations(struct efx_nic *efx)
10181033
nic_data->must_realloc_vis = true;
10191034
nic_data->must_restore_filters = true;
10201035
nic_data->must_restore_piobufs = true;
1036+
efx_ef10_forget_old_piobufs(efx);
10211037
nic_data->rx_rss_context = EFX_EF10_RSS_CONTEXT_INVALID;
10221038

10231039
/* Driver-created vswitches and vports must be re-created */

0 commit comments

Comments
 (0)