netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Michael Chan <michael.chan@broadcom.com>
Cc: davem@davemloft.net, jakub.kicinski@netronome.com,
	netdev@vger.kernel.org,
	Vasundhara Volam <vasundhara-v.volam@broadcom.com>,
	Jiri Pirko <jiri@mellanox.com>
Subject: Re: [PATCH net-next v2 13/13] bnxt_en: Add support for flashing the device via devlink
Date: Mon, 25 Nov 2019 11:19:59 +0100	[thread overview]
Message-ID: <20191125101959.GA5526@nanopsycho> (raw)
In-Reply-To: <1574566250-7546-14-git-send-email-michael.chan@broadcom.com>

Sun, Nov 24, 2019 at 04:30:50AM CET, michael.chan@broadcom.com wrote:
>From: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
>
>Use the same bnxt_flash_package_from_file() function to support
>devlink flash operation.
>
>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>
>---
> drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 20 ++++++++++++++++++++
> drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c |  4 ++--
> drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h |  2 ++
> 3 files changed, 24 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
>index 7078271..acb2dd6 100644
>--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
>+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
>@@ -14,6 +14,25 @@
> #include "bnxt.h"
> #include "bnxt_vfr.h"
> #include "bnxt_devlink.h"
>+#include "bnxt_ethtool.h"
>+
>+static int
>+bnxt_dl_flash_update(struct devlink *dl, const char *filename,
>+		     const char *region, struct netlink_ext_ack *extack)
>+{
>+	struct bnxt *bp = bnxt_get_bp_from_dl(dl);
>+
>+	if (region)
>+		return -EOPNOTSUPP;
>+
>+	if (!BNXT_PF(bp)) {
>+		NL_SET_ERR_MSG_MOD(extack,
>+				   "flash update not supported from a VF");
>+		return -EPERM;
>+	}
>+
>+	return bnxt_flash_package_from_file(bp->dev, filename, 0);
>+}
> 
> static int bnxt_fw_reporter_diagnose(struct devlink_health_reporter *reporter,
> 				     struct devlink_fmsg *fmsg,
>@@ -225,6 +244,7 @@ static const struct devlink_ops bnxt_dl_ops = {
> 	.eswitch_mode_set = bnxt_dl_eswitch_mode_set,
> 	.eswitch_mode_get = bnxt_dl_eswitch_mode_get,
> #endif /* CONFIG_BNXT_SRIOV */
>+	.flash_update	  = bnxt_dl_flash_update,

Could you please consider implementing flash status notifications?
See:
devlink_flash_update_begin_notify()
devlink_flash_update_end_notify()
devlink_flash_update_status_notify()


Thanks!


> };
> 
> enum bnxt_dl_param_id {
>diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
>index e455aaa..2ccf79c 100644
>--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
>+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
>@@ -2000,8 +2000,8 @@ static int bnxt_flash_firmware_from_file(struct net_device *dev,
> 	return rc;
> }
> 
>-static int bnxt_flash_package_from_file(struct net_device *dev,
>-					char *filename, u32 install_type)
>+int bnxt_flash_package_from_file(struct net_device *dev, const char *filename,
>+				 u32 install_type)
> {
> 	struct bnxt *bp = netdev_priv(dev);
> 	struct hwrm_nvm_install_update_output *resp = bp->hwrm_cmd_resp_addr;
>diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h
>index 01de7e7..4428d0a 100644
>--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h
>+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h
>@@ -81,6 +81,8 @@ extern const struct ethtool_ops bnxt_ethtool_ops;
> u32 _bnxt_fw_to_ethtool_adv_spds(u16, u8);
> u32 bnxt_fw_to_ethtool_speed(u16);
> u16 bnxt_get_fw_auto_link_speeds(u32);
>+int bnxt_flash_package_from_file(struct net_device *dev, const char *filename,
>+				 u32 install_type);
> void bnxt_ethtool_init(struct bnxt *bp);
> void bnxt_ethtool_free(struct bnxt *bp);
> 
>-- 
>2.5.1
>

  reply	other threads:[~2019-11-25 10:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-24  3:30 [PATCH net-next v2 00/13] bnxt_en: Updates Michael Chan
2019-11-24  3:30 ` [PATCH net-next v2 01/13] bnxt_en: Add chip IDs for 57452 and 57454 chips Michael Chan
2019-11-24  3:30 ` [PATCH net-next v2 02/13] bnxt_en: Disable/enable Bus master during suspend/resume Michael Chan
2019-11-24  3:30 ` [PATCH net-next v2 03/13] bnxt_en: Do driver unregister cleanup in bnxt_init_one() failure path Michael Chan
2019-11-24  3:30 ` [PATCH net-next v2 04/13] bnxt_en: Combine 2 functions calling the same HWRM_DRV_RGTR fw command Michael Chan
2019-11-24  3:30 ` [PATCH net-next v2 05/13] bnxt_en: Send FUNC_RESOURCE_QCAPS command in bnxt_resume() Michael Chan
2019-11-24  3:30 ` [PATCH net-next v2 06/13] bnxt_en: Fix suspend/resume path on 57500 chips Michael Chan
2019-11-24  3:30 ` [PATCH net-next v2 07/13] bnxt_en: Initialize context memory to the value specified by firmware Michael Chan
2019-11-24  3:30 ` [PATCH net-next v2 08/13] bnxt_en: Assign more RSS context resources to the VFs Michael Chan
2019-11-24  3:30 ` [PATCH net-next v2 09/13] bnxt_en: Skip disabling autoneg before PHY loopback when appropriate Michael Chan
2019-11-24  3:30 ` [PATCH net-next v2 10/13] bnxt_en: Refactor the initialization of the ethtool link settings Michael Chan
2019-11-24  3:30 ` [PATCH net-next v2 11/13] bnxt_en: Add async. event logic for PHY configuration changes Michael Chan
2019-11-24  3:30 ` [PATCH net-next v2 12/13] bnxt_en: Allow PHY settings on multi-function or NPAR PFs if allowed by FW Michael Chan
2019-11-24  3:30 ` [PATCH net-next v2 13/13] bnxt_en: Add support for flashing the device via devlink Michael Chan
2019-11-25 10:19   ` Jiri Pirko [this message]
2019-11-26  3:52     ` Vasundhara Volam
2019-11-24 22:55 ` [PATCH net-next v2 00/13] bnxt_en: Updates Jakub Kicinski

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=20191125101959.GA5526@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=jiri@mellanox.com \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=vasundhara-v.volam@broadcom.com \
    /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).