]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.4.14/sfc-on-mc-reset-clear-pio-buffer-linkage-in-txqs.patch
drop queue-4.14/mips-make-sure-dt-memory-regions-are-valid.patch
[thirdparty/kernel/stable-queue.git] / releases / 4.4.14 / sfc-on-mc-reset-clear-pio-buffer-linkage-in-txqs.patch
1 From foo@baz Fri Jun 17 11:18:18 PDT 2016
2 From: Edward Cree <ecree@solarflare.com>
3 Date: Tue, 24 May 2016 18:53:36 +0100
4 Subject: sfc: on MC reset, clear PIO buffer linkage in TXQs
5
6 From: Edward Cree <ecree@solarflare.com>
7
8 [ Upstream commit c0795bf64cba4d1b796fdc5b74b33772841ed1bb ]
9
10 Otherwise, if we fail to allocate new PIO buffers, our TXQs will try to
11 use the old ones, which aren't there any more.
12
13 Fixes: 183233bec810 "sfc: Allocate and link PIO buffers; map them with write-combining"
14 Signed-off-by: Edward Cree <ecree@solarflare.com>
15 Signed-off-by: David S. Miller <davem@davemloft.net>
16 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17 ---
18 drivers/net/ethernet/sfc/ef10.c | 16 ++++++++++++++++
19 1 file changed, 16 insertions(+)
20
21 --- a/drivers/net/ethernet/sfc/ef10.c
22 +++ b/drivers/net/ethernet/sfc/ef10.c
23 @@ -619,6 +619,17 @@ fail:
24 return rc;
25 }
26
27 +static void efx_ef10_forget_old_piobufs(struct efx_nic *efx)
28 +{
29 + struct efx_channel *channel;
30 + struct efx_tx_queue *tx_queue;
31 +
32 + /* All our existing PIO buffers went away */
33 + efx_for_each_channel(channel, efx)
34 + efx_for_each_channel_tx_queue(tx_queue, channel)
35 + tx_queue->piobuf = NULL;
36 +}
37 +
38 #else /* !EFX_USE_PIO */
39
40 static int efx_ef10_alloc_piobufs(struct efx_nic *efx, unsigned int n)
41 @@ -635,6 +646,10 @@ static void efx_ef10_free_piobufs(struct
42 {
43 }
44
45 +static void efx_ef10_forget_old_piobufs(struct efx_nic *efx)
46 +{
47 +}
48 +
49 #endif /* EFX_USE_PIO */
50
51 static void efx_ef10_remove(struct efx_nic *efx)
52 @@ -1018,6 +1033,7 @@ static void efx_ef10_reset_mc_allocation
53 nic_data->must_realloc_vis = true;
54 nic_data->must_restore_filters = true;
55 nic_data->must_restore_piobufs = true;
56 + efx_ef10_forget_old_piobufs(efx);
57 nic_data->rx_rss_context = EFX_EF10_RSS_CONTEXT_INVALID;
58
59 /* Driver-created vswitches and vports must be re-created */