Commit dd0f9d89 authored by Murilo Fossa Vicentini's avatar Murilo Fossa Vicentini Committed by Jakub Kicinski

ibmvnic: Warn unknown speed message only when carrier is present

With commit 0655f994 ("net/ibmvnic: Update carrier state after link
state change") we are now able to detect when the carrier is properly
present in the device, so only report an unexpected unknown speed when it
is properly detected. Unknown speed is expected to be seen by the device
in case the backing device has no link detected.
Reported-by: default avatarAbdul Haleem <abdhalee@linux.vnet.ibm.com>
Tested-by: default avatarAbdul Haleem <abdhalee@linux.vnet.ibm.com>
Signed-off-by: default avatarMurilo Fossa Vicentini <muvic@linux.ibm.com>
Reviewed-by: default avatarThomas Falcon <tlfalcon@linux.ibm.com>
parent b47bea2b
...@@ -4312,13 +4312,14 @@ static int handle_query_phys_parms_rsp(union ibmvnic_crq *crq, ...@@ -4312,13 +4312,14 @@ static int handle_query_phys_parms_rsp(union ibmvnic_crq *crq,
{ {
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
int rc; int rc;
__be32 rspeed = cpu_to_be32(crq->query_phys_parms_rsp.speed);
rc = crq->query_phys_parms_rsp.rc.code; rc = crq->query_phys_parms_rsp.rc.code;
if (rc) { if (rc) {
netdev_err(netdev, "Error %d in QUERY_PHYS_PARMS\n", rc); netdev_err(netdev, "Error %d in QUERY_PHYS_PARMS\n", rc);
return rc; return rc;
} }
switch (cpu_to_be32(crq->query_phys_parms_rsp.speed)) { switch (rspeed) {
case IBMVNIC_10MBPS: case IBMVNIC_10MBPS:
adapter->speed = SPEED_10; adapter->speed = SPEED_10;
break; break;
...@@ -4344,8 +4345,8 @@ static int handle_query_phys_parms_rsp(union ibmvnic_crq *crq, ...@@ -4344,8 +4345,8 @@ static int handle_query_phys_parms_rsp(union ibmvnic_crq *crq,
adapter->speed = SPEED_100000; adapter->speed = SPEED_100000;
break; break;
default: default:
netdev_warn(netdev, "Unknown speed 0x%08x\n", if (netif_carrier_ok(netdev))
cpu_to_be32(crq->query_phys_parms_rsp.speed)); netdev_warn(netdev, "Unknown speed 0x%08x\n", rspeed);
adapter->speed = SPEED_UNKNOWN; adapter->speed = SPEED_UNKNOWN;
} }
if (crq->query_phys_parms_rsp.flags1 & IBMVNIC_FULL_DUPLEX) if (crq->query_phys_parms_rsp.flags1 & IBMVNIC_FULL_DUPLEX)
......
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