From nobody Tue Jan 27 12:16:26 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4f0ksQ6k0yz6Pkbf for ; Tue, 27 Jan 2026 12:16:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f0ksQ4vDNz3Zxc for ; Tue, 27 Jan 2026 12:16:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769516186; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W7r9EQOhKwXnbBAskWu2d8+ehuJPUJp+o5CP0j6oz60=; b=o5AjLN9U1lHs0vjhGNvhscK68HSHRDo7HLFdHssMVdO/3InGsDBbeJ1+7e8Gwp8zxjvlQ1 Bro2Z9BivG76WF1ATepMjGfBqJLs0+XSJSdMlL02hvuu1ne36UXJRy0trfBxdAvwjoDJK6 GHGvYG8YaUWfCcRUHrgXDcq4s+rTZPJV091yJGDbsY1rJo0xhD3OU8j8rYPDuqqm/mFg8+ 5bTOiVvy9a/lp4LCDKQPTQZbgsy3QM/+YVRXkw4i0eXwO17E3VqfKZyfIQN23ZQxOXVE7q MATu+m4Da0sI6e3zr/J0ouFbIlc4shNsA42vc9DGvyaM0UDrhXtjBUcb2maiRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769516186; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W7r9EQOhKwXnbBAskWu2d8+ehuJPUJp+o5CP0j6oz60=; b=JbyDL6pIilDCCrKw4M9GobbjrgxYxwf7feVWs2AJ3A1BgxFGlze86CKdAa4/n9lL4f+8Ic mxdfzVHXNN9jY23YM3OStNxn5WzXImNFwif4FzMenqhAJJTFdJWQix4TepzDbtHGHacnhS xKkQ1vQIPfWJuUCq9Fx4pVhoGCWBCZ++b6GtW+8K3c2db3y+PwO1bbrTEj6PU66loTQdGu E+qUWX+mws2iX2mC/Cu0/6Fmell5GKOsFCT54A6hpc5gMlr0RmG8pFN9L9Q9yWD8KxbuoW 45WLLhgqR0phL5TbiNMce6QhQSyKOROsXp7BJqf9m07F514sww+Tkj+TjEm1Mg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1769516186; a=rsa-sha256; cv=none; b=jEzGPWMERGcE501W7Fu7LMokUONG8FJQ+LQXZn/6SPMD1AOZUzkTkx1GBl2Jas13L79Vi1 kftVQwaD3u00eFAz1iaLCc3P+hKF/mWdWlQEaapPPM6F3d93Lu89SDui+eFavqTllERf1T 7EQ7XbWcH6uqDOSclbSeTZ439BR1GOq9mpjNkqeKSA2pE5h0AD4KrbUoqBkaND+HnRl2lf ERs63eApFcEmAwb1qapIH/BwcU02KClaBSTToru17WS6zJ8/rAHHdm3J2MOx43oea/SVAL dxPlgYXtOGC3JF9nZBrGbhv+hOMa3VPcmVk4aKEcIInS72KkIHo2ZTJ64/rjLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f0ksQ2whxz15rV for ; Tue, 27 Jan 2026 12:16:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 8a3c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 27 Jan 2026 12:16:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Sreekanth Reddy From: Sumit Saxena Subject: git: 3a9565c2a8e4 - main - bnxt_re: Add support to display board_id in ibv_devinfo output List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ssaxena X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3a9565c2a8e4f1b3da698bf6a8af5889dc4fefbd Auto-Submitted: auto-generated Date: Tue, 27 Jan 2026 12:16:26 +0000 Message-Id: <6978ac9a.8a3c.1a1bc4b0@gitrepo.freebsd.org> The branch main has been updated by ssaxena: URL: https://cgit.FreeBSD.org/src/commit/?id=3a9565c2a8e4f1b3da698bf6a8af5889dc4fefbd commit 3a9565c2a8e4f1b3da698bf6a8af5889dc4fefbd Author: Sreekanth Reddy AuthorDate: 2026-01-23 16:38:02 +0000 Commit: Sumit Saxena CommitDate: 2026-01-27 12:13:09 +0000 bnxt_re: Add support to display board_id in ibv_devinfo output Added support to display board_id in ibv_devinfo output. ibv_devinfo util reads the board_id from below sysctl attribute, so added this sysctl attribute. sys.class.infiniband.bnxt_reX.board_id Reviewed by: ssaxena Differential Revision: https://reviews.freebsd.org/D54524 MFC after: 3 days --- sys/dev/bnxt/bnxt_en/bnxt.h | 1 + sys/dev/bnxt/bnxt_en/bnxt_ulp.c | 1 + sys/dev/bnxt/bnxt_en/bnxt_ulp.h | 2 ++ sys/dev/bnxt/bnxt_en/if_bnxt.c | 7 +++++++ sys/dev/bnxt/bnxt_re/main.c | 21 ++++++++++++++++++++- 5 files changed, 31 insertions(+), 1 deletion(-) diff --git a/sys/dev/bnxt/bnxt_en/bnxt.h b/sys/dev/bnxt/bnxt_en/bnxt.h index 5556914fb61e..64482a656e9d 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt.h +++ b/sys/dev/bnxt/bnxt_en/bnxt.h @@ -1340,6 +1340,7 @@ struct bnxt_softc { unsigned long fw_reset_timestamp; struct bnxt_fw_health *fw_health; + char board_partno[64]; }; struct bnxt_filter_info { diff --git a/sys/dev/bnxt/bnxt_en/bnxt_ulp.c b/sys/dev/bnxt/bnxt_en/bnxt_ulp.c index 677c9c99b74e..c6d862a36a9a 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_ulp.c +++ b/sys/dev/bnxt/bnxt_en/bnxt_ulp.c @@ -463,6 +463,7 @@ static inline void bnxt_set_edev_info(struct bnxt_en_dev *edev, struct bnxt_soft edev->hwrm_bar = bp->hwrm_bar; edev->port_partition_type = bp->port_partition_type; edev->ulp_version = BNXT_ULP_VERSION; + memcpy(edev->board_part_number, bp->board_partno, BNXT_VPD_PN_FLD_LEN - 1); } int bnxt_rdma_aux_device_del(struct bnxt_softc *softc) diff --git a/sys/dev/bnxt/bnxt_en/bnxt_ulp.h b/sys/dev/bnxt/bnxt_en/bnxt_ulp.h index 7d7ecbd2f536..53bb51b07135 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_ulp.h +++ b/sys/dev/bnxt/bnxt_en/bnxt_ulp.h @@ -127,6 +127,8 @@ struct bnxt_en_dev { struct bnxt_bar_info hwrm_bar; u32 espeed; uint8_t lanes; + #define BNXT_VPD_PN_FLD_LEN 32 + char board_part_number[BNXT_VPD_PN_FLD_LEN]; }; struct bnxt_en_ops { diff --git a/sys/dev/bnxt/bnxt_en/if_bnxt.c b/sys/dev/bnxt/bnxt_en/if_bnxt.c index 94775457b7e3..dea6fd68181e 100644 --- a/sys/dev/bnxt/bnxt_en/if_bnxt.c +++ b/sys/dev/bnxt/bnxt_en/if_bnxt.c @@ -2674,6 +2674,13 @@ bnxt_attach_pre(if_ctx_t ctx) softc->state_bv = bit_alloc(BNXT_STATE_MAX, M_DEVBUF, M_WAITOK|M_ZERO); + if (BNXT_PF(softc)) { + const char *part_num; + + if (pci_get_vpd_readonly(softc->dev, "PN", &part_num) == 0) + snprintf(softc->board_partno, sizeof(softc->board_partno), "%s", part_num); + } + return (rc); failed: diff --git a/sys/dev/bnxt/bnxt_re/main.c b/sys/dev/bnxt/bnxt_re/main.c index eb21c770ca5f..dc68854157a0 100644 --- a/sys/dev/bnxt/bnxt_re/main.c +++ b/sys/dev/bnxt/bnxt_re/main.c @@ -2031,11 +2031,30 @@ static ssize_t show_hca(struct device *device, struct device_attribute *attr, return scnprintf(buf, PAGE_SIZE, "%s\n", rdev->ibdev.node_desc); } +static ssize_t show_board_id(struct device *device, struct device_attribute *attr, + char *buf) +{ + struct bnxt_re_dev *rdev = to_bnxt_re_dev(device, ibdev.dev); + char buffer[BNXT_VPD_PN_FLD_LEN] = {}; + + if (!rdev->is_virtfn) + memcpy(buffer, rdev->en_dev->board_part_number, + BNXT_VPD_PN_FLD_LEN - 1); + else + scnprintf(buffer, BNXT_VPD_PN_FLD_LEN, + "0x%x-VF", rdev->en_dev->pdev->device); + + return scnprintf(buf, PAGE_SIZE, "%s\n", buffer); +} + static DEVICE_ATTR(hw_rev, 0444, show_rev, NULL); static DEVICE_ATTR(hca_type, 0444, show_hca, NULL); +static DEVICE_ATTR(board_id, 0444, show_board_id, NULL); + static struct device_attribute *bnxt_re_attributes[] = { &dev_attr_hw_rev, - &dev_attr_hca_type + &dev_attr_hca_type, + &dev_attr_board_id }; int ib_register_device_compat(struct bnxt_re_dev *rdev)