* [PATCH net] sfc: on MC reset, clear PIO buffer linkage in TXQs
@ 2016-05-24 17:53 Edward Cree
2016-05-25 19:44 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Edward Cree @ 2016-05-24 17:53 UTC (permalink / raw)
To: linux-net-drivers, davem, netdev
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: 183233bec810 "sfc: Allocate and link PIO buffers; map them with write-combining"
Signed-off-by: Edward Cree <ecree@solarflare.com>
---
drivers/net/ethernet/sfc/ef10.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index 1681084..1f30912 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -619,6 +619,17 @@ fail:
return rc;
}
+static void efx_ef10_forget_old_piobufs(struct efx_nic *efx)
+{
+ struct efx_channel *channel;
+ struct efx_tx_queue *tx_queue;
+
+ /* All our existing PIO buffers went away */
+ efx_for_each_channel(channel, efx)
+ efx_for_each_channel_tx_queue(tx_queue, channel)
+ tx_queue->piobuf = NULL;
+}
+
#else /* !EFX_USE_PIO */
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)
{
}
+static void efx_ef10_forget_old_piobufs(struct efx_nic *efx)
+{
+}
+
#endif /* EFX_USE_PIO */
static void efx_ef10_remove(struct efx_nic *efx)
@@ -1018,6 +1033,7 @@ static void efx_ef10_reset_mc_allocations(struct efx_nic *efx)
nic_data->must_realloc_vis = true;
nic_data->must_restore_filters = true;
nic_data->must_restore_piobufs = true;
+ efx_ef10_forget_old_piobufs(efx);
nic_data->rx_rss_context = EFX_EF10_RSS_CONTEXT_INVALID;
/* Driver-created vswitches and vports must be re-created */
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] sfc: on MC reset, clear PIO buffer linkage in TXQs
2016-05-24 17:53 [PATCH net] sfc: on MC reset, clear PIO buffer linkage in TXQs Edward Cree
@ 2016-05-25 19:44 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-05-25 19:44 UTC (permalink / raw)
To: ecree; +Cc: linux-net-drivers, netdev
From: Edward Cree <ecree@solarflare.com>
Date: Tue, 24 May 2016 18:53:36 +0100
> 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: 183233bec810 "sfc: Allocate and link PIO buffers; map them with write-combining"
> Signed-off-by: Edward Cree <ecree@solarflare.com>
Applied and queued up for -stable.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-25 19:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-24 17:53 [PATCH net] sfc: on MC reset, clear PIO buffer linkage in TXQs Edward Cree
2016-05-25 19:44 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).