netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 net-next 0/5] bnxt_en: Updates to devlink info_get cb
@ 2020-03-26 12:02 Vasundhara Volam
  2020-03-26 12:02 ` [PATCH v3 net-next 1/5] devlink: Add macro for "fw.api" to " Vasundhara Volam
  2020-03-26 12:02 ` [PATCH v3 net-next 2/5] bnxt_en: Add fw.api version to devlink " Vasundhara Volam
  0 siblings, 2 replies; 7+ messages in thread
From: Vasundhara Volam @ 2020-03-26 12:02 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.api and board.id info to bnxt_en driver info_get cb.
Also, updates the devlink-info.rst and bnxt.rst documentation accordingly.

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

Vasundhara Volam (5):
  devlink: Add macro for "fw.api" to info_get cb.
  bnxt_en: Add fw.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

 Documentation/networking/devlink/bnxt.rst         |  6 ++
 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 | 13 ++++
 include/linux/pci.h                               |  1 +
 include/net/devlink.h                             |  2 +
 7 files changed, 106 insertions(+), 1 deletion(-)

-- 
1.8.3.1


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

* [PATCH v3 net-next 1/5] devlink: Add macro for "fw.api" to info_get cb.
  2020-03-26 12:02 [PATCH v3 net-next 0/5] bnxt_en: Updates to devlink info_get cb Vasundhara Volam
@ 2020-03-26 12:02 ` Vasundhara Volam
  2020-03-26 20:40   ` Jakub Kicinski
  2020-03-26 12:02 ` [PATCH v3 net-next 2/5] bnxt_en: Add fw.api version to devlink " Vasundhara Volam
  1 sibling, 1 reply; 7+ messages in thread
From: Vasundhara Volam @ 2020-03-26 12:02 UTC (permalink / raw)
  To: davem
  Cc: netdev, Vasundhara Volam, Jakub Kicinski, Jacob Keller, Michael Chan

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

Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: 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".
---
 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..650e2c0e3 100644
--- a/Documentation/networking/devlink/devlink-info.rst
+++ b/Documentation/networking/devlink/devlink-info.rst
@@ -150,6 +150,12 @@ fw
 Overall firmware version, often representing the collection of
 fw.mgmt, fw.app, etc.
 
+fw.api
+------
+
+Overall firmware interface specification version of the software interfaces
+between driver and firmware.
+
 fw.mgmt
 -------
 
diff --git a/include/net/devlink.h b/include/net/devlink.h
index 37230e2..d51482f 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -478,6 +478,8 @@ enum devlink_param_generic_id {
 
 /* Overall FW version */
 #define DEVLINK_INFO_VERSION_GENERIC_FW		"fw"
+/* Overall FW interface specification version */
+#define DEVLINK_INFO_VERSION_GENERIC_FW_API	"fw.api"
 /* Control processor FW version */
 #define DEVLINK_INFO_VERSION_GENERIC_FW_MGMT	"fw.mgmt"
 /* Data path microcode controlling high-speed packet processing */
-- 
1.8.3.1


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

* [PATCH v3 net-next 2/5] bnxt_en: Add fw.api version to devlink info_get cb.
  2020-03-26 12:02 [PATCH v3 net-next 0/5] bnxt_en: Updates to devlink info_get cb Vasundhara Volam
  2020-03-26 12:02 ` [PATCH v3 net-next 1/5] devlink: Add macro for "fw.api" to " Vasundhara Volam
