netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ibmvnic: Clean RX pools only during a hard reset
@ 2018-02-18 16:08 Thomas Falcon
  2018-02-18 16:08 ` [PATCH net-next] ibmvnic: Keep track of supplementary TX descriptors Thomas Falcon
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Thomas Falcon @ 2018-02-18 16:08 UTC (permalink / raw)
  To: netdev; +Cc: nfont, jallen, Thomas Falcon

Sorry, this fixes a bug in commit d0869c0071e4. The cause of the
bug is that "stale" RX buffers containing packet data are returned
to the driver after device close and open. While most buffers will be
returned with an error and handled by the polling routine, some buffers
will be returned as containing valid data. Unfortunately, the socket
buffers allocated were already freed when the device was closed, so
attempts to process them result in a panic.

RX pools still need to be cleaned in some cases, such as during
a fatal reset. In all other cases, the socket buffers will either
be freed in the polling routine or processed by the kernel.

Fixes: d0869c0071e4 ("ibmvnic: Clean RX pool buffers during device close")
Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 996f475..6710313 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -1179,7 +1179,9 @@ static int __ibmvnic_close(struct net_device *netdev)
 			}
 		}
 	}
-	clean_rx_pools(adapter);
+	if (unlikely(adapter->resetting &&
+		     adapter->reset_reason != VNIC_RESET_NON_FATAL))
+		clean_rx_pools(adapter);
 	clean_tx_pools(adapter);
 	adapter->state = VNIC_CLOSED;
 	return rc;
-- 
2.7.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-02-20 18:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-18 16:08 [PATCH net] ibmvnic: Clean RX pools only during a hard reset Thomas Falcon
2018-02-18 16:08 ` [PATCH net-next] ibmvnic: Keep track of supplementary TX descriptors Thomas Falcon
2018-02-20 18:20   ` David Miller
2018-02-19 16:37 ` [PATCH net] ibmvnic: Clean RX pools only during a hard reset David Miller
2018-02-19 19:24   ` Thomas Falcon
2018-02-19 19:30     ` David Miller
2018-02-19 20:01       ` Thomas Falcon
2018-02-20  2:12 ` [PATCH net v2] ibmvnic: Check for NULL skb's in NAPI poll routine Thomas Falcon

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).