Skip to content

Commit 50e0f5c

Browse files
committed
Merge branch 'ethtool-reset-AP'
Scott Branden says: ==================== net: ethtool: add support for ETH_RESET_AP 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. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 68bf33f + 6502ad5 commit 50e0f5c

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,6 +1376,9 @@ static int bnxt_firmware_reset(struct net_device *dev,
13761376
req.embedded_proc_type = FW_RESET_REQ_EMBEDDED_PROC_TYPE_CHIP;
13771377
req.selfrst_status = FW_RESET_REQ_SELFRST_STATUS_SELFRSTASAP;
13781378
break;
1379+
case BNXT_FW_RESET_AP:
1380+
req.embedded_proc_type = FW_RESET_REQ_EMBEDDED_PROC_TYPE_AP;
1381+
break;
13791382
default:
13801383
return -EINVAL;
13811384
}
@@ -2522,6 +2525,14 @@ static int bnxt_reset(struct net_device *dev, u32 *flags)
25222525
rc = bnxt_firmware_reset(dev, BNXT_FW_RESET_CHIP);
25232526
if (!rc)
25242527
netdev_info(dev, "Reset request successful. Reload driver to complete reset\n");
2528+
} else if (*flags == ETH_RESET_AP) {
2529+
/* This feature is not supported in older firmware versions */
2530+
if (bp->hwrm_spec_code < 0x10803)
2531+
return -EOPNOTSUPP;
2532+
2533+
rc = bnxt_firmware_reset(dev, BNXT_FW_RESET_AP);
2534+
if (!rc)
2535+
netdev_info(dev, "Reset Application Processor request successful.\n");
25252536
} else {
25262537
rc = -EINVAL;
25272538
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ struct bnxt_led_cfg {
3434
#define BNXT_LED_DFLT_ENABLES(x) \
3535
cpu_to_le32(BNXT_LED_DFLT_ENA << (BNXT_LED_DFLT_ENA_SHIFT * (x)))
3636

37+
#define BNXT_FW_RESET_AP 0xfffe
3738
#define BNXT_FW_RESET_CHIP 0xffff
3839

3940
extern const struct ethtool_ops bnxt_ethtool_ops;

include/uapi/linux/ethtool.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,6 +1686,7 @@ enum ethtool_reset_flags {
16861686
ETH_RESET_PHY = 1 << 6, /* Transceiver/PHY */
16871687
ETH_RESET_RAM = 1 << 7, /* RAM shared between
16881688
* multiple components */
1689+
ETH_RESET_AP = 1 << 8, /* Application processor */
16891690

16901691
ETH_RESET_DEDICATED = 0x0000ffff, /* All components dedicated to
16911692
* this interface */

0 commit comments

Comments
 (0)