@ 2020-03-26 12:02 ` Vasundhara Volam
  1 sibling, 0 replies; 7+ messages in thread
From: Vasundhara Volam @ 2020-03-26 12:02 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.
---
 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 |  5 +++++
 4 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/Documentation/networking/devlink/bnxt.rst b/Documentation/networking/devlink/bnxt.rst
index 82ef9ec..71f5a5a 100644
--- a/Documentation/networking/devlink/bnxt.rst
+++ b/Documentation/networking/devlink/bnxt.rst
@@ -63,6 +63,9 @@ The ``bnxt_en`` driver reports the following versions
    * - ``fw``
      - stored, running
      - Overall board firmware version
+   * - ``fw.api``
+     - running
+     - Minimum firmware interface spec version supported between driver and firmware
    * - ``fw.app``
      - stored, running
      - Data path firmware version
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 663dcf6..7bcd313 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 5adc25f..cc57538 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..51abc6c 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
@@ -434,6 +434,11 @@ static int bnxt_dl_info_get(struct devlink *dl, struct devlink_info_req *req,
 			return rc;
 	}
 
+	rc = devlink_info_version_running_put(req,
+			DEVLINK_INFO_VERSION_GENERIC_FW_API, bp->hwrm_ver_supp);
+	if (rc)
+		return rc;
+
 	if (BNXT_PF(bp) && !bnxt_hwrm_get_nvm_cfg_ver(bp, &nvm_cfg_ver)) {
 		u32 ver = nvm_cfg_ver.vu32;
 
-- 
1.8.3.1


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

* Re: [PATCH v3 net-next 1/5] devlink: Add macro for "fw.api" to info_get cb.
  2020-03-26 12:02 ` [PATCH v3 net-next 1/5] devlink: Add macro for "fw.api" to " Vasundhara Volam
@ 2020-03-26 20:40   ` Jakub Kicinski
  2020-03-26 23:09     ` Michael Chan
  0 siblings, 1 reply; 7+ messages in thread
From: Jakub Kicinski @ 2020-03-26 20:40 UTC (permalink / raw)
  To: Vasundhara Volam; +Cc: davem, netdev, Jacob Keller, Michael Chan

On Thu, 26 Mar 2020 17:32:34 +0530 Vasundhara Volam wrote:
> Add definition and documentation for the new generic info "fw.api".
> "fw.api" specifies the version of the software interfaces between
> driver and overall firmware.
> 
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Jacob Keller <jacob.e.keller@intel.com>
> Reviewed-by: 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".

I suggested "fw.mgmt.api", like Intel has. What else those this API
number covers beyond management? Do you negotiated descriptor formats
for the datapath?

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

* Re: [PATCH v3 net-next 1/5] devlink: Add macro for "fw.api" to info_get cb.
  2020-03-26 20:40   ` Jakub Kicinski
@ 2020-03-26 23:09     ` Michael Chan
  2020-03-26 23:39       ` Jacob Keller
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Chan @ 2020-03-26 23:09 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: Vasundhara Volam, David Miller, Netdev, Jacob Keller

On Thu, Mar 26, 2020 at 1:40 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Thu, 26 Mar 2020 17:32:34 +0530 Vasundhara Volam wrote:
> > Add definition and documentation for the new generic info "fw.api".
> > "fw.api" specifies the version of the software interfaces between
> > driver and overall firmware.
> >
> > Cc: Jakub Kicinski <kuba@kernel.org>
> > Cc: Jacob Keller <jacob.e.keller@intel.com>
> > Reviewed-by: 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".
>
> I suggested "fw.mgmt.api", like Intel has. What else those this API
> number covers beyond management? Do you negotiated descriptor formats
> for the datapath?

To us, "management" firmware usually means firmware such as IPMI that
interfaces with the BMC.  Here, we're trying to convey the API between
the driver and the main firmware.  Yes, this main firmware also
"manages" things such as rings, MAC, the physical port, etc.  But
again, we want to distinguish it from the platform management type of
firmware.

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

* Re: [PATCH v3 net-next 1/5] devlink: Add macro for "fw.api" to info_get cb.
  2020-03-26 23:09     ` Michael Chan
@ 2020-03-26 23:39       ` Jacob Keller
  2020-03-26 23:51         ` Jakub Kicinski
  0 siblings, 1 reply; 7+ messages in thread
From: Jacob Keller @ 2020-03-26 23:39 UTC (permalink / raw)
  To: Michael Chan, Jakub Kicinski; +Cc: Vasundhara Volam, David Miller, Netdev



