From patchwork Mon Oct 12 09:10:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 270091 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MIME_HEADER_CTYPE_ONLY, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, T_TVD_MIME_NO_HEADERS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA9C7C433E7 for ; Mon, 12 Oct 2020 09:11:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9C31A208D5 for ; Mon, 12 Oct 2020 09:11:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="SL1sRvgW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729353AbgJLJLf (ORCPT ); Mon, 12 Oct 2020 05:11:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729307AbgJLJLX (ORCPT ); Mon, 12 Oct 2020 05:11:23 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5C82C0613CE for ; Mon, 12 Oct 2020 02:11:22 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id 10so3408338pfp.5 for ; Mon, 12 Oct 2020 02:11:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UU/g7YEFTk/ndn0PxJ17rq21QQR5DSWFBRCbBKIsEpA=; b=SL1sRvgWa6+s1iwq8JZXsmpZWspTsy/w7AwjL2U6+Jjc1AKFHcUfem9BSRA2NkXg7n bYr83RLxE5MGAf6gU9o8q5FJopp8Y7laW944SJ/4Doal6/htDkixl2Cv6ixpylu14B74 VabHjDiPJmbL8TyXGgKi8IgfBCLbM6ChR3BRI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=UU/g7YEFTk/ndn0PxJ17rq21QQR5DSWFBRCbBKIsEpA=; b=Kzr3LZvaiQQ+NPnMJTwaWARNgIZo5lierBxURa6pNkn1k+fWdNZ1L5JmkHh/3gjGWA Ma6WEu1RXE5tRoWWaC2tYd1/087icY5sUtbt4sQKiZGILvqIuwHVFxudxGVhUZqTYWmb 9i3ydjRvCjBsmTbir6P8/l8R6Xg71/fGt70za8ro2ssdSfbUodlyvFqKZ0spNKAMpfkt BAI5r8YYq3doIn3yLXOB65F5F1Al+5FW6e6wnrV7ztsPju/1Y6AxGLLyHjgaZk7hetI0 Sm5kxa8Sx4zQTLtg6wqdwMbTjooQ6yrd7PztfORz8D9DzV92nzg/rYDoK8rgwKp+Y+dc bVwg== X-Gm-Message-State: AOAM531i7XB8pmIuMrg1g3e7iucbhokLW5vHpoou3UmVuKS5cNOfZn5H dZI46z12nNVZd7m3T17fItJgqw== X-Google-Smtp-Source: ABdhPJw9ee3vg3kFOCf3w0N0sURIH8onF01wgwfsaPI9bcZBgbu911kyrp30KBRqUcoeGFU3nd3zjQ== X-Received: by 2002:a63:5446:: with SMTP id e6mr12365348pgm.415.1602493882314; Mon, 12 Oct 2020 02:11:22 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id jy19sm1275932pjb.9.2020.10.12.02.11.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Oct 2020 02:11:21 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org, gospo@broadcom.com Subject: [PATCH net-next v2 6/9] bnxt_en: Log unknown link speed appropriately. Date: Mon, 12 Oct 2020 05:10:51 -0400 Message-Id: <1602493854-29283-7-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602493854-29283-1-git-send-email-michael.chan@broadcom.com> References: <1602493854-29283-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Reviewed-by: Edwin Peer Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 877efaf302ad..78bf636e623b 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -8902,6 +8902,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 @@ -8914,7 +8919,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)