From patchwork Fri Mar 27 09:35:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasundhara Volam X-Patchwork-Id: 221732 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, 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 B5203C43331 for ; Fri, 27 Mar 2020 09:37:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7F7B720714 for ; Fri, 27 Mar 2020 09:37:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="AXAQWqDQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727612AbgC0JhX (ORCPT ); Fri, 27 Mar 2020 05:37:23 -0400 Received: from mail-wm1-f51.google.com ([209.85.128.51]:55403 "EHLO mail-wm1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727185AbgC0JhX (ORCPT ); Fri, 27 Mar 2020 05:37:23 -0400 Received: by mail-wm1-f51.google.com with SMTP id z5so10689376wml.5 for ; Fri, 27 Mar 2020 02:37: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; bh=hlrOdL1KnO3xQYV3oaqWV4hvkH1Bg456h/MxyKV3WFw=; b=AXAQWqDQYNqaDWIB7CeKYUxw7hETFRXiqsTm5GB6QuYNBPcelQSsGJHp5Mo0Yzih1c lrlAc3KiLzp3YkpOC6c3Mz/9hoEhRlL5pdmKXHqAwue6fV/58S6mEPvZud5Hpbj+OVrL PXAq1h2zG9WxnOaZBbuLpJxycu836WvG3jPT0= 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; bh=hlrOdL1KnO3xQYV3oaqWV4hvkH1Bg456h/MxyKV3WFw=; b=HX7qePqEqXOijunhHPkHxHyHbegSdwwCp7CfGObWuJa/uCrhRrg274PYo4dyc85+H8 uVKUD6TrwDKnjWFa+K7QoTsA+DzPZkLiSAJDKuyum2UuvkASJ6mOSt6t5rOvlGzK9dvK 4HkfH1DAQ/v90EiAwDcGZdu9LCNY9gGHGruZvf/OIEdiU1wkPaGJas6LQ/xnaoU7AKT5 XU43agKu5WZN6mijF3X6nXvNknahjEw0VJVBaAIBZR3zaTBBRziTbr90O/BtmGSC9gVa 27LuJaBP52AULaRb6TNZ2GB2O5WcrUFfPjt3I+UbphfE3dyuT3WXyuCkAk+sEbiMDdFc K5Ww== X-Gm-Message-State: ANhLgQ1ROR7UD54CyXb+k1YgWUO4o9PLqw2oZSxL2xPkWIIDONx5wPdt KapLt5W3Mqa2ovdezib42dCvDQ== X-Google-Smtp-Source: ADFU+vv4F5R+JWGZ1eIAV+JFzPo2e5u1Lqpct/x33oPVKbpnLmrECscGOG3PCYUbJ81mLewUU0adqQ== X-Received: by 2002:a1c:4684:: with SMTP id t126mr4328407wma.128.1585301841143; Fri, 27 Mar 2020 02:37:21 -0700 (PDT) Received: from lxpurley1.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id b82sm7246600wmb.46.2020.03.27.02.37.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Mar 2020 02:37:20 -0700 (PDT) From: Vasundhara Volam To: linux-pci@vger.kernel.org, davem@davemloft.net Cc: netdev@vger.kernel.org, Vasundhara Volam , Michael Chan Subject: [PATCH v4 net-next 3/6] PCI: Add new PCI_VPD_RO_KEYWORD_SERIALNO macro Date: Fri, 27 Mar 2020 15:05:32 +0530 Message-Id: <1585301732-26004-1-git-send-email-vasundhara-v.volam@broadcom.com> X-Mailer: git-send-email 1.8.3.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch adds a new macro for serial number keyword. Acked-by: Bjorn Helgaas Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan --- include/linux/pci.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/pci.h b/include/linux/pci.h index fc54b89..a048fba 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -2184,6 +2184,7 @@ bool pci_acs_path_enabled(struct pci_dev *start, #define PCI_VPD_INFO_FLD_HDR_SIZE 3 #define PCI_VPD_RO_KEYWORD_PARTNO "PN" +#define PCI_VPD_RO_KEYWORD_SERIALNO "SN" #define PCI_VPD_RO_KEYWORD_MFR_ID "MN" #define PCI_VPD_RO_KEYWORD_VENDOR0 "V0" #define PCI_VPD_RO_KEYWORD_CHKSUM "RV" From patchwork Fri Mar 27 09:35:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasundhara Volam X-Patchwork-Id: 221731 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, 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 EE672C43331 for ; Fri, 27 Mar 2020 09:37:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C270720714 for ; Fri, 27 Mar 2020 09:37:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="FtqePiUt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727247AbgC0Jhq (ORCPT ); Fri, 27 Mar 2020 05:37:46 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:54299 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725956AbgC0Jhp (ORCPT ); Fri, 27 Mar 2020 05:37:45 -0400 Received: by mail-wm1-f66.google.com with SMTP id c81so10689783wmd.4 for ; Fri, 27 Mar 2020 02:37:44 -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=XhhpLzfapqrY15cIXnuhpl4Gh6lePVazE90jqwSKcYA=; b=FtqePiUtNcv+Kxoo7wv1tdSQ50PfTW2/XO+RaPQCeyyhJ9oEBhCJojwY6wYdCx4Lj0 /882ZgHB5XyFGpUnX6Do8i3Dn+0AyCgNV1xgZiB3JmlWOURm6McmhDUbsE6CzFkzrvw/ Z4aSWGHRUBbqdlrM0LnuT9c7Q3lbDqbN84zEk= 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=XhhpLzfapqrY15cIXnuhpl4Gh6lePVazE90jqwSKcYA=; b=l0VKxoFAeKoWrmvvzULp2qMUhr2V4P96S0uMkzOKyHpUVMTF8cf1i9QGpYX41FMnNG Lzb6aUY5/I04gf+Djo112pst78S51Zg9hPJFGwBB7EIrBEZA+cWzuOkDXTiS31n8R6+H 5zXdy9exv1ArlAysnxxcM3LwArRRK14hlVLr8yqNVDp8yaeun1VTdKSR4BsSzGlS5luj j0OL4fKzKbnqqNVkmqlWqHLAoczEui/eT5GTyRTuSZ9mLpma6eINGiiiYGI7d7P+3RzE qLBfnJXztmqXyqR22oBz2vYSJsGT7uTy43rBlJyovcmCCNMb1kWyoSbUgXQUSNcLQibk DwMg== X-Gm-Message-State: ANhLgQ2PSdNO/HQWiidujjsONu7V5C+8GreaEuYi66XqUp/EE5xg6r/2 hOMbOl9sQzTWjcOqLd7CXDQSKw== X-Google-Smtp-Source: ADFU+vtdsdpv+R5roKvKQEI4qP6vtDXV5v4YrrEtIFdYZXxXuy87RejYVKanoLIHYrn8O8hpj3y0XQ== X-Received: by 2002:a1c:1d8e:: with SMTP id d136mr4669326wmd.26.1585301863539; Fri, 27 Mar 2020 02:37:43 -0700 (PDT) Received: from lxpurley1.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id v7sm5385107wrs.96.2020.03.27.02.37.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Mar 2020 02:37:42 -0700 (PDT) From: Vasundhara Volam To: davem@davemloft.net Cc: netdev@vger.kernel.org, Vasundhara Volam , Jakub Kicinski , Michael Chan Subject: [PATCH v4 net-next 5/6] bnxt_en: Add partno to devlink info_get cb Date: Fri, 27 Mar 2020 15:05:50 +0530 Message-Id: <1585301751-26044-2-git-send-email-vasundhara-v.volam@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1585301751-26044-1-git-send-email-vasundhara-v.volam@broadcom.com> References: <1585301751-26044-1-git-send-email-vasundhara-v.volam@broadcom.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add part number info from the vital product data to info_get command via devlink tool. Update bnxt.rst documentation as well. Cc: Jakub Kicinski Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan --- v1->v2: Remove serial number information. --- v3->v4: Remove example display. --- Documentation/networking/devlink/bnxt.rst | 3 +++ drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/Documentation/networking/devlink/bnxt.rst b/Documentation/networking/devlink/bnxt.rst index 7ab34c9..9818118 100644 --- a/Documentation/networking/devlink/bnxt.rst +++ b/Documentation/networking/devlink/bnxt.rst @@ -51,6 +51,9 @@ The ``bnxt_en`` driver reports the following versions * - Name - Type - Description + * - ``board.id`` + - fixed + - Part number identifying the board design * - ``asic.id`` - fixed - ASIC design identifier diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c index 39c2ac4..0c8283b 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c @@ -403,6 +403,14 @@ static int bnxt_dl_info_get(struct devlink *dl, struct devlink_info_req *req, if (rc) return rc; + if (strlen(bp->board_partno)) { + rc = devlink_info_version_fixed_put(req, + DEVLINK_INFO_VERSION_GENERIC_BOARD_ID, + bp->board_partno); + if (rc) + return rc; + } + sprintf(buf, "%X", bp->chip_num); rc = devlink_info_version_fixed_put(req, DEVLINK_INFO_VERSION_GENERIC_ASIC_ID, buf);