* [PATCH net-next 0/2] bnge: Add ethtool register dump support
@ 2026-11-24 10:07 Ramakrishna Koduri
2026-11-24 10:07 ` [PATCH net-next 1/2] bnge: Add HSI definitions for register dump Ramakrishna Koduri
2026-11-24 10:07 ` [PATCH net-next 2/2] bnge: Add support for ethtool -d " Ramakrishna Koduri
0 siblings, 2 replies; 4+ messages in thread
From: Ramakrishna Koduri @ 2026-11-24 10:07 UTC (permalink / raw)
To: davem, edumazet, kuba, pabeni, andrew+netdev, horms
Cc: netdev, linux-kernel, vsrama-krishna.nemani, vikas.gupta,
bhargava.marreddy, ajit.khaparde, Ramakrishna Koduri
Hi,
This patch series adds ethtool register dump support (`ethtool -d`) for
the Broadcom BNGE Ethernet driver by implementing the `.get_regs` and
`.get_regs_len` ethtool callbacks.
The dump support covers:
- PXP registers
- PCIe signal integrity and PCIe Latency Histogram statistics
- Adaptive QoS TX and RX MBUF registers
Ramakrishna Koduri (2):
bnge: Add HSI definitions for register dump
bnge: Add support for ethtool -d register dump
drivers/net/ethernet/broadcom/bnge/bnge.h | 9 +
.../net/ethernet/broadcom/bnge/bnge_core.c | 3 +
.../net/ethernet/broadcom/bnge/bnge_ethtool.c | 168 +++++++++++++++++
.../net/ethernet/broadcom/bnge/bnge_ethtool.h | 19 ++
.../ethernet/broadcom/bnge/bnge_hwrm_lib.c | 178 +++++++++++++++++-
.../ethernet/broadcom/bnge/bnge_hwrm_lib.h | 5 +
include/linux/bnge/hsi.h | 149 +++++++++++++++
7 files changed, 530 insertions(+), 1 deletion(-)
--
2.52.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net-next 1/2] bnge: Add HSI definitions for register dump
2026-11-24 10:07 [PATCH net-next 0/2] bnge: Add ethtool register dump support Ramakrishna Koduri
@ 2026-11-24 10:07 ` Ramakrishna Koduri
2026-11-24 10:07 ` [PATCH net-next 2/2] bnge: Add support for ethtool -d " Ramakrishna Koduri
1 sibling, 0 replies; 4+ messages in thread
From: Ramakrishna Koduri @ 2026-11-24 10:07 UTC (permalink / raw)
To: davem, edumazet, kuba, pabeni, andrew+netdev, horms
Cc: netdev, linux-kernel, vsrama-krishna.nemani, vikas.gupta,
bhargava.marreddy, ajit.khaparde, Ramakrishna Koduri,
Rajashekar Hudumula
Add HSI support for get_regs and get_regs_len ethtool callbacks
to provide register dump support for the BNGE driver. This
includes support for PXP registers, PCIe signal integrity, PCIe
Latency Histogram and Adaptive QoS TX/RX MBUF registers.
Signed-off-by: Ramakrishna Koduri <ramakrishna.koduri@broadcom.com>
Reviewed-by: Vikas Gupta <vikas.gupta@broadcom.com>
Reviewed-by: Rajashekar Hudumula <rajashekar.hudumula@broadcom.com>
Reviewed-by: V.S.Rama Krishna Nemani <vsrama-krishna.nemani@broadcom.com>
---
include/linux/bnge/hsi.h | 149 +++++++++++++++++++++++++++++++++++++++
1 file changed, 149 insertions(+)
diff --git a/include/linux/bnge/hsi.h b/include/linux/bnge/hsi.h
index 834db3991691..1bebfc032e47 100644
--- a/include/linux/bnge/hsi.h
+++ b/include/linux/bnge/hsi.h
@@ -12900,4 +12900,153 @@ struct mpc_cmpl_hdr {
__le32 opaque;
};
+/* queue_adptv_qos_rx_info (size:960b/120B) */
+struct queue_adptv_qos_rx_info {
+ __le16 rx_shared_pool_cells;
+ __le16 rx_total_cells;
+ u8 rx_cell_size;
+ u8 rx_enabled_cos;
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_ENABLED_COS0 0x1UL
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_ENABLED_COS1 0x2UL
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_ENABLED_COS2 0x4UL
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_ENABLED_COS3 0x8UL
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_ENABLED_COS4 0x10UL
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_ENABLED_COS5 0x20UL
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_ENABLED_COS6 0x40UL
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_ENABLED_COS7 0x80UL
+ u8 rx_llfc_enabled;
+ u8 rx_pfc_enabled_cos;
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_PFC_ENABLED_COS0 0x1UL
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_PFC_ENABLED_COS1 0x2UL
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_PFC_ENABLED_COS2 0x4UL
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_PFC_ENABLED_COS3 0x8UL
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_PFC_ENABLED_COS4 0x10UL
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_PFC_ENABLED_COS5 0x20UL
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_PFC_ENABLED_COS6 0x40UL
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_PFC_ENABLED_COS7 0x80UL
+ __le16 rx_reserved_cells_cos[8];
+ __le16 rx_shared_cells_cos[8];
+ __le16 rx_shared_combined_cells_cos[8];
+ __le16 rx_headroom_cells_cos[8];
+ __le16 rx_headroom_combined_cells_cos[8];
+ u8 rx_shared_pool_index_cos[8];
+ u8 rx_roce_enabled_cos;
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_ROCE_ENABLED_COS0 0x1UL
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_ROCE_ENABLED_COS1 0x2UL
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_ROCE_ENABLED_COS2 0x4UL
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_ROCE_ENABLED_COS3 0x8UL
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_ROCE_ENABLED_COS4 0x10UL
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_ROCE_ENABLED_COS5 0x20UL
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_ROCE_ENABLED_COS6 0x40UL
+ #define QUEUE_ADPTV_QOS_RX_INFO_RX_ROCE_ENABLED_COS7 0x80UL
+ u8 unused_0[7];
+ __le16 rx_cos_allocate[8];
+};
+
+/* queue_adptv_qos_tx_info (size:640b/80B) */
+struct queue_adptv_qos_tx_info {
+ __le16 tx_shared_pool_cells;
+ __le16 tx_total_cells;
+ u8 tx_cell_size;
+ u8 tx_enabled_cos;
+ #define QUEUE_ADPTV_QOS_TX_INFO_TX_ENABLED_COS0 0x1UL
+ #define QUEUE_ADPTV_QOS_TX_INFO_TX_ENABLED_COS1 0x2UL
+ #define QUEUE_ADPTV_QOS_TX_INFO_TX_ENABLED_COS2 0x4UL
+ #define QUEUE_ADPTV_QOS_TX_INFO_TX_ENABLED_COS3 0x8UL
+ #define QUEUE_ADPTV_QOS_TX_INFO_TX_ENABLED_COS4 0x10UL
+ #define QUEUE_ADPTV_QOS_TX_INFO_TX_ENABLED_COS5 0x20UL
+ #define QUEUE_ADPTV_QOS_TX_INFO_TX_ENABLED_COS6 0x40UL
+ #define QUEUE_ADPTV_QOS_TX_INFO_TX_ENABLED_COS7 0x80UL
+ u8 tx_roce_enabled_cos;
+ #define QUEUE_ADPTV_QOS_TX_INFO_TX_ROCE_ENABLED_COS0 0x1UL
+ #define QUEUE_ADPTV_QOS_TX_INFO_TX_ROCE_ENABLED_COS1 0x2UL
+ #define QUEUE_ADPTV_QOS_TX_INFO_TX_ROCE_ENABLED_COS2 0x4UL
+ #define QUEUE_ADPTV_QOS_TX_INFO_TX_ROCE_ENABLED_COS3 0x8UL
+ #define QUEUE_ADPTV_QOS_TX_INFO_TX_ROCE_ENABLED_COS4 0x10UL
+ #define QUEUE_ADPTV_QOS_TX_INFO_TX_ROCE_ENABLED_COS5 0x20UL
+ #define QUEUE_ADPTV_QOS_TX_INFO_TX_ROCE_ENABLED_COS6 0x40UL
+ #define QUEUE_ADPTV_QOS_TX_INFO_TX_ROCE_ENABLED_COS7 0x80UL
+ u8 unused_0;
+ __le16 tx_reserved_cells_cos[8];
+ __le16 tx_shared_cells_cos[8];
+ __le16 tx_shared_combined_cells_cos[8];
+ u8 tx_shared_pool_index_cos[8];
+ __le16 tx_cos_allocate[8];
+};
+
+/* hwrm_queue_adptv_qos_rx_qcfg_input (size:256b/32B) */
+struct hwrm_queue_adptv_qos_rx_qcfg_input {
+ __le16 req_type;
+ __le16 cmpl_ring;
+ __le16 seq_id;
+ __le16 target_id;
+ __le64 resp_addr;
+ __le64 rx_qcfg_host_addr;
+ __le16 rx_qcfg_size;
+ u8 port_id;
+ u8 flags;
+ #define QUEUE_ADPTV_QOS_RX_QCFG_REQ_FLAGS_COUNTER_MASK 0x1UL
+ u8 unused_0[4];
+};
+
+/* hwrm_queue_adptv_qos_rx_qcfg_output (size:128b/16B) */
+struct hwrm_queue_adptv_qos_rx_qcfg_output {
+ __le16 error_code;
+ __le16 req_type;
+ __le16 seq_id;
+ __le16 resp_len;
+ __le16 rx_qcfg_size;
+ u8 unused_0[5];
+ u8 valid;
+};
+
+/* hwrm_queue_adptv_qos_tx_qcfg_input (size:256b/32B) */
+struct hwrm_queue_adptv_qos_tx_qcfg_input {
+ __le16 req_type;
+ __le16 cmpl_ring;
+ __le16 seq_id;
+ __le16 target_id;
+ __le64 resp_addr;
+ __le64 tx_qcfg_host_addr;
+ __le16 tx_qcfg_size;
+ u8 port_id;
+ u8 flags;
+ #define QUEUE_ADPTV_QOS_TX_QCFG_REQ_FLAGS_COUNTER_MASK 0x1UL
+ u8 unused_0[4];
+};
+
+/* hwrm_queue_adptv_qos_tx_qcfg_output (size:128b/16B) */
+struct hwrm_queue_adptv_qos_tx_qcfg_output {
+ __le16 error_code;
+ __le16 req_type;
+ __le16 seq_id;
+ __le16 resp_len;
+ __le16 tx_qcfg_size;
+ u8 unused_0[5];
+ u8 valid;
+};
+
+/* hwrm_dbg_read_direct_input (size:256b/32B) */
+struct hwrm_dbg_read_direct_input {
+ __le16 req_type;
+ __le16 cmpl_ring;
+ __le16 seq_id;
+ __le16 target_id;
+ __le64 resp_addr;
+ __le64 host_dest_addr;
+ __le32 read_addr;
+ __le32 read_len32;
+};
+
+/* hwrm_dbg_read_direct_output (size:128b/16B) */
+struct hwrm_dbg_read_direct_output {
+ __le16 error_code;
+ __le16 req_type;
+ __le16 seq_id;
+ __le16 resp_len;
+ __le32 crc32;
+ u8 unused_0[3];
+ u8 valid;
+};
+
#endif /* _BNGE_HSI_H_ */
--
2.52.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net-next 2/2] bnge: Add support for ethtool -d register dump
2026-11-24 10:07 [PATCH net-next 0/2] bnge: Add ethtool register dump support Ramakrishna Koduri
2026-11-24 10:07 ` [PATCH net-next 1/2] bnge: Add HSI definitions for register dump Ramakrishna Koduri
@ 2026-11-24 10:07 ` Ramakrishna Koduri
2026-11-25 10:11 ` netdev-bot+sashiko
1 sibling, 1 reply; 4+ messages in thread
From: Ramakrishna Koduri @ 2026-11-24 10:07 UTC (permalink / raw)
To: davem, edumazet, kuba, pabeni, andrew+netdev, horms
Cc: netdev, linux-kernel, vsrama-krishna.nemani, vikas.gupta,
bhargava.marreddy, ajit.khaparde, Ramakrishna Koduri,
Dharmender Garg, Kumar Mudide
Implement get_regs and get_regs_len ethtool callbacks to provide
register dump support for the BNGE driver. This includes support
for PXP registers, PCIe signal integrity, PCIe Latency Histogram
and Adaptive QoS TX/RX MBUF registers.
Signed-off-by: Ramakrishna Koduri <ramakrishna.koduri@broadcom.com>
Reviewed-by: Bhargava Marreddy <bhargava.marreddy@broadcom.com>
Reviewed-by: Dharmender Garg <dharmender.garg@broadcom.com>
Reviewed-by: Kumar Mudide <kumar.mudide@broadcom.com>
---
drivers/net/ethernet/broadcom/bnge/bnge.h | 9 +
.../net/ethernet/broadcom/bnge/bnge_core.c | 3 +
.../net/ethernet/broadcom/bnge/bnge_ethtool.c | 168 +++++++++++++++++
.../net/ethernet/broadcom/bnge/bnge_ethtool.h | 19 ++
.../ethernet/broadcom/bnge/bnge_hwrm_lib.c | 178 +++++++++++++++++-
.../ethernet/broadcom/bnge/bnge_hwrm_lib.h | 5 +
6 files changed, 381 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bnge/bnge.h b/drivers/net/ethernet/broadcom/bnge/bnge.h
index 64c792b278ad..a1255b63cd44 100644
--- a/drivers/net/ethernet/broadcom/bnge/bnge.h
+++ b/drivers/net/ethernet/broadcom/bnge/bnge.h
@@ -66,6 +66,7 @@ enum {
BNGE_FW_CAP_CFA_NTUPLE_RX_EXT_IP_PROTO = BIT_ULL(24),
BNGE_FW_CAP_CFA_RFS_RING_TBL_IDX_V3 = BIT_ULL(25),
BNGE_FW_CAP_VNIC_RE_FLUSH = BIT_ULL(26),
+ BNGE_FW_CAP_MBUF_DATA = BIT_ULL(27),
};
enum {
@@ -89,6 +90,10 @@ enum {
BNGE_RSS_CAP_ESP_V6_RSS_CAP = BIT(7),
};
+enum {
+ BNGE_STATS_CAP_PCIE = BIT(0),
+};
+
#define BNGE_MAX_QUEUE 8
struct bnge_queue_info {
u8 queue_id;
@@ -149,6 +154,8 @@ struct bnge_dev {
#define BNGE_STATE_OPEN 1
u64 fw_cap;
+ u32 stats_cap;
+ u32 fw_dbg_cap;
/* Backing stores */
struct bnge_ctx_mem_info *ctx;
@@ -250,6 +257,8 @@ struct bnge_dev {
#define bnge_for_each_open_nq(i, bd) \
for ((i) = BNGE_FIRST_OPEN_NQ; (i) < (bd)->nq_nr_rings; (i)++)
+#define CHIMP_REG_VIEW_ADDR 0x80000000
+
static inline bool bnge_is_roce_en(struct bnge_dev *bd)
{
return bd->flags & BNGE_EN_ROCE;
diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_core.c b/drivers/net/ethernet/broadcom/bnge/bnge_core.c
index c5d51b8ee9d1..cfa2e6363de1 100644
--- a/drivers/net/ethernet/broadcom/bnge/bnge_core.c
+++ b/drivers/net/ethernet/broadcom/bnge/bnge_core.c
@@ -8,6 +8,7 @@
#include "bnge.h"
#include "bnge_devlink.h"
+#include "bnge_ethtool.h"
#include "bnge_hwrm.h"
#include "bnge_hwrm_lib.h"
#include "bnge_link.h"
@@ -74,6 +75,8 @@ static int bnge_func_qcaps(struct bnge_dev *bd)
return rc;
}
+ bnge_hwrm_dbg_qcaps(bd);
+
return 0;
}
diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c b/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c
index 2467e44de291..3ada50832c6d 100644
--- a/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c
@@ -11,7 +11,9 @@
#include "bnge.h"
#include "bnge_ethtool.h"
+#include "bnge_hwrm.h"
#include "bnge_hwrm_lib.h"
+#include "bnge_netdev.h"
static int bnge_nway_reset(struct net_device *dev)
{
@@ -740,6 +742,170 @@ static int bnge_set_pauseparam(struct net_device *dev,
return rc;
}
+static void *__bnge_hwrm_pcie_qstats(struct bnge_dev *bd,
+ struct hwrm_pcie_qstats_input *req)
+{
+ struct pcie_ctx_hw_stats_v2 *hw_pcie_stats;
+ dma_addr_t hw_pcie_stats_addr;
+ int rc;
+
+ hw_pcie_stats = bnge_hwrm_req_dma_slice(bd, req, sizeof(*hw_pcie_stats),
+ &hw_pcie_stats_addr);
+ if (!hw_pcie_stats)
+ return NULL;
+
+ req->pcie_stat_size = cpu_to_le16(sizeof(*hw_pcie_stats));
+ req->pcie_stat_host_addr = cpu_to_le64(hw_pcie_stats_addr);
+ rc = bnge_hwrm_req_send(bd, req);
+
+ return rc ? NULL : hw_pcie_stats;
+}
+
+static int bnge_get_regs_len(struct net_device *dev)
+{
+ struct bnge_net *bn = netdev_priv(dev);
+ struct bnge_dev *bd = bn->bd;
+
+ if (bd->fw_cap & BNGE_FW_CAP_MBUF_DATA)
+ return BNGE_MBUF_REG_START + BNGE_MBUF_REG_LEN;
+
+ /* Reserve room for the largest PCIe stats layout so that the size
+ * reported here does not depend on a one-time discovery at init.
+ */
+ if (bd->stats_cap & BNGE_STATS_CAP_PCIE)
+ return BNGE_PXP_REG_LEN + sizeof(struct pcie_ctx_hw_stats_v2);
+
+ return BNGE_PXP_REG_LEN;
+}
+
+#define BNGE_PCIE_REG_SIZE(reg) \
+ sizeof_field(struct pcie_ctx_hw_stats_v2, pcie_##reg)
+
+static const struct bnge_reg_desc bnge_pcie_reg[] = {
+ { BNGE_PCIE_REG_SIZE(pl_signal_integrity), 8 },
+ { sizeof(__le16), 4 }, /* pcie_equalization_time: 4x __le16 */
+ { BNGE_PCIE_REG_SIZE(ltssm_histogram[0]), 4 },
+ { BNGE_PCIE_REG_SIZE(recovery_histogram), 1 },
+ { BNGE_PCIE_REG_SIZE(tl_credit_nph_histogram[0]), 94 },
+ { BNGE_PCIE_REG_SIZE(posted_packet_count), 5 },
+ { BNGE_PCIE_REG_SIZE(rd_latency_histogram[0]), 14 },
+};
+
+static void bnge_write_val(void *dst, void *src, u8 size)
+{
+ switch (size) {
+ case 1:
+ *(u8 *)dst = *(u8 *)src;
+ break;
+ case 2:
+ put_unaligned(get_unaligned_le16(src), (u16 *)dst);
+ break;
+ case 4:
+ put_unaligned(get_unaligned_le32(src), (u32 *)dst);
+ break;
+ case 8:
+ put_unaligned(get_unaligned_le64(src), (u64 *)dst);
+ break;
+ default:
+ WARN_ON_ONCE(1);
+ break;
+ }
+}
+
+void bnge_copy_regs(u8 *src, u8 *dst, const struct bnge_reg_desc *desc,
+ int num_desc, int max_len)
+{
+ u32 off = 0;
+ int i, j;
+
+ for (i = 0; i < num_desc; i++) {
+ const struct bnge_reg_desc *d = &desc[i];
+ u8 size = d->size;
+
+ for (j = 0; j < d->count; j++) {
+ if (off + size > max_len)
+ return;
+ bnge_write_val(dst + off, src + off, size);
+ off += size;
+ }
+ }
+}
+
+static void bnge_get_pcie_regs(struct bnge_dev *bd, struct ethtool_regs *regs,
+ u8 *dst)
+{
+ struct hwrm_pcie_qstats_output *resp;
+ struct hwrm_pcie_qstats_input *req;
+ u8 *src;
+ int len;
+
+ if (bnge_hwrm_req_init(bd, req, HWRM_PCIE_QSTATS))
+ return;
+
+ resp = bnge_hwrm_req_hold(bd, req);
+ src = __bnge_hwrm_pcie_qstats(bd, req);
+ if (!src)
+ goto drop_req;
+
+ len = min_t(int, le16_to_cpu(resp->pcie_stat_size),
+ sizeof(struct pcie_ctx_hw_stats_v2));
+ if (len <= 0)
+ goto drop_req;
+
+ if (len <= sizeof(struct pcie_ctx_hw_stats))
+ regs->version = 1;
+ else if (len < sizeof(struct pcie_ctx_hw_stats_v2))
+ regs->version = 2;
+ else
+ regs->version = 3;
+
+ bnge_copy_regs(src, dst, bnge_pcie_reg, ARRAY_SIZE(bnge_pcie_reg),
+ len);
+drop_req:
+ bnge_hwrm_req_drop(bd, req);
+}
+
+static void bnge_get_regs(struct net_device *dev, struct ethtool_regs *regs,
+ void *_p)
+{
+ struct bnge_net *bn = netdev_priv(dev);
+ struct bnge_dev *bd = bn->bd;
+ u8 *p = _p;
+
+ regs->version = 0;
+
+ if (BNGE_NO_FW_ACCESS(bd))
+ return;
+
+ if (!(bd->fw_dbg_cap & DBG_QCAPS_RESP_FLAGS_REG_ACCESS_RESTRICTED)) {
+ int rc;
+
+ rc = bnge_dbg_hwrm_rd_reg(bd, 0, BNGE_PXP_REG_LEN / 4, _p);
+ if (rc)
+ netdev_warn(dev, "Failed to read PXP regs: %d\n", rc);
+ }
+
+ if (bd->stats_cap & BNGE_STATS_CAP_PCIE)
+ bnge_get_pcie_regs(bd, regs, p + BNGE_PXP_REG_LEN);
+
+ if (bd->fw_cap & BNGE_FW_CAP_MBUF_DATA) {
+ int rc_rx, rc_tx;
+
+ /* Version 4 is required for the userspace ethtool decoder to
+ * dump MBUF stats. At least one of the RX/TX queries is
+ * expected to be supported; the direction that is unavailable
+ * reads back as zero, which the decoder expects. Report
+ * version 4 if either query succeeded.
+ */
+ rc_rx = bnge_hwrm_rx_mbuf_data(bd,
+ p + BNGE_RX_MBUF_REG_OFFSET);
+ rc_tx = bnge_hwrm_tx_mbuf_data(bd,
+ p + BNGE_TX_MBUF_REG_OFFSET);
+ if (!rc_rx || !rc_tx)
+ regs->version = 4;
+ }
+}
+
static const struct ethtool_ops bnge_ethtool_ops = {
.cap_link_lanes_supported = 1,
.get_link_ksettings = bnge_get_link_ksettings,
@@ -757,6 +923,8 @@ static const struct ethtool_ops bnge_ethtool_ops = {
.get_eth_ctrl_stats = bnge_get_eth_ctrl_stats,
.get_pause_stats = bnge_get_pause_stats,
.get_rmon_stats = bnge_get_rmon_stats,
+ .get_regs_len = bnge_get_regs_len,
+ .get_regs = bnge_get_regs,
};
void bnge_set_ethtool_ops(struct net_device *dev)
diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.h b/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.h
index 21e96a0976d5..8de501ad7f9a 100644
--- a/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.h
+++ b/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.h
@@ -4,6 +4,25 @@
#ifndef _BNGE_ETHTOOL_H_
#define _BNGE_ETHTOOL_H_
+struct bnge_dev;
+
+struct bnge_reg_desc {
+ u8 size;
+ u16 count;
+};
+
+void bnge_copy_regs(u8 *src, u8 *dst, const struct bnge_reg_desc *desc,
+ int num_desc, int max_len);
+
+#define BNGE_PXP_REG_LEN 0x3110
+
+#define BNGE_MBUF_REG_START 0x3800
+#define BNGE_MBUF_REG_LEN 0x12c
+
+#define BNGE_RX_MBUF_REG_OFFSET BNGE_MBUF_REG_START
+#define BNGE_TX_MBUF_REG_OFFSET (BNGE_RX_MBUF_REG_OFFSET + 0x64 + \
+ sizeof(struct queue_adptv_qos_rx_info))
+
void bnge_set_ethtool_ops(struct net_device *dev);
#endif /* _BNGE_ETHTOOL_H_ */
diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c b/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c
index 227de771f2ef..9b8cb39dbe16 100644
--- a/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c
+++ b/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c
@@ -15,6 +15,7 @@
#include "bnge_rmem.h"
#include "bnge_resc.h"
#include "bnge_netdev.h"
+#include "bnge_ethtool.h"
static const u16 bnge_async_events_arr[] = {
ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE,
@@ -597,12 +598,45 @@ int bnge_hwrm_func_resc_qcaps(struct bnge_dev *bd)
return rc;
}
+void bnge_hwrm_dbg_qcaps(struct bnge_dev *bd)
+{
+ struct hwrm_dbg_qcaps_output *resp;
+ struct hwrm_dbg_qcaps_input *req;
+ int rc;
+
+ bd->fw_dbg_cap = 0;
+ if (!(bd->fw_cap & BNGE_FW_CAP_DBG_QCAPS))
+ return;
+
+ /* Discovery failure is treated as restricted so we never attempt
+ * direct register reads without confirmation from firmware.
+ */
+ rc = bnge_hwrm_req_init(bd, req, HWRM_DBG_QCAPS);
+ if (rc) {
+ bd->fw_dbg_cap = DBG_QCAPS_RESP_FLAGS_REG_ACCESS_RESTRICTED;
+ return;
+ }
+
+ req->fid = cpu_to_le16(0xffff);
+ resp = bnge_hwrm_req_hold(bd, req);
+ rc = bnge_hwrm_req_send(bd, req);
+ if (rc) {
+ bd->fw_dbg_cap = DBG_QCAPS_RESP_FLAGS_REG_ACCESS_RESTRICTED;
+ goto hwrm_dbg_qcaps_exit;
+ }
+
+ bd->fw_dbg_cap = le32_to_cpu(resp->flags);
+
+hwrm_dbg_qcaps_exit:
+ bnge_hwrm_req_drop(bd, req);
+}
+
int bnge_hwrm_func_qcaps(struct bnge_dev *bd)
{
struct hwrm_func_qcaps_output *resp;
struct hwrm_func_qcaps_input *req;
struct bnge_pf_info *pf = &bd->pf;
- u32 flags, flags_ext;
+ u32 flags, flags_ext, flags_ext3;
int rc;
rc = bnge_hwrm_req_init(bd, req, HWRM_FUNC_QCAPS);
@@ -622,11 +656,19 @@ int bnge_hwrm_func_qcaps(struct bnge_dev *bd)
bd->flags |= BNGE_EN_ROCE_V2;
if (flags & FUNC_QCAPS_RESP_FLAGS_EXT_STATS_SUPPORTED)
bd->fw_cap |= BNGE_FW_CAP_EXT_STATS_SUPPORTED;
+ if (flags & FUNC_QCAPS_RESP_FLAGS_PCIE_STATS_SUPPORTED)
+ bd->stats_cap |= BNGE_STATS_CAP_PCIE;
+ if (flags & FUNC_QCAPS_RESP_FLAGS_DBG_QCAPS_CMD_SUPPORTED)
+ bd->fw_cap |= BNGE_FW_CAP_DBG_QCAPS;
flags_ext = le32_to_cpu(resp->flags_ext);
if (flags_ext & FUNC_QCAPS_RESP_FLAGS_EXT_EXT_HW_STATS_SUPPORTED)
bd->fw_cap |= BNGE_FW_CAP_EXT_HW_STATS_SUPPORTED;
+ flags_ext3 = le32_to_cpu(resp->flags_ext3);
+ if (flags_ext3 & FUNC_QCAPS_RESP_FLAGS_EXT3_MBUF_DATA_SUPPORTED)
+ bd->fw_cap |= BNGE_FW_CAP_MBUF_DATA;
+
pf->fw_fid = le16_to_cpu(resp->fid);
pf->port_id = le16_to_cpu(resp->port_id);
memcpy(pf->mac_addr, resp->mac_address, ETH_ALEN);
@@ -1637,3 +1679,137 @@ int bnge_hwrm_port_qstats(struct bnge_dev *bd, u8 flags)
return bnge_hwrm_req_send(bd, req);
}
+
+#define BNGE_RX_MBUF_REG_SIZE(reg) \
+ sizeof_field(struct queue_adptv_qos_rx_info, rx_##reg)
+
+static const struct bnge_reg_desc bnge_rx_mbuf_reg[] = {
+ { BNGE_RX_MBUF_REG_SIZE(shared_pool_cells), 2 },
+ { BNGE_RX_MBUF_REG_SIZE(cell_size), 4 },
+ { BNGE_RX_MBUF_REG_SIZE(reserved_cells_cos[0]), 40 },
+ /* Spans rx_shared_pool_index_cos[8] (8B), rx_roce_enabled_cos (1B),
+ * and unused_0[7] (7B) to sum to 16B.
+ */
+ { BNGE_RX_MBUF_REG_SIZE(shared_pool_index_cos[0]), 16 },
+ { BNGE_RX_MBUF_REG_SIZE(cos_allocate[0]), 8 },
+};
+
+#define BNGE_TX_MBUF_REG_SIZE(reg) \
+ sizeof_field(struct queue_adptv_qos_tx_info, tx_##reg)
+
+static const struct bnge_reg_desc bnge_tx_mbuf_reg[] = {
+ { BNGE_TX_MBUF_REG_SIZE(shared_pool_cells), 2 },
+ { BNGE_TX_MBUF_REG_SIZE(cell_size), 4 },
+ { BNGE_TX_MBUF_REG_SIZE(reserved_cells_cos[0]), 24 },
+ { BNGE_TX_MBUF_REG_SIZE(shared_pool_index_cos[0]), 8 },
+ { BNGE_TX_MBUF_REG_SIZE(cos_allocate[0]), 8 },
+};
+
+int bnge_hwrm_rx_mbuf_data(struct bnge_dev *bd, u8 *reg_buf)
+{
+ struct hwrm_queue_adptv_qos_rx_qcfg_output *resp;
+ struct hwrm_queue_adptv_qos_rx_qcfg_input *req;
+ struct queue_adptv_qos_rx_info *rx_mbuf_reg;
+ dma_addr_t rx_mbuf_reg_addr;
+ int rc;
+
+ rc = bnge_hwrm_req_init(bd, req, HWRM_QUEUE_ADPTV_QOS_RX_QCFG);
+ if (rc)
+ return rc;
+
+ resp = bnge_hwrm_req_hold(bd, req);
+ rx_mbuf_reg = bnge_hwrm_req_dma_slice(bd, req, sizeof(*rx_mbuf_reg),
+ &rx_mbuf_reg_addr);
+ if (!rx_mbuf_reg) {
+ rc = -ENOMEM;
+ goto hwrm_rx_mbuf_data_exit;
+ }
+
+ req->rx_qcfg_size = cpu_to_le16(sizeof(*rx_mbuf_reg));
+ req->port_id = (u8)bd->pf.port_id;
+ req->rx_qcfg_host_addr = cpu_to_le64(rx_mbuf_reg_addr);
+
+ rc = bnge_hwrm_req_send(bd, req);
+ if (!rc)
+ bnge_copy_regs((u8 *)rx_mbuf_reg, reg_buf, bnge_rx_mbuf_reg,
+ ARRAY_SIZE(bnge_rx_mbuf_reg),
+ le16_to_cpu(resp->rx_qcfg_size));
+hwrm_rx_mbuf_data_exit:
+ bnge_hwrm_req_drop(bd, req);
+ return rc;
+}
+
+int bnge_hwrm_tx_mbuf_data(struct bnge_dev *bd, u8 *reg_buf)
+{
+ struct hwrm_queue_adptv_qos_tx_qcfg_output *resp;
+ struct hwrm_queue_adptv_qos_tx_qcfg_input *req;
+ struct queue_adptv_qos_tx_info *tx_mbuf_reg;
+ dma_addr_t tx_mbuf_reg_addr;
+ int rc;
+
+ rc = bnge_hwrm_req_init(bd, req, HWRM_QUEUE_ADPTV_QOS_TX_QCFG);
+ if (rc)
+ return rc;
+
+ resp = bnge_hwrm_req_hold(bd, req);
+ tx_mbuf_reg = bnge_hwrm_req_dma_slice(bd, req, sizeof(*tx_mbuf_reg),
+ &tx_mbuf_reg_addr);
+ if (!tx_mbuf_reg) {
+ rc = -ENOMEM;
+ goto hwrm_tx_mbuf_data_exit;
+ }
+
+ req->tx_qcfg_size = cpu_to_le16(sizeof(*tx_mbuf_reg));
+ req->port_id = (u8)bd->pf.port_id;
+ req->tx_qcfg_host_addr = cpu_to_le64(tx_mbuf_reg_addr);
+
+ rc = bnge_hwrm_req_send(bd, req);
+ if (!rc)
+ bnge_copy_regs((u8 *)tx_mbuf_reg, reg_buf, bnge_tx_mbuf_reg,
+ ARRAY_SIZE(bnge_tx_mbuf_reg),
+ le16_to_cpu(resp->tx_qcfg_size));
+hwrm_tx_mbuf_data_exit:
+ bnge_hwrm_req_drop(bd, req);
+ return rc;
+}
+
+int bnge_dbg_hwrm_rd_reg(struct bnge_dev *bd, u32 reg_off, u16 num_words,
+ u32 *reg_buf)
+{
+ struct hwrm_dbg_read_direct_output *resp;
+ struct hwrm_dbg_read_direct_input *req;
+ __le32 *dbg_reg_buf;
+ dma_addr_t mapping;
+ int rc, i;
+
+ rc = bnge_hwrm_req_init(bd, req, HWRM_DBG_READ_DIRECT);
+ if (rc)
+ return rc;
+
+ dbg_reg_buf = bnge_hwrm_req_dma_slice(bd, req, num_words * 4,
+ &mapping);
+ if (!dbg_reg_buf) {
+ rc = -ENOMEM;
+ goto dbg_hwrm_rd_reg_exit;
+ }
+
+ req->host_dest_addr = cpu_to_le64(mapping);
+
+ resp = bnge_hwrm_req_hold(bd, req);
+ req->read_addr = cpu_to_le32(reg_off + CHIMP_REG_VIEW_ADDR);
+ req->read_len32 = cpu_to_le32(num_words);
+
+ rc = bnge_hwrm_req_send(bd, req);
+ if (rc)
+ goto dbg_hwrm_rd_reg_exit;
+ if (resp->error_code) {
+ rc = -EIO;
+ goto dbg_hwrm_rd_reg_exit;
+ }
+ for (i = 0; i < num_words; i++)
+ reg_buf[i] = le32_to_cpu(dbg_reg_buf[i]);
+
+dbg_hwrm_rd_reg_exit:
+ bnge_hwrm_req_drop(bd, req);
+ return rc;
+}
diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.h b/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.h
index bf452e390d5b..f754ef8616bc 100644
--- a/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.h
+++ b/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.h
@@ -65,4 +65,9 @@ int bnge_hwrm_shutdown_link(struct bnge_dev *bd);
int bnge_hwrm_port_qstats(struct bnge_dev *bd, u8 flags);
int bnge_hwrm_port_qstats_ext(struct bnge_dev *bd, u8 flags);
int bnge_hwrm_func_qstat_ext(struct bnge_dev *bd, struct bnge_stats_mem *stats);
+int bnge_hwrm_rx_mbuf_data(struct bnge_dev *bd, u8 *reg_buf);
+int bnge_hwrm_tx_mbuf_data(struct bnge_dev *bd, u8 *reg_buf);
+void bnge_hwrm_dbg_qcaps(struct bnge_dev *bd);
+int bnge_dbg_hwrm_rd_reg(struct bnge_dev *bd, u32 reg_off,
+ u16 num_words, u32 *reg_buf);
#endif /* _BNGE_HWRM_LIB_H_ */
--
2.52.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next 2/2] bnge: Add support for ethtool -d register dump
2026-11-24 10:07 ` [PATCH net-next 2/2] bnge: Add support for ethtool -d " Ramakrishna Koduri
@ 2026-11-25 10:11 ` netdev-bot+sashiko
0 siblings, 0 replies; 4+ messages in thread
From: netdev-bot+sashiko @ 2026-11-25 10:11 UTC (permalink / raw)
To: ramakrishna.koduri
Cc: davem, edumazet, kuba, pabeni, andrew+netdev, horms, netdev,
linux-kernel, vsrama-krishna.nemani, vikas.gupta,
bhargava.marreddy, ajit.khaparde, dharmender.garg, kumar.mudide
Thank you for your contribution! Sashiko AI review found 4 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 3
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] bnge_get_pcie_regs() sets regs->version to 1, 2 or 3 from the
PCIe stats size firmware actually returned (`min(resp->pcie_stat_size,…
- [Low] In bnge_hwrm_dbg_qcaps()
(drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c), the comment says…
- [Low] The commit message lists only the categories of data that are
dumped.
- [Low] In bnge_pcie_reg[]
(drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c, line 786),…
--
bnge: Add support for ethtool -d register dump
This commit adds get_regs and get_regs_len ethtool callbacks to the bnge
driver. The dump has three parts: PXP registers read through
HWRM_DBG_READ_DIRECT, PCIe statistics from HWRM_PCIE_QSTATS, and adaptive
QoS RX/TX MBUF data. It also adds HWRM_DBG_QCAPS discovery at probe time and
reads new capability flags from FUNC_QCAPS.
> Implement get_regs and get_regs_len ethtool callbacks to provide
> register dump support for the BNGE driver. This includes support
> for PXP registers, PCIe signal integrity, PCIe Latency Histogram
> and Adaptive QoS TX/RX MBUF registers.
[Severity: Low]
Could the commit message describe the dump layout and the version numbers?
Both become visible to userspace once this is merged.
The layout is:
- PXP registers at offset 0
- PCIe stats at BNGE_PXP_REG_LEN (0x3110)
- RX MBUF data at 0x3800
- TX MBUF data at:
#define BNGE_TX_MBUF_REG_OFFSET (BNGE_RX_MBUF_REG_OFFSET + 0x64 + \
sizeof(struct queue_adptv_qos_rx_info))
What is the 0x64 byte gap between the RX and TX blocks? BNGE_MBUF_REG_LEN
(0x12c) seems to include it.
regs->version can be anything from 0 to 4, and version 4 does not exist in
bnxt. The comment in bnge_get_regs() says "Version 4 is required for the
userspace ethtool decoder". DRV_NAME is "bng_en", though, so ethtool will not
use its existing bnxt decoder. Is a bng_en decoder available or planned?
The patch also adds a new HWRM_DBG_QCAPS query at probe time, through
bnge_func_qcaps()->bnge_hwrm_dbg_qcaps(). The commit message doesn't mention
this either.
> diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c b/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c
> index 2467e44de291a..3ada50832c6d9 100644
> --- a/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c
> +++ b/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c
[ ... ]
> @@ -740,6 +742,170 @@ static int bnge_set_pauseparam(struct net_device *dev,
[ ... ]
> +#define BNGE_PCIE_REG_SIZE(reg) \
> + sizeof_field(struct pcie_ctx_hw_stats_v2, pcie_##reg)
> +
> +static const struct bnge_reg_desc bnge_pcie_reg[] = {
> + { BNGE_PCIE_REG_SIZE(pl_signal_integrity), 8 },
> + { sizeof(__le16), 4 }, /* pcie_equalization_time: 4x __le16 */
[Severity: Low]
Does this entry match the HSI definition? include/linux/bnge/hsi.h declares
the field as a single 64-bit value, in both pcie_ctx_hw_stats and
pcie_ctx_hw_stats_v2:
__le64 pcie_equalization_time;
Every other entry in this table takes its size from the struct through
BNGE_PCIE_REG_SIZE(). This one hardcodes 2 bytes instead.
The difference shows up on big-endian hosts. Converting four __le16 values
swaps the bytes inside each 16-bit part but leaves the parts in their
original order. A single le64_to_cpu() also reverses the order of the parts.
bnxt_get_regs() converts this field as one u64.
Should the HSI describe the field as __le16[4]? Or should this entry use
BNGE_PCIE_REG_SIZE(equalization_time) with a count of 1?
> + { BNGE_PCIE_REG_SIZE(ltssm_histogram[0]), 4 },
> + { BNGE_PCIE_REG_SIZE(recovery_histogram), 1 },
> + { BNGE_PCIE_REG_SIZE(tl_credit_nph_histogram[0]), 94 },
> + { BNGE_PCIE_REG_SIZE(posted_packet_count), 5 },
> + { BNGE_PCIE_REG_SIZE(rd_latency_histogram[0]), 14 },
> +};
[ ... ]
> +static void bnge_get_pcie_regs(struct bnge_dev *bd, struct ethtool_regs *regs,
> + u8 *dst)
> +{
[ ... ]
> + len = min_t(int, le16_to_cpu(resp->pcie_stat_size),
> + sizeof(struct pcie_ctx_hw_stats_v2));
> + if (len <= 0)
> + goto drop_req;
> +
> + if (len <= sizeof(struct pcie_ctx_hw_stats))
> + regs->version = 1;
> + else if (len < sizeof(struct pcie_ctx_hw_stats_v2))
> + regs->version = 2;
> + else
> + regs->version = 3;
[ ... ]
> +static void bnge_get_regs(struct net_device *dev, struct ethtool_regs *regs,
> + void *_p)
> +{
> + struct bnge_net *bn = netdev_priv(dev);
> + struct bnge_dev *bd = bn->bd;
> + u8 *p = _p;
> +
> + regs->version = 0;
> +
> + if (BNGE_NO_FW_ACCESS(bd))
> + return;
> +
> + if (!(bd->fw_dbg_cap & DBG_QCAPS_RESP_FLAGS_REG_ACCESS_RESTRICTED)) {
> + int rc;
> +
> + rc = bnge_dbg_hwrm_rd_reg(bd, 0, BNGE_PXP_REG_LEN / 4, _p);
> + if (rc)
> + netdev_warn(dev, "Failed to read PXP regs: %d\n", rc);
> + }
> +
> + if (bd->stats_cap & BNGE_STATS_CAP_PCIE)
> + bnge_get_pcie_regs(bd, regs, p + BNGE_PXP_REG_LEN);
> +
> + if (bd->fw_cap & BNGE_FW_CAP_MBUF_DATA) {
> + int rc_rx, rc_tx;
[ ... ]
> + rc_rx = bnge_hwrm_rx_mbuf_data(bd,
> + p + BNGE_RX_MBUF_REG_OFFSET);
> + rc_tx = bnge_hwrm_tx_mbuf_data(bd,
> + p + BNGE_TX_MBUF_REG_OFFSET);
> + if (!rc_rx || !rc_tx)
> + regs->version = 4;
[Severity: Medium]
Doesn't this assignment throw away the PCIe layout version that
bnge_get_pcie_regs() just set?
bnge_get_pcie_regs() picks version 1, 2 or 3 from the size firmware returned
in resp->pcie_stat_size. That version is the only thing that tells userspace
how much of the PCIe region holds real data.
If BNGE_FW_CAP_MBUF_DATA is set and either MBUF query succeeds, the version
becomes 4. That happens in all of these cases:
- the PCIe stats were v1 sized
- the PCIe stats were v2 sized or full v2
- HWRM_PCIE_QSTATS failed
- PCIe stats were never queried because BNGE_STATS_CAP_PCIE isn't set
The ethtool core zero-fills the buffer. A decoder that sees version 4 would
treat the unwritten tail as real TL credit and latency histogram values.
bnxt_get_regs() uses the same 1/2/3 scheme but never overwrites it.
A related point: when bnge_dbg_hwrm_rd_reg() fails, the only sign is the
netdev_warn() above. The zeroed 0x3110 byte PXP region is still reported as
register contents, and neither version nor len tells userspace about the
failure. bnxt behaves the same way today.
> + }
> +}
[ ... ]
> diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c b/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c
> index 227de771f2ef6..9b8cb39dbe164 100644
> --- a/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c
> +++ b/drivers/net/ethernet/broadcom/bnge/bnge_hwrm_lib.c
[ ... ]
> @@ -597,12 +598,45 @@ int bnge_hwrm_func_resc_qcaps(struct bnge_dev *bd)
> return rc;
> }
>
> +void bnge_hwrm_dbg_qcaps(struct bnge_dev *bd)
> +{
> + struct hwrm_dbg_qcaps_output *resp;
> + struct hwrm_dbg_qcaps_input *req;
> + int rc;
> +
> + bd->fw_dbg_cap = 0;
> + if (!(bd->fw_cap & BNGE_FW_CAP_DBG_QCAPS))
> + return;
> +
> + /* Discovery failure is treated as restricted so we never attempt
> + * direct register reads without confirmation from firmware.
> + */
[Severity: Low]
Does the early return above match this comment? If firmware doesn't advertise
FUNC_QCAPS_RESP_FLAGS_DBG_QCAPS_CMD_SUPPORTED, fw_dbg_cap stays 0.
bnge_get_regs() only checks the restricted bit:
if (!(bd->fw_dbg_cap & DBG_QCAPS_RESP_FLAGS_REG_ACCESS_RESTRICTED)) {
...
rc = bnge_dbg_hwrm_rd_reg(bd, 0, BNGE_PXP_REG_LEN / 4, _p);
So HWRM_DBG_READ_DIRECT is sent for 0xc44 words in exactly the case where
firmware has confirmed the least. If firmware rejects the request, every
ethtool -d logs "Failed to read PXP regs".
bnxt_hwrm_dbg_qcaps() also treats missing DBG_QCAPS as unrestricted. Should
the comment be changed to match? Or should this branch also set
DBG_QCAPS_RESP_FLAGS_REG_ACCESS_RESTRICTED?
> + rc = bnge_hwrm_req_init(bd, req, HWRM_DBG_QCAPS);
> + if (rc) {
> + bd->fw_dbg_cap = DBG_QCAPS_RESP_FLAGS_REG_ACCESS_RESTRICTED;
> + return;
> + }
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261124100751.179270-1-ramakrishna.koduri%40broadcom.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-11-25 10:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-24 10:07 [PATCH net-next 0/2] bnge: Add ethtool register dump support Ramakrishna Koduri
2026-11-24 10:07 ` [PATCH net-next 1/2] bnge: Add HSI definitions for register dump Ramakrishna Koduri
2026-11-24 10:07 ` [PATCH net-next 2/2] bnge: Add support for ethtool -d " Ramakrishna Koduri
2026-11-25 10:11 ` netdev-bot+sashiko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®