From patchwork Sun Sep 27 17:42:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 260080 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=-13.5 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 3B52DC4727F for ; Sun, 27 Sep 2020 17:43:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F192D23718 for ; Sun, 27 Sep 2020 17:43:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="EpKDL9FW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726576AbgI0RnD (ORCPT ); Sun, 27 Sep 2020 13:43:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726380AbgI0Rm6 (ORCPT ); Sun, 27 Sep 2020 13:42:58 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18491C0613D7 for ; Sun, 27 Sep 2020 10:42:56 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id d6so7169243pfn.9 for ; Sun, 27 Sep 2020 10:42:56 -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=y48lpbWX+36nHg/T7M+Z2Os7Td4iT8jDf2VvhuOgCd4=; b=EpKDL9FWkMp/riyHQK/dxcUe0V44pDZKrplyUZ/19hKo+Pac1cugVqad/fyzxUUueC b58XC6+ljmEx0gXvuzUrPf/XbOeR27h1du09f4GoWGeTr2l7E4GUsf/QgZ33n3eNpXvR tqd/VGZBWzQkijAnoo236CG7wwDDM/mEBRbCo= 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=y48lpbWX+36nHg/T7M+Z2Os7Td4iT8jDf2VvhuOgCd4=; b=HqX78pXQA25EE9lurkYlw8Al3mouvoNqK5MQRxkPDWmoT4o71dbt8H7lbm6YJUqeIO dO7OoGVe0FFQEt8p6l7rvfDjn4voFx5xdHqws4qKzr+fYkUy/l9KZTKKZ7dAzAaXJGwp nh58yJZfaP6Hkzs0bthircv3PvO6+jcG4x2FuuVzfM8GxcOg9CLe6wSkhygF1hWujoi2 lNWE3PdRIA8V8Y7WghGhWjj6h18HqXPtD2dAl6GuDeoBe6K+VIPZYFwL75nhyr4LFHoe QszHOFFRHlrB6s1nsUdGsyBzecpdTLwLhXCUyP20PX0hoZI58BNit2UOqfGkggm2puuv QQmw== X-Gm-Message-State: AOAM530niCl+f0JyOMKyJl/jwaLrOQOkyFIG6CMAR8bUcUwdmnK2Ktr8 XUEThWzJHO3zP1Ifb5wIyG/qRQ== X-Google-Smtp-Source: ABdhPJwZuTp3qA7MT+IudEGvZOFDM6/4hs182N4HsqYG7BWoENugGBB/vYrMkm1wSns6qv9cp3cwhQ== X-Received: by 2002:aa7:8434:0:b029:142:2501:34d8 with SMTP id q20-20020aa784340000b0290142250134d8mr7517883pfn.49.1601228575403; Sun, 27 Sep 2020 10:42:55 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id o19sm8765570pfp.64.2020.09.27.10.42.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Sep 2020 10:42:54 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org Subject: [PATCH net-next 09/11] bnxt_en: Report Active FEC encoding during link up. Date: Sun, 27 Sep 2020 13:42:18 -0400 Message-Id: <1601228540-20852-10-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1601228540-20852-1-git-send-email-michael.chan@broadcom.com> References: <1601228540-20852-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The current code is reporting the FEC configured settings during link up. Change it to report the more useful active FEC encoding that may be negotiated or auto detected. Reviewed-by: Vasundhara Volam Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 29 ++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index ab3b36deaf66..834f64f5f4d6 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -8737,6 +8737,30 @@ void bnxt_tx_enable(struct bnxt *bp) netif_carrier_on(bp->dev); } +static char *bnxt_report_fec(struct bnxt_link_info *link_info) +{ + u8 active_fec = link_info->active_fec_sig_mode & + PORT_PHY_QCFG_RESP_ACTIVE_FEC_MASK; + + switch (active_fec) { + default: + case PORT_PHY_QCFG_RESP_ACTIVE_FEC_FEC_NONE_ACTIVE: + return "None"; + case PORT_PHY_QCFG_RESP_ACTIVE_FEC_FEC_CLAUSE74_ACTIVE: + return "Clause 74 BaseR"; + case PORT_PHY_QCFG_RESP_ACTIVE_FEC_FEC_CLAUSE91_ACTIVE: + return "Clause 91 RS(528,514)"; + case PORT_PHY_QCFG_RESP_ACTIVE_FEC_FEC_RS544_1XN_ACTIVE: + return "Clause 91 RS544_1XN"; + case PORT_PHY_QCFG_RESP_ACTIVE_FEC_FEC_RS544_IEEE_ACTIVE: + return "Clause 91 RS(544,514)"; + case PORT_PHY_QCFG_RESP_ACTIVE_FEC_FEC_RS272_1XN_ACTIVE: + return "Clause 91 RS272_1XN"; + case PORT_PHY_QCFG_RESP_ACTIVE_FEC_FEC_RS272_IEEE_ACTIVE: + return "Clause 91 RS(272,257)"; + } +} + static void bnxt_report_link(struct bnxt *bp) { if (bp->link_info.link_up) { @@ -8767,10 +8791,9 @@ static void bnxt_report_link(struct bnxt *bp) "not active"); fec = bp->link_info.fec_cfg; if (!(fec & PORT_PHY_QCFG_RESP_FEC_CFG_FEC_NONE_SUPPORTED)) - netdev_info(bp->dev, "FEC autoneg %s encodings: %s\n", + netdev_info(bp->dev, "FEC autoneg %s encoding: %s\n", (fec & BNXT_FEC_AUTONEG) ? "on" : "off", - (fec & BNXT_FEC_ENC_BASE_R) ? "BaseR" : - (fec & BNXT_FEC_ENC_RS) ? "RS" : "None"); + bnxt_report_fec(&bp->link_info)); } else { netif_carrier_off(bp->dev); netdev_err(bp->dev, "NIC Link is Down\n");