OSDN Git Service

ibmvnic: Handle all login error conditions
authorNathan Fontenot <nfont@linux.vnet.ibm.com>
Wed, 11 Apr 2018 15:09:32 +0000 (10:09 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 13 Apr 2018 01:51:53 +0000 (21:51 -0400)
commit64d92aa2c9fe490ceffc440d7648ce369cd6cc3c
tree124fa9e88d4af9110652d6d4d52e35fd318ad484
parent7dd07c143a4b54d050e748bee4b4b9e94a7b1744
ibmvnic: Handle all login error conditions

There is a bug in handling the possible return codes from sending the
login CRQ. The current code treats any non-success return value,
minus failure to send the crq and a timeout waiting for a login response,
as a need to re-send the login CRQ. This can put the drive in an
infinite loop of trying to login when getting return values other
that a partial success such as a return code of aborted. For these
scenarios the login will not ever succeed at this point and the
driver would need to be reset again.

To resolve this loop trying to login is updated to only retry the
login if the driver gets a return code of a partial success. Other
return codes are treated as an error and the driver returns an error
from ibmvnic_login().

To avoid infinite looping in the partial success return cases, the
number of retries is capped at the maximum number of supported
queues. This value was chosen because the driver does a renegotiation
of capabilities which sets the number of queues possible and allows
the driver to attempt a login for possible value for the number
of queues supported.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ibm/ibmvnic.c
drivers/net/ethernet/ibm/ibmvnic.h