Skip to content

Commit eb11041

Browse files
tlfalcondavem330
authored andcommitted
ibmvnic: Fix partial success login retries
In its current state, the driver will handle backing device login in a loop for a certain number of retries while the device returns a partial success, indicating that the driver may need to try again using a smaller number of resources. The variable it checks to continue retrying may change over the course of operations, resulting in reallocation of resources but exits without sending the login attempt. Guard against this by introducing a boolean variable that will retain the state indicating that the driver needs to reattempt login with backing device firmware. Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent d2f30f5 commit eb11041

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/net/ethernet/ibm/ibmvnic.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,9 +796,11 @@ static int ibmvnic_login(struct net_device *netdev)
796796
struct ibmvnic_adapter *adapter = netdev_priv(netdev);
797797
unsigned long timeout = msecs_to_jiffies(30000);
798798
int retry_count = 0;
799+
bool retry;
799800
int rc;
800801

801802
do {
803+
retry = false;
802804
if (retry_count > IBMVNIC_MAX_QUEUES) {
803805
netdev_warn(netdev, "Login attempts exceeded\n");
804806
return -1;
@@ -822,6 +824,9 @@ static int ibmvnic_login(struct net_device *netdev)
822824
retry_count++;
823825
release_sub_crqs(adapter, 1);
824826

827+
retry = true;
828+
netdev_dbg(netdev,
829+
"Received partial success, retrying...\n");
825830
adapter->init_done_rc = 0;
826831
reinit_completion(&adapter->init_done);
827832
send_cap_queries(adapter);
@@ -849,7 +854,7 @@ static int ibmvnic_login(struct net_device *netdev)
849854
netdev_warn(netdev, "Adapter login failed\n");
850855
return -1;
851856
}
852-
} while (adapter->init_done_rc == PARTIALSUCCESS);
857+
} while (retry);
853858

854859
/* handle pending MAC address changes after successful login */
855860
if (adapter->mac_change_pending) {

0 commit comments

Comments
 (0)