Commit 8cb31cfc authored by John Allen's avatar John Allen Committed by David S. Miller

ibmvnic: Non-fatal error handling

Handle non-fatal error conditions. The process to do this when
resetting the driver is to just do __ibmvnic_close followed by
__ibmvnic_open.
Signed-off-by: default avatarJohn Allen <jallen@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 10f76215
...@@ -1225,6 +1225,7 @@ static int do_reset(struct ibmvnic_adapter *adapter, ...@@ -1225,6 +1225,7 @@ static int do_reset(struct ibmvnic_adapter *adapter,
if (rc) if (rc)
return rc; return rc;
if (adapter->reset_reason != VNIC_RESET_NON_FATAL) {
/* remove the closed state so when we call open it appears /* remove the closed state so when we call open it appears
* we are coming from the probed state. * we are coming from the probed state.
*/ */
...@@ -1238,7 +1239,9 @@ static int do_reset(struct ibmvnic_adapter *adapter, ...@@ -1238,7 +1239,9 @@ static int do_reset(struct ibmvnic_adapter *adapter,
if (rc) if (rc)
return 0; return 0;
/* If the adapter was in PROBE state prior to the reset, exit here. */ /* If the adapter was in PROBE state prior to the reset,
* exit here.
*/
if (reset_state == VNIC_PROBED) if (reset_state == VNIC_PROBED)
return 0; return 0;
...@@ -1256,6 +1259,7 @@ static int do_reset(struct ibmvnic_adapter *adapter, ...@@ -1256,6 +1259,7 @@ static int do_reset(struct ibmvnic_adapter *adapter,
if (reset_state == VNIC_CLOSED) if (reset_state == VNIC_CLOSED)
return 0; return 0;
}
rc = __ibmvnic_open(netdev); rc = __ibmvnic_open(netdev);
if (rc) { if (rc) {
...@@ -2763,6 +2767,8 @@ static void handle_error_indication(union ibmvnic_crq *crq, ...@@ -2763,6 +2767,8 @@ static void handle_error_indication(union ibmvnic_crq *crq,
if (crq->error_indication.flags & IBMVNIC_FATAL_ERROR) if (crq->error_indication.flags & IBMVNIC_FATAL_ERROR)
ibmvnic_reset(adapter, VNIC_RESET_FATAL); ibmvnic_reset(adapter, VNIC_RESET_FATAL);
else
ibmvnic_reset(adapter, VNIC_RESET_NON_FATAL);
} }
static void handle_change_mac_rsp(union ibmvnic_crq *crq, static void handle_change_mac_rsp(union ibmvnic_crq *crq,
......
...@@ -925,6 +925,7 @@ enum vnic_state {VNIC_PROBING = 1, ...@@ -925,6 +925,7 @@ enum vnic_state {VNIC_PROBING = 1,
enum ibmvnic_reset_reason {VNIC_RESET_FAILOVER = 1, enum ibmvnic_reset_reason {VNIC_RESET_FAILOVER = 1,
VNIC_RESET_MOBILITY, VNIC_RESET_MOBILITY,
VNIC_RESET_FATAL, VNIC_RESET_FATAL,
VNIC_RESET_NON_FATAL,
VNIC_RESET_TIMEOUT}; VNIC_RESET_TIMEOUT};
struct ibmvnic_rwi { struct ibmvnic_rwi {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment