netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 net-next 0/6] bnxt_en: Updates to devlink info_get cb
@ 2020-03-27  9:34 Vasundhara Volam
  2020-03-27  9:34 ` [PATCH v4 net-next 1/6] devlink: Add macro for "fw.mgmt.api" to " Vasundhara Volam
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Vasundhara Volam @ 2020-03-27  9:34 UTC (permalink / raw)
  To: davem; +Cc: netdev, Vasundhara Volam

This series adds support for a generic macro to devlink info_get cb.
Adds support for fw.mgmt.api and board.id info to bnxt_en driver info_get
cb. Also, updates the devlink-info.rst and bnxt.rst documentation
accordingly.

This series adds a patch to fix few macro names that maps to bnxt_en
firmware versions.

---
v1->v2: Remove ECN dev param, base_mh_addr and serial number info support
in this series.
Rename drv.spec macro to fw.api.
---
v2->v3: Remove hw.addr info as it is per netdev but not per device info.
---
v3->v4: Rename "fw.api" to "fw.mgmt.api".
Also, add a patch that modifies few macro names in info_get command,
to match the devlink documentation.
---

Vasundhara Volam (6):
  devlink: Add macro for "fw.mgmt.api" to info_get cb.
  bnxt_en: Add fw.mgmt.api version to devlink info_get cb.
  PCI: Add new PCI_VPD_RO_KEYWORD_SERIALNO macro
  bnxt_en: Read partno and serialno of the board from VPD
  bnxt_en: Add partno to devlink info_get cb
  bnxt_en: Fix "fw.mgmt" and "fw.nsci" info via devlink info_get cb

 Documentation/networking/devlink/bnxt.rst         | 14 +++--
 Documentation/networking/devlink/devlink-info.rst |  6 ++
 drivers/net/ethernet/broadcom/bnxt/bnxt.c         | 74 ++++++++++++++++++++++-
 drivers/net/ethernet/broadcom/bnxt/bnxt.h         |  5 ++
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 18 +++++-
 include/linux/pci.h                               |  1 +
 include/net/devlink.h                             |  2 +
 7 files changed, 113 insertions(+), 7 deletions(-)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v4 net-next 1/6] devlink: Add macro for "fw.mgmt.api" to info_get cb.
  2020-03-27  9:34 [PATCH v4 net-next 0/6] bnxt_en: Updates to devlink info_get cb Vasundhara Volam
@ 2020-03-27  9:34 ` Vasundhara Volam
  2020-03-27  9:44   ` Jiri Pirko
  2020-03-27  9:34 ` [PATCH v4 net-next 2/6] bnxt_en: Add fw.mgmt.api version to devlink " Vasundhara Volam
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Vasundhara Volam @ 2020-03-27  9:34 UTC (permalink / raw)
  To: davem
  Cc: netdev, Vasundhara Volam, Jakub Kicinski, Jacob Keller,
	Jiri Pirko, Michael Chan

Add definition and documentation for the new generic info
"fw.mgmt.api". This macro specifies the version of the software
interfaces between driver and firmware.

Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Jacob Keller <jacob.e.keller@intel.com>
Cc: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
v1->v2: Rename macro to "fw.api" from "drv.spec".
---
v3->v4: Rename "fw.api" to "fw.mgmt.api", to make it more common
across all vendors.
---
 Documentation/networking/devlink/devlink-info.rst | 6 ++++++
 include/net/devlink.h                             | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/Documentation/networking/devlink/devlink-info.rst b/Documentation/networking/devlink/devlink-info.rst
index e5e5e89..3fe1140 100644
--- a/Documentation/networking/devlink/devlink-info.rst
+++ b/Documentation/networking/devlink/devlink-info.rst
@@ -157,6 +157,12 @@ Control unit firmware version. This firmware is responsible for house
 keeping tasks, PHY control etc. but not the packet-by-packet data path
 operation.
 
+fw.mgmt.api
+-----------
+
+Firmware interface specification version of the software interfaces between
+driver and firmware.
+
 fw.app
 ------
 
diff --git a/include/net/devlink.h b/include/net/devlink.h
index a1a02cd5..3be5034 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -481,6 +481,8 @@ enum devlink_param_generic_id {
 #define DEVLINK_INFO_VERSION_GENERIC_FW		"fw"
 /* Control processor FW version */
 #define DEVLINK_INFO_VERSION_GENERIC_FW_MGMT	"fw.mgmt"
+/* FW interface specification version */
+#define DEVLINK_INFO_VERSION_GENERIC_FW_MGMT_API	"fw.mgmt.api"
 /* Data path microcode controlling high-speed packet processing */
 #define DEVLINK_INFO_VERSION_GENERIC_FW_APP	"fw.app"
 /* UNDI software version */
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v4 net-next 2/6] bnxt_en: Add fw.mgmt.api version to devlink info_get cb.
  2020-03-27  9:34 [PATCH v4 net-next 0/6] bnxt_en: Updates to devlink info_get cb Vasundhara Volam
  2020-03-27  9:34 ` [PATCH v4 net-next 1/6] devlink: Add macro for "fw.mgmt.api" to " Vasundhara Volam
@ 2020-03-27  9:34 ` Vasundhara Volam
  2020-03-27 17:39 ` [PATCH v4 net-next 0/6] bnxt_en: Updates " Jakub Kicinski
  2020-03-27 22:35 ` David Miller
  3 siblings, 0 replies; 6+ messages in thread
From: Vasundhara Volam @ 2020-03-27  9:34 UTC (permalink / raw)
  To: davem; +Cc: netdev, Vasundhara Volam, Michael Chan

Display the minimum version of firmware interface spec supported
between driver and firmware. Also update bnxt.rst documentation file.

Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
v1->v2: Display the minimum version of fw spec supported between fw and
driver, instead of version implemented by driver.
---
v3->v4: Rename "fw.api" to "fw.mgmt.api"
---
 Documentation/networking/devlink/bnxt.rst         |  3 +++
 drivers/net/ethernet/broadcom/bnxt/bnxt.c         | 15 ++++++++++++++-
 drivers/net/ethernet/broadcom/bnxt/bnxt.h         |  1 +
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c |  6 ++++++
 4 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/Documentation/networking/devlink/bnxt.rst b/Documentation/networking/devlink/bnxt.rst
index 82ef9ec..7ab34c9 100644
--- a/Documentation/networking/devlink/bnxt.rst
+++ b/Documentation/networking/devlink/bnxt.rst
@@ -66,6 +66,9 @@ The ``bnxt_en`` driver reports the following versions
    * - ``fw.app``
      - stored, running
      - Data path firmware version
+   * - ``fw.mgmt.api``
+     - running
+     - Minimum firmware interface spec version supported between driver and firmware
    * - ``fw.mgmt``
      - stored, running
      - Management firmware version
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 1ea8028..3861dff 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -7223,7 +7223,7 @@ static int __bnxt_hwrm_ver_get(struct bnxt *bp, bool silent)
 static int bnxt_hwrm_ver_get(struct bnxt *bp)
 {
 	struct hwrm_ver_get_output *resp = bp->hwrm_cmd_resp_addr;
-	u32 dev_caps_cfg;
+	u32 dev_caps_cfg, hwrm_ver;
 	int rc;
 
 	bp->hwrm_max_req_len = HWRM_MAX_REQ_LEN;
@@ -7243,6 +7243,19 @@ static int bnxt_hwrm_ver_get(struct bnxt *bp)
 			    resp->hwrm_intf_upd_8b);
 		netdev_warn(bp->dev, "Please update firmware with HWRM interface 1.0.0 or newer.\n");
 	}
