netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/3] ibmvnic: Fixes for device reset handling
@ 2019-06-07 21:03 Thomas Falcon
  2019-06-07 21:03 ` [PATCH net 1/3] ibmvnic: Do not close unopened driver during reset Thomas Falcon
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Thomas Falcon @ 2019-06-07 21:03 UTC (permalink / raw)
  To: netdev; +Cc: linuxppc-dev, Thomas Falcon

This series contains three unrelated fixes to issues seen during
device resets. The first patch fixes an error when the driver requests
to deactivate the link of an uninitialized device, resulting in a 
failure to reset. Next, a patch to fix multicast transmission 
failures seen after a driver reset. The final patch fixes mishandling
of memory allocation failures during device initialization, which
caused a kernel oops.

Thomas Falcon (3):
  ibmvnic: Do not close unopened driver during reset
  ibmvnic: Refresh device multicast list after reset
  ibmvnic: Fix unchecked return codes of memory allocations

 drivers/net/ethernet/ibm/ibmvnic.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

-- 
1.8.3.1


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

* [PATCH net 1/3] ibmvnic: Do not close unopened driver during reset
  2019-06-07 21:03 [PATCH net 0/3] ibmvnic: Fixes for device reset handling Thomas Falcon
@ 2019-06-07 21:03 ` Thomas Falcon
  2019-06-07 21:03 ` [PATCH net 2/3] ibmvnic: Refresh device multicast list after reset Thomas Falcon
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Falcon @ 2019-06-07 21:03 UTC (permalink / raw)
  To: netdev; +Cc: linuxppc-dev, Thomas Falcon

Check driver state before halting it during a reset. If the driver is
not running, do nothing. Otherwise, a request to deactivate a down link
can cause an error and the reset will fail.

Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 3da392b..bc2a912 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -1745,7 +1745,8 @@ static int do_reset(struct ibmvnic_adapter *adapter,
 
 	ibmvnic_cleanup(netdev);
 
-	if (adapter->reset_reason != VNIC_RESET_MOBILITY &&
+	if (reset_state == VNIC_OPEN &&
+	    adapter->reset_reason != VNIC_RESET_MOBILITY &&
 	    adapter->reset_reason != VNIC_RESET_FAILOVER) {
 		rc = __ibmvnic_close(netdev);
 		if (rc)
-- 
1.8.3.1


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

* [PATCH net 2/3] ibmvnic: Refresh device multicast list after reset
  2019-06-07 21:03 [PATCH net 0/3] ibmvnic: Fixes for device reset handling Thomas Falcon
  2019-06-07 21:03 ` [PATCH net 1/3] ibmvnic: Do not close unopened driver during reset Thomas Falcon
