From patchwork Sun Oct 11 10:22:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 11830815 X-Patchwork-Delegate: kuba@kernel.org 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 977B1C433DF for ; Sun, 11 Oct 2020 10:23:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 55C782083B for ; Sun, 11 Oct 2020 10:23:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="AGzF91p1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729694AbgJKKXl (ORCPT ); Sun, 11 Oct 2020 06:23:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729603AbgJKKX1 (ORCPT ); Sun, 11 Oct 2020 06:23:27 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DACDC0613D0 for ; Sun, 11 Oct 2020 03:23:27 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id i2so11229845pgh.7 for ; Sun, 11 Oct 2020 03:23:27 -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=QzE1gJt/wGeixc0XjP/HJf9f2erN/pdWNJtrGZoxo5g=; b=AGzF91p1c7ZJ0BxeLa27Ct8SO1sUt02knkOlRdAvJvwn07TCCC4rrCbO8BJWKOckcD 0hPh0JfbPA41BWN9oiINpPpzKygDLDfdjCECyJXdA46QMA1jy7ZQr/IBALjg0d0n27S9 ejt0N8EdoMwOD5YVzK/SPmWKU2PEseEw1vqIw= 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=QzE1gJt/wGeixc0XjP/HJf9f2erN/pdWNJtrGZoxo5g=; b=KB+n2vqwIh8yStaBa7BIbYjgblTSfUoUvEhVAeFN4pjn4ctml+8ut8hc3+lX2I+fV+ 4Tf/V40m7C7clc7S/lTQpHdjiGGVwh8XUOajv0LboMMbCzSBxnUzf6Urjck7k9qd4TOY etA4XYxfQGvpzgoWcmqJXVyVxGV7MehbB+tIFZlUKDJwU5pWC/RiLfTJvrc33GrPOjHh 3PVatQQMtjN+LXkqQpwfIzxO6bu9s6qHx8TmUrV93EPCKG+UrK7hiLKc7v5pkZUvKdAA xHPM5m22lksxIHEcKMK0Bd07fLV+NUs4yONxsqRKmkBTjGjf1sUb/kKG2/NUIAn93Vll DkXw== X-Gm-Message-State: AOAM532SQsQbYkAKFpg5LxrHnUuCM680XwgPGfFGuzzQhJhBvv59z0+C n0WcZs+4sKg5a3fJYwKYIY1TBA== X-Google-Smtp-Source: ABdhPJyzK0VXUmJ4nTO3JX67+yL/xo7k/bsPRdLixx90/SHTMXFp8r+pmHtIddBfEcDJCtjWhl740A== X-Received: by 2002:a17:90a:7f8c:: with SMTP id m12mr15047385pjl.22.1602411806723; Sun, 11 Oct 2020 03:23:26 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id i1sm20155057pjh.52.2020.10.11.03.23.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Oct 2020 03:23:25 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org, gospo@broadcom.com Subject: [PATCH net-next 6/9] bnxt_en: Log unknown link speed appropriately. Date: Sun, 11 Oct 2020 06:22:58 -0400 Message-Id: <1602411781-6012-7-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602411781-6012-1-git-send-email-michael.chan@broadcom.com> References: <1602411781-6012-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@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 ca35ec06abf0..2d6ecf1adbc5 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)