Skip to content

Commit b7a444f

Browse files
Vasundhara Volamdavem330
authored andcommitted
bnxt_en: Add fw.mgmt.api version to devlink info_get cb.
Display the minimum version of firmware interface spec supported between driver and firmware. Also update bnxt.rst documentation file. Signed-off-by: Vasundhara Volam <[email protected]> Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2d9eade commit b7a444f

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

Documentation/networking/devlink/bnxt.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ The ``bnxt_en`` driver reports the following versions
6666
* - ``fw.app``
6767
- stored, running
6868
- Data path firmware version
69+
* - ``fw.mgmt.api``
70+
- running
71+
- Minimum firmware interface spec version supported between driver and firmware
6972
* - ``fw.mgmt``
7073
- stored, running
7174
- Management firmware version

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7223,7 +7223,7 @@ static int __bnxt_hwrm_ver_get(struct bnxt *bp, bool silent)
72237223
static int bnxt_hwrm_ver_get(struct bnxt *bp)
72247224
{
72257225
struct hwrm_ver_get_output *resp = bp->hwrm_cmd_resp_addr;
7226-
u32 dev_caps_cfg;
7226+
u32 dev_caps_cfg, hwrm_ver;
72277227
int rc;
72287228

72297229
bp->hwrm_max_req_len = HWRM_MAX_REQ_LEN;
@@ -7243,6 +7243,19 @@ static int bnxt_hwrm_ver_get(struct bnxt *bp)
72437243
resp->hwrm_intf_upd_8b);
72447244
netdev_warn(bp->dev, "Please update firmware with HWRM interface 1.0.0 or newer.\n");
72457245
}
7246+
7247+
hwrm_ver = HWRM_VERSION_MAJOR << 16 | HWRM_VERSION_MINOR << 8 |
7248+
HWRM_VERSION_UPDATE;
7249+
7250+
if (bp->hwrm_spec_code > hwrm_ver)
7251+
snprintf(bp->hwrm_ver_supp, FW_VER_STR_LEN, "%d.%d.%d",
7252+
HWRM_VERSION_MAJOR, HWRM_VERSION_MINOR,
7253+
HWRM_VERSION_UPDATE);
7254+
else
7255+
snprintf(bp->hwrm_ver_supp, FW_VER_STR_LEN, "%d.%d.%d",
7256+
resp->hwrm_intf_maj_8b, resp->hwrm_intf_min_8b,
7257+
resp->hwrm_intf_upd_8b);
7258+
72467259
snprintf(bp->fw_ver_str, BC_HWRM_STR_LEN, "%d.%d.%d.%d",
72477260
resp->hwrm_fw_maj_8b, resp->hwrm_fw_min_8b,
72487261
resp->hwrm_fw_bld_8b, resp->hwrm_fw_rsvd_8b);

drivers/net/ethernet/broadcom/bnxt/bnxt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,6 +1730,7 @@ struct bnxt {
17301730
#define BC_HWRM_STR_LEN 21
17311731
#define PHY_VER_STR_LEN (FW_VER_STR_LEN - BC_HWRM_STR_LEN)
17321732
char fw_ver_str[FW_VER_STR_LEN];
1733+
char hwrm_ver_supp[FW_VER_STR_LEN];
17331734
__be16 vxlan_port;
17341735
u8 vxlan_port_cnt;
17351736
__le16 vxlan_fw_dst_port_id;

drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,12 @@ static int bnxt_dl_info_get(struct devlink *dl, struct devlink_info_req *req,
475475
if (rc)
476476
return rc;
477477

478+
rc = devlink_info_version_running_put(req,
479+
DEVLINK_INFO_VERSION_GENERIC_FW_MGMT_API,
480+
bp->hwrm_ver_supp);
481+
if (rc)
482+
return rc;
483+
478484
if (!(bp->flags & BNXT_FLAG_CHIP_P5)) {
479485
rc = devlink_info_version_running_put(req,
480486
DEVLINK_INFO_VERSION_GENERIC_FW_MGMT, mgmt_ver);

0 commit comments

Comments
 (0)