From patchwork Sun Apr 25 17:45:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 12223427 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=-18.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,MIME_HEADER_CTYPE_ONLY, SPF_HELO_NONE,SPF_PASS,T_TVD_MIME_NO_HEADERS,URIBL_BLOCKED,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 C6B55C433B4 for ; Sun, 25 Apr 2021 17:45:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9B4BD61288 for ; Sun, 25 Apr 2021 17:45:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231164AbhDYRq1 (ORCPT ); Sun, 25 Apr 2021 13:46:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230363AbhDYRq0 (ORCPT ); Sun, 25 Apr 2021 13:46:26 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43D8FC061574 for ; Sun, 25 Apr 2021 10:45:46 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id v13so14112083ple.9 for ; Sun, 25 Apr 2021 10:45:46 -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=JhdZR6V0JIsqNAknFO0u2aXUi4/mIwVP/UHLht6l3tc=; b=bzuv0HyCmybrb2c8i2h5EPV3qevB9ISC3RU932t3qDIFE34IlctMGLEY1tzX0JWVYI R3Z+3DOQVe9aJOadJLF9Q3ugBVCI4E3KkOONbGZyBo/gByGRi/i0bk5B/3JBPDHnaCGr M6j9P9Qs8p0a2z4Za2+sBPmm+eXSHFtAt4dwk= 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=JhdZR6V0JIsqNAknFO0u2aXUi4/mIwVP/UHLht6l3tc=; b=m7sEhKnU5BDn0UAwQ2vQLDp08/00T0S6xnrrIq5lW8XOClyC2uC3vhB8CP8peTbdY3 MJhOApB6mpY3EesnMw6X0bqyE7GVOfd92Qc++NAZOvl4vUG6GSYH5NERYMdT4NErsu88 MYIlROIp9uNDQ5jKn3fY53k+lF+HYoUyo3Bbfo2nj5f3L2J8TKIUJ3mGvZ+3oZk5xGDG gd29dKV2JWuAtupRfc7f6T+H6Y+tIRYnIOsDJRkZKK0c+nBmboAq5tBxVfxgtcGAU8ZO pJcScfTuKN6FdNk7bnzgySjyzfze7Zd/Ed0IfHWoQU6nBD+weaXANHyMy0aC5WHJ5wyp d2rw== X-Gm-Message-State: AOAM5339AsK47K+ajrhxPiTgAQbRVRmVUkOyEZKY5mYH2BR9F0gxbe1m MFtviwZLjG5eX07LXUQVc9EySw== X-Google-Smtp-Source: ABdhPJzmTCa/MKOIYtZ5PuKiNHtQ7rQoPwfzdl1GdUbw9gguv/EiM7lMLolHfSiWQaXUPFkySXoXwA== X-Received: by 2002:a17:90a:150e:: with SMTP id l14mr17978002pja.208.1619372745672; Sun, 25 Apr 2021 10:45:45 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id t19sm14733553pjs.1.2021.04.25.10.45.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Apr 2021 10:45:45 -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 01/10] bnxt_en: report signal mode in link up messages Date: Sun, 25 Apr 2021 13:45:18 -0400 Message-Id: <1619372727-19187-2-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1619372727-19187-1-git-send-email-michael.chan@broadcom.com> References: <1619372727-19187-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 From: Edwin Peer Firmware reports link signalling mode for certain speeds. In these cases, print the signalling modes in kernel log link up messages. Reviewed-by: Andy Gospodarek Signed-off-by: Edwin Peer Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index e15d454e33f0..573c039e6046 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -9075,8 +9075,9 @@ static char *bnxt_report_fec(struct bnxt_link_info *link_info) static void bnxt_report_link(struct bnxt *bp) { if (bp->link_info.link_up) { - const char *duplex; + const char *signal = ""; const char *flow_ctrl; + const char *duplex; u32 speed; u16 fec; @@ -9098,8 +9099,23 @@ static void bnxt_report_link(struct bnxt *bp) flow_ctrl = "ON - receive"; else flow_ctrl = "none"; - netdev_info(bp->dev, "NIC Link is Up, %u Mbps %s duplex, Flow control: %s\n", - speed, duplex, flow_ctrl); + if (bp->link_info.phy_qcfg_resp.option_flags & + PORT_PHY_QCFG_RESP_OPTION_FLAGS_SIGNAL_MODE_KNOWN) { + u8 sig_mode = bp->link_info.active_fec_sig_mode & + PORT_PHY_QCFG_RESP_SIGNAL_MODE_MASK; + switch (sig_mode) { + case PORT_PHY_QCFG_RESP_SIGNAL_MODE_NRZ: + signal = "(NRZ) "; + break; + case PORT_PHY_QCFG_RESP_SIGNAL_MODE_PAM4: + signal = "(PAM4) "; + break; + default: + break; + } + } + netdev_info(bp->dev, "NIC Link is Up, %u Mbps %s%s duplex, Flow control: %s\n", + speed, signal, duplex, flow_ctrl); if (bp->flags & BNXT_FLAG_EEE_CAP) netdev_info(bp->dev, "EEE is %s\n", bp->eee.eee_active ? "active" :