netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org,
	Vasundhara Volam <vasundhara-v.volam@broadcom.com>,
	Michael Chan <michael.chan@broadcom.com>
Subject: [PATCH net-next 08/11] bnxt_en: Add partno and serialno to devlink info_get cb
Date: Tue, 17 Mar 2020 20:47:23 +0530	[thread overview]
Message-ID: <1584458246-29370-2-git-send-email-vasundhara-v.volam@broadcom.com> (raw)
In-Reply-To: <1584458246-29370-1-git-send-email-vasundhara-v.volam@broadcom.com>

Add part number and serial number info from the vital product data
to info_get command via devlink tool.

Some of the broadcom devices support both PCI extended config space
for device serial number and VPD serial number. With this patch, both
the information will be displayed via info_get cb.

Update bnxt.rst documentation as well.

Example display:

$ devlink dev info pci/0000:3b:00.1
pci/0000:3b:00.1:
  driver bnxt_en
  serial_number B0-26-28-FF-FE-C8-85-20
  versions:
      fixed:
        board.id BCM957508-P2100G
        asic.id 1750
        asic.rev 1
        vpd.serialno P2100pm01920A0032CQ
      running:
        drv.spec 1.10.1.12
        hw.addr b0:26:28:c8:85:21
        hw.mh_base_addr b0:26:28:c8:85:20
        fw 216.0.286.0
        fw.psid 0.0.6
        fw.app 216.0.251.0

Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 Documentation/networking/devlink/bnxt.rst         |  6 ++++++
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 15 +++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/Documentation/networking/devlink/bnxt.rst b/Documentation/networking/devlink/bnxt.rst
index f850a18..17b6522 100644
--- a/Documentation/networking/devlink/bnxt.rst
+++ b/Documentation/networking/devlink/bnxt.rst
@@ -51,12 +51,18 @@ 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
    * - ``asic.rev``
      - fixed
      - ASIC design revision
+   * - ``vpd.serialno``
+     - fixed
+     - Serial number identifying the board
    * - ``drv.spec``
      - running
      - HWRM specification version supported by driver HWRM implementation
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
index 607e27a..6065602 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
@@ -439,6 +439,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);
@@ -461,6 +469,13 @@ static int bnxt_dl_info_get(struct devlink *dl, struct devlink_info_req *req,
 			return rc;
 	}
 
+	if (strlen(bp->board_serialno)) {
+		rc = devlink_info_version_fixed_put(req, "vpd.serialno",
+						    bp->board_serialno);
+		if (rc)
+			return rc;
+	}
+
 	rc = devlink_info_version_running_put(req,
 		DEVLINK_INFO_VERSION_GENERIC_DRV_SPEC, HWRM_VERSION_STR);
 	if (rc)
-- 
1.8.3.1


  reply	other threads:[~2020-03-17 15:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-17 15:17 [PATCH net-next 07/11] bnxt_en: Read partno and serialno of the board from VPD Vasundhara Volam
2020-03-17 15:17 ` Vasundhara Volam [this message]
2020-03-17 17:51   ` [PATCH net-next 08/11] bnxt_en: Add partno and serialno to devlink info_get cb Jakub Kicinski
2020-03-17 15:17 ` [PATCH net-next 09/11] devlink: Add new enable_ecn generic device param Vasundhara Volam
2020-03-17 17:52   ` Jakub Kicinski
2020-03-18  5:26     ` Pavan Chebbi
2020-03-18 20:15       ` Jakub Kicinski
2020-03-17 15:17 ` [PATCH net-next 10/11] bnxt_en: Update firmware interface spec to 1.10.1.26 Vasundhara Volam
2020-03-17 15:17 ` [PATCH net-next 11/11] bnxt_en: Use "enable_ecn" devlink param Vasundhara Volam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1584458246-29370-2-git-send-email-vasundhara-v.volam@broadcom.com \
    --to=vasundhara-v.volam@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).