On 3/26/2020 4:09 PM, Michael Chan wrote:
> On Thu, Mar 26, 2020 at 1:40 PM Jakub Kicinski <kuba@kernel.org> wrote:
>>
>> On Thu, 26 Mar 2020 17:32:34 +0530 Vasundhara Volam wrote:
>>> Add definition and documentation for the new generic info "fw.api".
>>> "fw.api" specifies the version of the software interfaces between
>>> driver and overall firmware.
>>>
>>> Cc: Jakub Kicinski <kuba@kernel.org>
>>> Cc: Jacob Keller <jacob.e.keller@intel.com>
>>> Reviewed-by: 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".
>>
>> I suggested "fw.mgmt.api", like Intel has. What else those this API
>> number covers beyond management? Do you negotiated descriptor formats
>> for the datapath?
> 
> To us, "management" firmware usually means firmware such as IPMI that
> interfaces with the BMC.  Here, we're trying to convey the API between
> the driver and the main firmware.  Yes, this main firmware also
> "manages" things such as rings, MAC, the physical port, etc.  But
> again, we want to distinguish it from the platform management type of
> firmware.
> 

Documentation for "fw.mgmt":

fw.mgmt
-------

Control unit firmware version. This firmware is responsible for house
keeping tasks, PHY control etc. but not the packet-by-packet data path
operation.

To me, platform management would need a new name, as the term "fw.mgmt"
has already been used by multiple drivers.

Thanks,
Jake

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

* Re: [PATCH v3 net-next 1/5] devlink: Add macro for "fw.api" to info_get cb.
  2020-03-26 23:39       ` Jacob Keller
@ 2020-03-26 23:51         ` Jakub Kicinski
  0 siblings, 0 replies; 7+ messages in thread
From: Jakub Kicinski @ 2020-03-26 23:51 UTC (permalink / raw)
  To: Jacob Keller; +Cc: Michael Chan, Vasundhara Volam, David Miller, Netdev

On Thu, 26 Mar 2020 16:39:31 -0700 Jacob Keller wrote:
> On 3/26/2020 4:09 PM, Michael Chan wrote:
> > On Thu, Mar 26, 2020 at 1:40 PM Jakub Kicinski <kuba@kernel.org> wrote:  
> >>
> >> On Thu, 26 Mar 2020 17:32:34 +0530 Vasundhara Volam wrote:  
> >>> Add definition and documentation for the new generic info "fw.api".
> >>> "fw.api" specifies the version of the software interfaces between
> >>> driver and overall firmware.
> >>>
> >>> Cc: Jakub Kicinski <kuba@kernel.org>
> >>> Cc: Jacob Keller <jacob.e.keller@intel.com>
> >>> Reviewed-by: 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".  
> >>
> >> I suggested "fw.mgmt.api", like Intel has. What else those this API
> >> number covers beyond management? Do you negotiated descriptor formats
> >> for the datapath?  
> > 
> > To us, "management" firmware usually means firmware such as IPMI that
> > interfaces with the BMC.  Here, we're trying to convey the API between
> > the driver and the main firmware.  Yes, this main firmware also
> > "manages" things such as rings, MAC, the physical port, etc.  But
> > again, we want to distinguish it from the platform management type of
> > firmware.
> >   
> 
> Documentation for "fw.mgmt":
> 
> fw.mgmt
> -------
> 
> Control unit firmware version. This firmware is responsible for house
> keeping tasks, PHY control etc. but not the packet-by-packet data path
> operation.
> 
> To me, platform management would need a new name, as the term "fw.mgmt"
> has already been used by multiple drivers.

Right, we already have:

fw.ncsi                                                                         
-------                                                                         
                                                                                
Version of the software responsible for supporting/handling the                 
Network Controller Sideband Interface.


Maybe something more broad is needed there, but let's keep mgmt's
meaning. I know this may not fit existing vendor nomenclature, but
that's kind of the point, we're trying to have common Linux naming..

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

end of thread, other threads:[~2020-03-26 23:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-26 12:02 [PATCH v3 net-next 0/5] bnxt_en: Updates to devlink info_get cb Vasundhara Volam
2020-03-26 12:02 ` [PATCH v3 net-next 1/5] devlink: Add macro for "fw.api" to " Vasundhara Volam
2020-03-26 20:40   ` Jakub Kicinski
2020-03-26 23:09     ` Michael Chan
2020-03-26 23:39       ` Jacob Keller
2020-03-26 23:51         ` Jakub Kicinski
2020-03-26 12:02 ` [PATCH v3 net-next 2/5] bnxt_en: Add fw.api version to devlink " Vasundhara Volam

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