Skip to content

Commit 8cb31cf

Browse files
jallen93davem330
authored andcommitted
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: John Allen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 10f7621 commit 8cb31cf

File tree

2 files changed

+32
-25
lines changed

2 files changed

+32
-25
lines changed

drivers/net/ethernet/ibm/ibmvnic.c

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,37 +1225,41 @@ static int do_reset(struct ibmvnic_adapter *adapter,
12251225
if (rc)
12261226
return rc;
12271227

1228-
/* remove the closed state so when we call open it appears
1229-
* we are coming from the probed state.
1230-
*/
1231-
adapter->state = VNIC_PROBED;
1228+
if (adapter->reset_reason != VNIC_RESET_NON_FATAL) {
1229+
/* remove the closed state so when we call open it appears
1230+
* we are coming from the probed state.
1231+
*/
1232+
adapter->state = VNIC_PROBED;
12321233

1233-
release_resources(adapter);
1234-
release_sub_crqs(adapter);
1235-
release_crq_queue(adapter);
1234+
release_resources(adapter);
1235+
release_sub_crqs(adapter);
1236+
release_crq_queue(adapter);
12361237

1237-
rc = ibmvnic_init(adapter);
1238-
if (rc)
1239-
return 0;
1238+
rc = ibmvnic_init(adapter);
1239+
if (rc)
1240+
return 0;
12401241

1241-
/* If the adapter was in PROBE state prior to the reset, exit here. */
1242-
if (reset_state == VNIC_PROBED)
1243-
return 0;
1242+
/* If the adapter was in PROBE state prior to the reset,
1243+
* exit here.
1244+
*/
1245+
if (reset_state == VNIC_PROBED)
1246+
return 0;
12441247

1245-
rc = ibmvnic_login(netdev);
1246-
if (rc) {
1247-
adapter->state = VNIC_PROBED;
1248-
return 0;
1249-
}
1248+
rc = ibmvnic_login(netdev);
1249+
if (rc) {
1250+
adapter->state = VNIC_PROBED;
1251+
return 0;
1252+
}
12501253

1251-
rtnl_lock();
1252-
rc = init_resources(adapter);
1253-
rtnl_unlock();
1254-
if (rc)
1255-
return rc;
1254+
rtnl_lock();
1255+
rc = init_resources(adapter);
1256+
rtnl_unlock();
1257+
if (rc)
1258+
return rc;
12561259

1257-
if (reset_state == VNIC_CLOSED)
1258-
return 0;
1260+
if (reset_state == VNIC_CLOSED)
1261+
return 0;
1262+
}
12591263

12601264
rc = __ibmvnic_open(netdev);
12611265
if (rc) {
@@ -2763,6 +2767,8 @@ static void handle_error_indication(union ibmvnic_crq *crq,
27632767

27642768
if (crq->error_indication.flags & IBMVNIC_FATAL_ERROR)
27652769
ibmvnic_reset(adapter, VNIC_RESET_FATAL);
2770+
else
2771+
ibmvnic_reset(adapter, VNIC_RESET_NON_FATAL);
27662772
}
27672773

27682774
static void handle_change_mac_rsp(union ibmvnic_crq *crq,

drivers/net/ethernet/ibm/ibmvnic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,7 @@ enum vnic_state {VNIC_PROBING = 1,
925925
enum ibmvnic_reset_reason {VNIC_RESET_FAILOVER = 1,
926926
VNIC_RESET_MOBILITY,
927927
VNIC_RESET_FATAL,
928+
VNIC_RESET_NON_FATAL,
928929
VNIC_RESET_TIMEOUT};
929930

930931
struct ibmvnic_rwi {

0 commit comments

Comments
 (0)