Skip to content

Commit

Permalink
bnxt_en: Log unknown link speed appropriately.
Browse files Browse the repository at this point in the history
[ Upstream commit 8eddb3e ]

If the VF virtual link is set to always enabled, the speed may be
unknown when the physical link is down.  The driver currently logs
the link speed as 4294967295 Mbps which is SPEED_UNKNOWN.  Modify
the link up log message as "speed unknown" which makes more sense.

Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/1602493854-29283-7-git-send-email-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Michael Chan authored and gregkh committed Nov 5, 2020
1 parent cb2c620 commit 0682461
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/ethernet/broadcom/bnxt/bnxt.c
Expand Up @@ -8735,6 +8735,11 @@ static void bnxt_report_link(struct bnxt *bp)
u16 fec;

netif_carrier_on(bp->dev);
speed = bnxt_fw_to_ethtool_speed(bp->link_info.link_speed);
if (speed == SPEED_UNKNOWN) {
netdev_info(bp->dev, "NIC Link is Up, speed unknown\n");
return;
}
if (bp->link_info.duplex == BNXT_LINK_DUPLEX_FULL)
duplex = "full";
else
Expand All @@ -8747,7 +8752,6 @@ static void bnxt_report_link(struct bnxt *bp)
flow_ctrl = "ON - receive";
else
flow_ctrl = "none";
speed = bnxt_fw_to_ethtool_speed(bp->link_info.link_speed);
netdev_info(bp->dev, "NIC Link is Up, %u Mbps %s duplex, Flow control: %s\n",
speed, duplex, flow_ctrl);
if (bp->flags & BNXT_FLAG_EEE_CAP)
Expand Down

0 comments on commit 0682461

Please sign in to comment.