+
+	hwrm_ver = HWRM_VERSION_MAJOR << 16 | HWRM_VERSION_MINOR << 8 |
+			HWRM_VERSION_UPDATE;
+
+	if (bp->hwrm_spec_code > hwrm_ver)
+		snprintf(bp->hwrm_ver_supp, FW_VER_STR_LEN, "%d.%d.%d",
+			 HWRM_VERSION_MAJOR, HWRM_VERSION_MINOR,
+			 HWRM_VERSION_UPDATE);
+	else
+		snprintf(bp->hwrm_ver_supp, FW_VER_STR_LEN, "%d.%d.%d",
+			 resp->hwrm_intf_maj_8b, resp->hwrm_intf_min_8b,
+			 resp->hwrm_intf_upd_8b);
+
 	snprintf(bp->fw_ver_str, BC_HWRM_STR_LEN, "%d.%d.%d.%d",
 		 resp->hwrm_fw_maj_8b, resp->hwrm_fw_min_8b,
 		 resp->hwrm_fw_bld_8b, resp->hwrm_fw_rsvd_8b);
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index eaf20e3..a1e9d33 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -1730,6 +1730,7 @@ struct bnxt {
 #define BC_HWRM_STR_LEN		21
 #define PHY_VER_STR_LEN         (FW_VER_STR_LEN - BC_HWRM_STR_LEN)
 	char			fw_ver_str[FW_VER_STR_LEN];
+	char			hwrm_ver_supp[FW_VER_STR_LEN];
 	__be16			vxlan_port;
 	u8			vxlan_port_cnt;
 	__le16			vxlan_fw_dst_port_id;
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
index d3c93cc..39c2ac4 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
@@ -475,6 +475,12 @@ static int bnxt_dl_info_get(struct devlink *dl, struct devlink_info_req *req,
 	if (rc)
 		return rc;
 
+	rc = devlink_info_version_running_put(req,
+				DEVLINK_INFO_VERSION_GENERIC_FW_MGMT_API,
+				bp->hwrm_ver_supp);
+	if (rc)
+		return rc;
+
 	if (!(bp->flags & BNXT_FLAG_CHIP_P5)) {
 		rc = devlink_info_version_running_put(req,
 			DEVLINK_INFO_VERSION_GENERIC_FW_MGMT, mgmt_ver);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v4 net-next 1/6] devlink: Add macro for "fw.mgmt.api" to info_get cb.
  2020-03-27  9:34 ` [PATCH v4 net-next 1/6] devlink: Add macro for "fw.mgmt.api" to " Vasundhara Volam
@ 2020-03-27  9:44   ` Jiri Pirko
  0 siblings, 0 replies; 6+ messages in thread
From: Jiri Pirko @ 2020-03-27  9:44 UTC (permalink / raw)
  To: Vasundhara Volam
  Cc: davem, netdev, Jakub Kicinski, Jacob Keller, Jiri Pirko, Michael Chan

Fri, Mar 27, 2020 at 10:34:51AM CET, vasundhara-v.volam@broadcom.com wrote:
>Add definition and documentation for the new generic info
>"fw.mgmt.api". This macro specifies the version of the software
>interfaces between driver and firmware.
>
>Cc: Jakub Kicinski <kuba@kernel.org>
>Cc: Jacob Keller <jacob.e.keller@intel.com>
>Cc: Jiri Pirko <jiri@mellanox.com>
>Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
>Signed-off-by: Michael Chan <michael.chan@broadcom.com>
>---
>v1->v2: Rename macro to "fw.api" from "drv.spec".
>---
>v3->v4: Rename "fw.api" to "fw.mgmt.api", to make it more common
>across all vendors.

Sounds fine.

Reviewed-by: Jiri Pirko <jiri@mellanox.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v4 net-next 0/6] bnxt_en: Updates to devlink info_get cb
  2020-03-27  9:34 [PATCH v4 net-next 0/6] bnxt_en: Updates to devlink info_get cb Vasundhara Volam
  2020-03-27  9:34 ` [PATCH v4 net-next 1/6] devlink: Add macro for "fw.mgmt.api" to " Vasundhara Volam
  2020-03-27  9:34 ` [PATCH v4 net-next 2/6] bnxt_en: Add fw.mgmt.api version to devlink " Vasundhara Volam
@ 2020-03-27 17:39 ` Jakub Kicinski
  2020-03-27 22:35 ` David Miller
  3 siblings, 0 replies; 6+ messages in thread
From: Jakub Kicinski @ 2020-03-27 17:39 UTC (permalink / raw)
  To: Vasundhara Volam; +Cc: davem, netdev

On Fri, 27 Mar 2020 15:04:50 +0530 Vasundhara Volam wrote:
> This series adds support for a generic macro to devlink info_get cb.
> Adds support for fw.mgmt.api and board.id info to bnxt_en driver info_get
> cb. Also, updates the devlink-info.rst and bnxt.rst documentation
> accordingly.
> 
> This series adds a patch to fix few macro names that maps to bnxt_en
> firmware versions.

Great, thank you!

Reviewed-by: Jakub Kicinski <kuba@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v4 net-next 0/6] bnxt_en: Updates to devlink info_get cb
  2020-03-27  9:34 [PATCH v4 net-next 0/6] bnxt_en: Updates to devlink info_get cb Vasundhara Volam
                   ` (2 preceding siblings ...)
  2020-03-27 17:39 ` [PATCH v4 net-next 0/6] bnxt_en: Updates " Jakub Kicinski
@ 2020-03-27 22:35 ` David Miller
  3 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2020-03-27 22:35 UTC (permalink / raw)
  To: vasundhara-v.volam; +Cc: netdev

From: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Fri, 27 Mar 2020 15:04:50 +0530

> This series adds support for a generic macro to devlink info_get cb.
> Adds support for fw.mgmt.api and board.id info to bnxt_en driver info_get
> cb. Also, updates the devlink-info.rst and bnxt.rst documentation
> accordingly.
> 
> This series adds a patch to fix few macro names that maps to bnxt_en
> firmware versions.
> 
> ---
> v1->v2: Remove ECN dev param, base_mh_addr and serial number info support
> in this series.
> Rename drv.spec macro to fw.api.
> ---
> v2->v3: Remove hw.addr info as it is per netdev but not per device info.
> ---
> v3->v4: Rename "fw.api" to "fw.mgmt.api".
> Also, add a patch that modifies few macro names in info_get command,
> to match the devlink documentation.

Series applied, thank you.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-03-27 22:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-27  9:34 [PATCH v4 net-next 0/6] bnxt_en: Updates to devlink info_get cb Vasundhara Volam
2020-03-27  9:34 ` [PATCH v4 net-next 1/6] devlink: Add macro for "fw.mgmt.api" to " Vasundhara Volam
2020-03-27  9:44   ` Jiri Pirko
2020-03-27  9:34 ` [PATCH v4 net-next 2/6] bnxt_en: Add fw.mgmt.api version to devlink " Vasundhara Volam
2020-03-27 17:39 ` [PATCH v4 net-next 0/6] bnxt_en: Updates " Jakub Kicinski
2020-03-27 22:35 ` David Miller

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).