linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] net: ethtool: add support for ETH_RESET_AP
@ 2017-11-30 19:35 Scott Branden
  2017-11-30 19:35 ` [PATCH 1/2] net: ethtool: add support for reset of AP inside NIC interface Scott Branden
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Scott Branden @ 2017-11-30 19:35 UTC (permalink / raw)
  To: David S. Miller, Allan W. Nielsen, Andrew Lunn, Raju Lakkaraju,
	Florian Fainelli
  Cc: BCM Kernel Feedback, linux-kernel, Steve Lin, netdev,
	Michael Chan, Scott Branden

Add support to reset appplication processors inside SmartNICs by
defining new ETH_RESET_AP bit.

And use new ETH_RESET_AP bit in bnxt ethernet driver.

Scott Branden (2):
  net: ethtool: add support for reset of AP inside NIC interface.
  bnxt_en: Add ETH_RESET_AP support

 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 11 +++++++++++
 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h |  1 +
 include/uapi/linux/ethtool.h                      |  1 +
 3 files changed, 13 insertions(+)

-- 
2.5.0

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

* [PATCH 1/2] net: ethtool: add support for reset of AP inside NIC interface.
  2017-11-30 19:35 [PATCH 0/2] net: ethtool: add support for ETH_RESET_AP Scott Branden
@ 2017-11-30 19:35 ` Scott Branden
  2017-11-30 19:36 ` [PATCH 2/2] bnxt_en: Add ETH_RESET_AP support Scott Branden
  2017-12-01 20:30 ` [PATCH 0/2] net: ethtool: add support for ETH_RESET_AP David Miller
  2 siblings, 0 replies; 5+ messages in thread
From: Scott Branden @ 2017-11-30 19:35 UTC (permalink / raw)
  To: David S. Miller, Allan W. Nielsen, Andrew Lunn, Raju Lakkaraju,
	Florian Fainelli
  Cc: BCM Kernel Feedback, linux-kernel, Steve Lin, netdev,
	Michael Chan, Scott Branden

Add ETH_RESET_AP to reset the application processor(s) inside the NIC
interface.

Current ETH_RESET_MGMT supports a management processor inside this NIC.
This is typically used for remote NIC management purposes.

Application processors exist inside some SmartNICs to run various
applications inside the NIC processor - be it a simple algorithm without
an OS to as complex as hosting multiple VMs.

Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
 include/uapi/linux/ethtool.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index ac71559..44a0b67 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -1686,6 +1686,7 @@ enum ethtool_reset_flags {
 	ETH_RESET_PHY		= 1 << 6,	/* Transceiver/PHY */
 	ETH_RESET_RAM		= 1 << 7,	/* RAM shared between
 						 * multiple components */
+	ETH_RESET_AP		= 1 << 8,	/* Application processor */
 
 	ETH_RESET_DEDICATED	= 0x0000ffff,	/* All components dedicated to
 						 * this interface */
-- 
2.5.0

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

* [PATCH 2/2] bnxt_en: Add ETH_RESET_AP support
  2017-11-30 19:35 [PATCH 0/2] net: ethtool: add support for ETH_RESET_AP Scott Branden
  2017-11-30 19:35 ` [PATCH 1/2] net: ethtool: add support for reset of AP inside NIC interface Scott Branden
@ 2017-11-30 19:36 ` Scott Branden
  2017-11-30 19:44   ` Michael Chan
  2017-12-01 20:30 ` [PATCH 0/2] net: ethtool: add support for ETH_RESET_AP David Miller
  2 siblings, 1 reply; 5+ messages in thread
From: Scott Branden @ 2017-11-30 19:36 UTC (permalink / raw)
  To: David S. Miller, Allan W. Nielsen, Andrew Lunn, Raju Lakkaraju,
	Florian Fainelli
  Cc: BCM Kernel Feedback, linux-kernel, Steve Lin, netdev,
	Michael Chan, Scott Branden

Add ETH_RESET_AP support handling to reset the internal
Application Processor(s) of the SmartNIC card.

Signed-off-by: Scott Branden <scott.branden@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 11 +++++++++++
 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h |  1 +
 2 files changed, 12 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index 7ce1d4b..fc2c483 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -1376,6 +1376,9 @@ static int bnxt_firmware_reset(struct net_device *dev,
 		req.embedded_proc_type = FW_RESET_REQ_EMBEDDED_PROC_TYPE_CHIP;
 		req.selfrst_status = FW_RESET_REQ_SELFRST_STATUS_SELFRSTASAP;
 		break;
+	case BNXT_FW_RESET_AP:
+		req.embedded_proc_type = FW_RESET_REQ_EMBEDDED_PROC_TYPE_AP;
+		break;
 	default:
 		return -EINVAL;
 	}
@@ -2522,6 +2525,14 @@ static int bnxt_reset(struct net_device *dev, u32 *flags)
 		rc = bnxt_firmware_reset(dev, BNXT_FW_RESET_CHIP);
 		if (!rc)
 			netdev_info(dev, "Reset request successful. Reload driver to complete reset\n");
+	} else if (*flags == ETH_RESET_AP) {
+		/* This feature is not supported in older firmware versions */
+		if (bp->hwrm_spec_code < 0x10803)
+			return -EOPNOTSUPP;
+
+		rc = bnxt_firmware_reset(dev, BNXT_FW_RESET_AP);
+		if (!rc)
+			netdev_info(dev, "Reset Application Processor request successful.\n");
 	} else {
 		rc = -EINVAL;
 	}
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h
index ff601b4..836ef68 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h
@@ -34,6 +34,7 @@ struct bnxt_led_cfg {
 #define BNXT_LED_DFLT_ENABLES(x)			\
 	cpu_to_le32(BNXT_LED_DFLT_ENA << (BNXT_LED_DFLT_ENA_SHIFT * (x)))
 
+#define BNXT_FW_RESET_AP	0xfffe
 #define BNXT_FW_RESET_CHIP	0xffff
 
 extern const struct ethtool_ops bnxt_ethtool_ops;
-- 
2.5.0

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

* Re: [PATCH 2/2] bnxt_en: Add ETH_RESET_AP support
  2017-11-30 19:36 ` [PATCH 2/2] bnxt_en: Add ETH_RESET_AP support Scott Branden
@ 2017-11-30 19:44   ` Michael Chan
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Chan @ 2017-11-30 19:44 UTC (permalink / raw)
  To: Scott Branden
  Cc: David S. Miller, Allan W. Nielsen, Andrew Lunn, Raju Lakkaraju,
	Florian Fainelli, BCM Kernel Feedback, open list, Steve Lin,
	Netdev

On Thu, Nov 30, 2017 at 11:36 AM, Scott Branden
<scott.branden@broadcom.com> wrote:
> Add ETH_RESET_AP support handling to reset the internal
> Application Processor(s) of the SmartNIC card.
>
> Signed-off-by: Scott Branden <scott.branden@broadcom.com>

Acked-by: Michael Chan <michael.chan@broadcom.com>

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

* Re: [PATCH 0/2] net: ethtool: add support for ETH_RESET_AP
  2017-11-30 19:35 [PATCH 0/2] net: ethtool: add support for ETH_RESET_AP Scott Branden
  2017-11-30 19:35 ` [PATCH 1/2] net: ethtool: add support for reset of AP inside NIC interface Scott Branden
  2017-11-30 19:36 ` [PATCH 2/2] bnxt_en: Add ETH_RESET_AP support Scott Branden
@ 2017-12-01 20:30 ` David Miller
  2 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2017-12-01 20:30 UTC (permalink / raw)
  To: scott.branden
  Cc: allan.nielsen, andrew, Raju.Lakkaraju, f.fainelli,
	bcm-kernel-feedback-list, linux-kernel, steven.lin1, netdev,
	michael.chan

From: Scott Branden <scott.branden@broadcom.com>
Date: Thu, 30 Nov 2017 11:35:58 -0800

> Add support to reset appplication processors inside SmartNICs by
> defining new ETH_RESET_AP bit.
> 
> And use new ETH_RESET_AP bit in bnxt ethernet driver.

Looks good, series applied, thanks!

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

end of thread, other threads:[~2017-12-01 20:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-30 19:35 [PATCH 0/2] net: ethtool: add support for ETH_RESET_AP Scott Branden
2017-11-30 19:35 ` [PATCH 1/2] net: ethtool: add support for reset of AP inside NIC interface Scott Branden
2017-11-30 19:36 ` [PATCH 2/2] bnxt_en: Add ETH_RESET_AP support Scott Branden
2017-11-30 19:44   ` Michael Chan
2017-12-01 20:30 ` [PATCH 0/2] net: ethtool: add support for ETH_RESET_AP 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).