@ 2019-06-07 21:03 ` Thomas Falcon
  2019-06-07 21:03 ` [PATCH net 3/3] ibmvnic: Fix unchecked return codes of memory allocations Thomas Falcon
  2019-06-10  2:51 ` [PATCH net 0/3] ibmvnic: Fixes for device reset handling David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Falcon @ 2019-06-07 21:03 UTC (permalink / raw)
  To: netdev; +Cc: linuxppc-dev, Thomas Falcon

It was observed that multicast packets were no longer received after
a device reset.  The fix is to resend the current multicast list to
the backing device after recovery.

Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index bc2a912..9e9f409 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -1845,6 +1845,9 @@ static int do_reset(struct ibmvnic_adapter *adapter,
 		return 0;
 	}
 
+	/* refresh device's multicast list */
+	ibmvnic_set_multi(netdev);
+
 	/* kick napi */
 	for (i = 0; i < adapter->req_rx_queues; i++)
 		napi_schedule(&adapter->napi[i]);
-- 
1.8.3.1


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

* [PATCH net 3/3] ibmvnic: Fix unchecked return codes of memory allocations
  2019-06-07 21:03 [PATCH net 0/3] ibmvnic: Fixes for device reset handling Thomas Falcon
  2019-06-07 21:03 ` [PATCH net 1/3] ibmvnic: Do not close unopened driver during reset Thomas Falcon
  2019-06-07 21:03 ` [PATCH net 2/3] ibmvnic: Refresh device multicast list after reset Thomas Falcon
@ 2019-06-07 21:03 ` Thomas Falcon
  2019-06-10  2:51 ` [PATCH net 0/3] ibmvnic: Fixes for device reset handling David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Falcon @ 2019-06-07 21:03 UTC (permalink / raw)
  To: netdev; +Cc: linuxppc-dev, Thomas Falcon

The return values for these memory allocations are unchecked,
which may cause an oops if the driver does not handle them after
a failure. Fix by checking the function's return code.

Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 9e9f409..3da6800 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -428,9 +428,10 @@ static int reset_rx_pools(struct ibmvnic_adapter *adapter)
 		if (rx_pool->buff_size != be64_to_cpu(size_array[i])) {
 			free_long_term_buff(adapter, &rx_pool->long_term_buff);
 			rx_pool->buff_size = be64_to_cpu(size_array[i]);
-			alloc_long_term_buff(adapter, &rx_pool->long_term_buff,
-					     rx_pool->size *
-					     rx_pool->buff_size);
+			rc = alloc_long_term_buff(adapter,
+						  &rx_pool->long_term_buff,
+						  rx_pool->size *
+						  rx_pool->buff_size);
 		} else {
 			rc = reset_long_term_buff(adapter,
 						  &rx_pool->long_term_buff);
@@ -696,9 +697,9 @@ static int init_tx_pools(struct net_device *netdev)
 			return rc;
 		}
 
-		init_one_tx_pool(netdev, &adapter->tso_pool[i],
-				 IBMVNIC_TSO_BUFS,
-				 IBMVNIC_TSO_BUF_SZ);
+		rc = init_one_tx_pool(netdev, &adapter->tso_pool[i],
+				      IBMVNIC_TSO_BUFS,
+				      IBMVNIC_TSO_BUF_SZ);
 		if (rc) {
 			release_tx_pools(adapter);
 			return rc;
-- 
1.8.3.1


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

* Re: [PATCH net 0/3] ibmvnic: Fixes for device reset handling
  2019-06-07 21:03 [PATCH net 0/3] ibmvnic: Fixes for device reset handling Thomas Falcon
                   ` (2 preceding siblings ...)
  2019-06-07 21:03 ` [PATCH net 3/3] ibmvnic: Fix unchecked return codes of memory allocations Thomas Falcon
@ 2019-06-10  2:51 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2019-06-10  2:51 UTC (permalink / raw)
  To: tlfalcon; +Cc: netdev, linuxppc-dev

From: Thomas Falcon <tlfalcon@linux.ibm.com>
Date: Fri,  7 Jun 2019 16:03:52 -0500

> This series contains three unrelated fixes to issues seen during
> device resets. The first patch fixes an error when the driver requests
> to deactivate the link of an uninitialized device, resulting in a 
> failure to reset. Next, a patch to fix multicast transmission 
> failures seen after a driver reset. The final patch fixes mishandling
> of memory allocation failures during device initialization, which
> caused a kernel oops.

Series applied, thanks.

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

end of thread, other threads:[~2019-06-10  2:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-07 21:03 [PATCH net 0/3] ibmvnic: Fixes for device reset handling Thomas Falcon
2019-06-07 21:03 ` [PATCH net 1/3] ibmvnic: Do not close unopened driver during reset Thomas Falcon
2019-06-07 21:03 ` [PATCH net 2/3] ibmvnic: Refresh device multicast list after reset Thomas Falcon
2019-06-07 21:03 ` [PATCH net 3/3] ibmvnic: Fix unchecked return codes of memory allocations Thomas Falcon
2019-06-10  2:51 ` [PATCH net 0/3] ibmvnic: Fixes for device reset handling 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).