* [PATCH net-next 00/10] bnxt_en update.
@ 2020-07-27 3:29 Michael Chan
2020-07-27 3:29 ` [PATCH net-next 01/10] bnxt_en: Remove PCIe non-counters from ethtool statistics Michael Chan
` (10 more replies)
0 siblings, 11 replies; 15+ messages in thread
From: Michael Chan @ 2020-07-27 3:29 UTC (permalink / raw)
To: davem; +Cc: netdev, kuba
This patchset removes the PCIe histogram and other debug register
data from ethtool -S. The removed data are not counters and they have
very large and constantly fluctuating values that are not suitable for
the ethtool -S decimal counter display.
The rest of the patches implement counter rollover for all hardware
counters that are not 64-bit counters. Different generations of
hardware have different counter widths. The driver will now query
the counter widths of all counters from firmware and implement
rollover support on all non-64-bit counters.
The last patch adds the PCIe histogram and other PCIe register data back
using the ethtool -d interface.
Michael Chan (8):
bnxt_en: Update firmware interface to 1.10.1.54.
bnxt_en: Use macros to define port statistics size and offset.
bnxt_en: Refactor statistics code and structures.
bnxt_en: Allocate additional memory for all statistics blocks.
bnxt_en: Retrieve hardware counter masks from firmware if available.
bnxt_en: Retrieve hardware masks for port counters.
bnxt_en: Accumulate all counters.
bnxt_en: Switch over to use the 64-bit software accumulated counters.
Vasundhara Volam (2):
bnxt_en: Remove PCIe non-counters from ethtool statistics
bnxt_en: Add support for 'ethtool -d'
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 494 ++++++++++++++++------
drivers/net/ethernet/broadcom/bnxt/bnxt.h | 96 ++++-
drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c | 2 +-
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 138 +++---
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h | 2 +
drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h | 468 ++++++++++++++------
drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 2 +-
7 files changed, 860 insertions(+), 342 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH net-next 01/10] bnxt_en: Remove PCIe non-counters from ethtool statistics
2020-07-27 3:29 [PATCH net-next 00/10] bnxt_en update Michael Chan
@ 2020-07-27 3:29 ` Michael Chan
2020-07-27 3:29 ` [PATCH net-next 02/10] bnxt_en: Update firmware interface to 1.10.1.54 Michael Chan
` (9 subsequent siblings)
10 siblings, 0 replies; 15+ messages in thread
From: Michael Chan @ 2020-07-27 3:29 UTC (permalink / raw)
To: davem; +Cc: netdev, kuba, Vasundhara Volam
From: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Remove PCIe non-counters display from ethtool statistics, as
they are not simple counters but register dump. The next few
patches will add logic to detect counter roll-over and it won't
work with these PCIe non-counters.
There will be a follow up patch to get PCIe information via
ethtool register dump.
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.c | 35 +-------------------
drivers/net/ethernet/broadcom/bnxt/bnxt.h | 6 ----
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 39 -----------------------
3 files changed, 1 insertion(+), 79 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index a7e5ebe..b294de1 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -3730,12 +3730,6 @@ static void bnxt_free_port_stats(struct bnxt *bp)
bp->hw_rx_port_stats_ext_map);
bp->hw_rx_port_stats_ext = NULL;
}
-
- if (bp->hw_pcie_stats) {
- dma_free_coherent(&pdev->dev, sizeof(struct pcie_ctx_hw_stats),
- bp->hw_pcie_stats, bp->hw_pcie_stats_map);
- bp->hw_pcie_stats = NULL;
- }
}
static void bnxt_free_ring_stats(struct bnxt *bp)
@@ -3818,7 +3812,7 @@ static int bnxt_alloc_stats(struct bnxt *bp)
alloc_tx_ext_stats:
if (bp->hw_tx_port_stats_ext)
- goto alloc_pcie_stats;
+ return 0;
if (bp->hwrm_spec_code >= 0x10902 ||
(bp->fw_cap & BNXT_FW_CAP_EXT_STATS_SUPPORTED)) {
@@ -3829,19 +3823,6 @@ static int bnxt_alloc_stats(struct bnxt *bp)
GFP_KERNEL);
}
bp->flags |= BNXT_FLAG_PORT_STATS_EXT;
-
-alloc_pcie_stats:
- if (bp->hw_pcie_stats ||
- !(bp->fw_cap & BNXT_FW_CAP_PCIE_STATS_SUPPORTED))
- return 0;
-
- bp->hw_pcie_stats =
- dma_alloc_coherent(&pdev->dev, sizeof(struct pcie_ctx_hw_stats),
- &bp->hw_pcie_stats_map, GFP_KERNEL);
- if (!bp->hw_pcie_stats)
- return 0;
-
- bp->flags |= BNXT_FLAG_PCIE_STATS;
return 0;
}
@@ -7566,19 +7547,6 @@ static int bnxt_hwrm_port_qstats_ext(struct bnxt *bp)
return rc;
}
-static int bnxt_hwrm_pcie_qstats(struct bnxt *bp)
-{
- struct hwrm_pcie_qstats_input req = {0};
-
- if (!(bp->flags & BNXT_FLAG_PCIE_STATS))
- return 0;
-
- bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_PCIE_QSTATS, -1, -1);
- req.pcie_stat_size = cpu_to_le16(sizeof(struct pcie_ctx_hw_stats));
- req.pcie_stat_host_addr = cpu_to_le64(bp->hw_pcie_stats_map);
- return hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
-}
-
static void bnxt_hwrm_free_tunnel_ports(struct bnxt *bp)
{
if (bp->vxlan_fw_dst_port_id != INVALID_HW_RING_ID)
@@ -10458,7 +10426,6 @@ static void bnxt_sp_task(struct work_struct *work)
if (test_and_clear_bit(BNXT_PERIODIC_STATS_SP_EVENT, &bp->sp_event)) {
bnxt_hwrm_port_qstats(bp);
bnxt_hwrm_port_qstats_ext(bp);
- bnxt_hwrm_pcie_qstats(bp);
}
if (test_and_clear_bit(BNXT_LINK_CHNG_SP_EVENT, &bp->sp_event)) {
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index 2acd7f9..10286cb 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -1566,7 +1566,6 @@ struct bnxt {
#define BNXT_FLAG_DIM 0x2000000
#define BNXT_FLAG_ROCE_MIRROR_CAP 0x4000000
#define BNXT_FLAG_PORT_STATS_EXT 0x10000000
- #define BNXT_FLAG_PCIE_STATS 0x40000000
#define BNXT_FLAG_ALL_CONFIG_FEATS (BNXT_FLAG_TPA | \
BNXT_FLAG_RFS | \
@@ -1737,12 +1736,10 @@ struct bnxt {
struct tx_port_stats *hw_tx_port_stats;
struct rx_port_stats_ext *hw_rx_port_stats_ext;
struct tx_port_stats_ext *hw_tx_port_stats_ext;
- struct pcie_ctx_hw_stats *hw_pcie_stats;
dma_addr_t hw_rx_port_stats_map;
dma_addr_t hw_tx_port_stats_map;
dma_addr_t hw_rx_port_stats_ext_map;
dma_addr_t hw_tx_port_stats_ext_map;
- dma_addr_t hw_pcie_stats_map;
int hw_port_stats_size;
u16 fw_rx_stats_ext_size;
u16 fw_tx_stats_ext_size;
@@ -1898,9 +1895,6 @@ struct bnxt {
#define BNXT_TX_STATS_EXT_OFFSET(counter) \
(offsetof(struct tx_port_stats_ext, counter) / 8)
-#define BNXT_PCIE_STATS_OFFSET(counter) \
- (offsetof(struct pcie_ctx_hw_stats, counter) / 8)
-
#define BNXT_HW_FEATURE_VLAN_ALL_RX \
(NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX)
#define BNXT_HW_FEATURE_VLAN_ALL_TX \
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index 538c976..dded170 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -293,9 +293,6 @@ static int bnxt_set_coalesce(struct net_device *dev,
BNXT_TX_STATS_PRI_ENTRY(counter, 6), \
BNXT_TX_STATS_PRI_ENTRY(counter, 7)
-#define BNXT_PCIE_STATS_ENTRY(counter) \
- { BNXT_PCIE_STATS_OFFSET(counter), __stringify(counter) }
-
enum {
RX_TOTAL_DISCARDS,
TX_TOTAL_DISCARDS,
@@ -454,24 +451,6 @@ enum {
BNXT_TX_STATS_PRI_ENTRIES(tx_packets),
};
-static const struct {
- long offset;
- char string[ETH_GSTRING_LEN];
-} bnxt_pcie_stats_arr[] = {
- BNXT_PCIE_STATS_ENTRY(pcie_pl_signal_integrity),
- BNXT_PCIE_STATS_ENTRY(pcie_dl_signal_integrity),
- BNXT_PCIE_STATS_ENTRY(pcie_tl_signal_integrity),
- BNXT_PCIE_STATS_ENTRY(pcie_link_integrity),
- BNXT_PCIE_STATS_ENTRY(pcie_tx_traffic_rate),
- BNXT_PCIE_STATS_ENTRY(pcie_rx_traffic_rate),
- BNXT_PCIE_STATS_ENTRY(pcie_tx_dllp_statistics),
- BNXT_PCIE_STATS_ENTRY(pcie_rx_dllp_statistics),
- BNXT_PCIE_STATS_ENTRY(pcie_equalization_time),
- BNXT_PCIE_STATS_ENTRY(pcie_ltssm_histogram[0]),
- BNXT_PCIE_STATS_ENTRY(pcie_ltssm_histogram[2]),
- BNXT_PCIE_STATS_ENTRY(pcie_recovery_histogram),
-};
-
#define BNXT_NUM_SW_FUNC_STATS ARRAY_SIZE(bnxt_sw_func_stats)
#define BNXT_NUM_PORT_STATS ARRAY_SIZE(bnxt_port_stats_arr)
#define BNXT_NUM_STATS_PRI \
@@ -479,7 +458,6 @@ enum {
ARRAY_SIZE(bnxt_rx_pkts_pri_arr) + \
ARRAY_SIZE(bnxt_tx_bytes_pri_arr) + \
ARRAY_SIZE(bnxt_tx_pkts_pri_arr))
-#define BNXT_NUM_PCIE_STATS ARRAY_SIZE(bnxt_pcie_stats_arr)
static int bnxt_get_num_tpa_ring_stats(struct bnxt *bp)
{
@@ -526,9 +504,6 @@ static int bnxt_get_num_stats(struct bnxt *bp)
num_stats += BNXT_NUM_STATS_PRI;
}
- if (bp->flags & BNXT_FLAG_PCIE_STATS)
- num_stats += BNXT_NUM_PCIE_STATS;
-
return num_stats;
}
@@ -674,14 +649,6 @@ static void bnxt_get_ethtool_stats(struct net_device *dev,
}
}
}
- if (bp->flags & BNXT_FLAG_PCIE_STATS) {
- __le64 *pcie_stats = (__le64 *)bp->hw_pcie_stats;
-
- for (i = 0; i < BNXT_NUM_PCIE_STATS; i++, j++) {
- buf[j] = le64_to_cpu(*(pcie_stats +
- bnxt_pcie_stats_arr[i].offset));
- }
- }
}
static void bnxt_get_strings(struct net_device *dev, u32 stringset, u8 *buf)
@@ -782,12 +749,6 @@ static void bnxt_get_strings(struct net_device *dev, u32 stringset, u8 *buf)
}
}
}
- if (bp->flags & BNXT_FLAG_PCIE_STATS) {
- for (i = 0; i < BNXT_NUM_PCIE_STATS; i++) {
- strcpy(buf, bnxt_pcie_stats_arr[i].string);
- buf += ETH_GSTRING_LEN;
- }
- }
break;
case ETH_SS_TEST:
if (bp->num_tests)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net-next 02/10] bnxt_en: Update firmware interface to 1.10.1.54.
2020-07-27 3:29 [PATCH net-next 00/10] bnxt_en update Michael Chan
2020-07-27 3:29 ` [PATCH net-next 01/10] bnxt_en: Remove PCIe non-counters from ethtool statistics Michael Chan
@ 2020-07-27 3:29 ` Michael Chan
2020-07-27 7:31 ` kernel test robot
2020-07-27 3:29 ` [PATCH net-next 03/10] bnxt_en: Use macros to define port statistics size and offset Michael Chan
` (8 subsequent siblings)
10 siblings, 1 reply; 15+ messages in thread
From: Michael Chan @ 2020-07-27 3:29 UTC (permalink / raw)
To: davem; +Cc: netdev, kuba
Main changes are 200G support and fixing the definitions of discard and
error counters to match the hardware definitions.
Because the HWRM_PORT_PHY_QCFG message size has now exceeded the max.
encapsulated response message size of 96 bytes from the PF to the VF,
we now need to cap this message to 96 bytes for forwarding. The forwarded
response only needs to contain the basic link status and speed information
and can be capped without adding the new information.
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +-
drivers/net/ethernet/broadcom/bnxt/bnxt.h | 44 ++
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 4 +-
drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h | 468 ++++++++++++++++------
drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 2 +-
5 files changed, 390 insertions(+), 130 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index b294de1..cd794b0 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -9597,7 +9597,7 @@ static void bnxt_get_ring_stats(struct bnxt *bp,
stats->multicast += le64_to_cpu(hw_stats->rx_mcast_pkts);
- stats->tx_dropped += le64_to_cpu(hw_stats->tx_drop_pkts);
+ stats->tx_dropped += le64_to_cpu(hw_stats->tx_error_pkts);
}
}
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index 10286cb..306636d 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -1135,6 +1135,50 @@ struct bnxt_ntuple_filter {
#define BNXT_FLTR_UPDATE 1
};
+struct hwrm_port_phy_qcfg_output_compat {
+ __le16 error_code;
+ __le16 req_type;
+ __le16 seq_id;
+ __le16 resp_len;
+ u8 link;
+ u8 link_signal_mode;
+ __le16 link_speed;
+ u8 duplex_cfg;
+ u8 pause;
+ __le16 support_speeds;
+ __le16 force_link_speed;
+ u8 auto_mode;
+ u8 auto_pause;
+ __le16 auto_link_speed;
+ __le16 auto_link_speed_mask;
+ u8 wirespeed;
+ u8 lpbk;
+ u8 force_pause;
+ u8 module_status;
+ __le32 preemphasis;
+ u8 phy_maj;
+ u8 phy_min;
+ u8 phy_bld;
+ u8 phy_type;
+ u8 media_type;
+ u8 xcvr_pkg_type;
+ u8 eee_config_phy_addr;
+ u8 parallel_detect;
+ __le16 link_partner_adv_speeds;
+ u8 link_partner_adv_auto_mode;
+ u8 link_partner_adv_pause;
+ __le16 adv_eee_link_speed_mask;
+ __le16 link_partner_adv_eee_link_speed_mask;
+ __le32 xcvr_identifier_type_tx_lpi_timer;
+ __le16 fec_cfg;
+ u8 duplex_state;
+ u8 option_flags;
+ char phy_vendor_name[16];
+ char phy_vendor_partnumber[16];
+ u8 unused_0[7];
+ u8 valid;
+};
+
struct bnxt_link_info {
u8 phy_type;
u8 media_type;
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index dded170..c8bafab 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -142,7 +142,7 @@ static int bnxt_set_coalesce(struct net_device *dev,
"rx_mcast_packets",
"rx_bcast_packets",
"rx_discards",
- "rx_drops",
+ "rx_errors",
"rx_ucast_bytes",
"rx_mcast_bytes",
"rx_bcast_bytes",
@@ -152,8 +152,8 @@ static int bnxt_set_coalesce(struct net_device *dev,
"tx_ucast_packets",
"tx_mcast_packets",
"tx_bcast_packets",
+ "tx_errors",
"tx_discards",
- "tx_drops",
"tx_ucast_bytes",
"tx_mcast_bytes",
"tx_bcast_bytes",
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h
index 7e9235c..c4af6bf 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h
@@ -169,9 +169,14 @@ struct cmd_nums {
#define HWRM_RING_CMPL_RING_QAGGINT_PARAMS 0x52UL
#define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS 0x53UL
#define HWRM_RING_AGGINT_QCAPS 0x54UL
+ #define HWRM_RING_SCHQ_ALLOC 0x55UL
+ #define HWRM_RING_SCHQ_CFG 0x56UL
+ #define HWRM_RING_SCHQ_FREE 0x57UL
#define HWRM_RING_RESET 0x5eUL
#define HWRM_RING_GRP_ALLOC 0x60UL
#define HWRM_RING_GRP_FREE 0x61UL
+ #define HWRM_RING_CFG 0x62UL
+ #define HWRM_RING_QCFG 0x63UL
#define HWRM_RESERVED5 0x64UL
#define HWRM_RESERVED6 0x65UL
#define HWRM_VNIC_RSS_COS_LB_CTX_ALLOC 0x70UL
@@ -224,6 +229,7 @@ struct cmd_nums {
#define HWRM_FW_IPC_MAILBOX 0xccUL
#define HWRM_FW_ECN_CFG 0xcdUL
#define HWRM_FW_ECN_QCFG 0xceUL
+ #define HWRM_FW_SECURE_CFG 0xcfUL
#define HWRM_EXEC_FWD_RESP 0xd0UL
#define HWRM_REJECT_FWD_RESP 0xd1UL
#define HWRM_FWD_RESP 0xd2UL
@@ -337,6 +343,7 @@ struct cmd_nums {
#define HWRM_FUNC_VF_BW_QCFG 0x196UL
#define HWRM_FUNC_HOST_PF_IDS_QUERY 0x197UL
#define HWRM_FUNC_QSTATS_EXT 0x198UL
+ #define HWRM_STAT_EXT_CTX_QUERY 0x199UL
#define HWRM_SELFTEST_QLIST 0x200UL
#define HWRM_SELFTEST_EXEC 0x201UL
#define HWRM_SELFTEST_IRQ 0x202UL
@@ -353,24 +360,30 @@ struct cmd_nums {
#define HWRM_TF_VERSION_GET 0x2bdUL
#define HWRM_TF_SESSION_OPEN 0x2c6UL
#define HWRM_TF_SESSION_ATTACH 0x2c7UL
- #define HWRM_TF_SESSION_CLOSE 0x2c8UL
- #define HWRM_TF_SESSION_QCFG 0x2c9UL
- #define HWRM_TF_SESSION_RESC_QCAPS 0x2caUL
- #define HWRM_TF_SESSION_RESC_ALLOC 0x2cbUL
- #define HWRM_TF_SESSION_RESC_FREE 0x2ccUL
- #define HWRM_TF_SESSION_RESC_FLUSH 0x2cdUL
- #define HWRM_TF_TBL_TYPE_GET 0x2d0UL
- #define HWRM_TF_TBL_TYPE_SET 0x2d1UL
- #define HWRM_TF_CTXT_MEM_RGTR 0x2daUL
- #define HWRM_TF_CTXT_MEM_UNRGTR 0x2dbUL
- #define HWRM_TF_EXT_EM_QCAPS 0x2dcUL
- #define HWRM_TF_EXT_EM_OP 0x2ddUL
- #define HWRM_TF_EXT_EM_CFG 0x2deUL
- #define HWRM_TF_EXT_EM_QCFG 0x2dfUL
- #define HWRM_TF_TCAM_SET 0x2eeUL
- #define HWRM_TF_TCAM_GET 0x2efUL
- #define HWRM_TF_TCAM_MOVE 0x2f0UL
- #define HWRM_TF_TCAM_FREE 0x2f1UL
+ #define HWRM_TF_SESSION_REGISTER 0x2c8UL
+ #define HWRM_TF_SESSION_UNREGISTER 0x2c9UL
+ #define HWRM_TF_SESSION_CLOSE 0x2caUL
+ #define HWRM_TF_SESSION_QCFG 0x2cbUL
+ #define HWRM_TF_SESSION_RESC_QCAPS 0x2ccUL
+ #define HWRM_TF_SESSION_RESC_ALLOC 0x2cdUL
+ #define HWRM_TF_SESSION_RESC_FREE 0x2ceUL
+ #define HWRM_TF_SESSION_RESC_FLUSH 0x2cfUL
+ #define HWRM_TF_TBL_TYPE_GET 0x2daUL
+ #define HWRM_TF_TBL_TYPE_SET 0x2dbUL
+ #define HWRM_TF_CTXT_MEM_RGTR 0x2e4UL
+ #define HWRM_TF_CTXT_MEM_UNRGTR 0x2e5UL
+ #define HWRM_TF_EXT_EM_QCAPS 0x2e6UL
+ #define HWRM_TF_EXT_EM_OP 0x2e7UL
+ #define HWRM_TF_EXT_EM_CFG 0x2e8UL
+ #define HWRM_TF_EXT_EM_QCFG 0x2e9UL
+ #define HWRM_TF_EM_INSERT 0x2eaUL
+ #define HWRM_TF_EM_DELETE 0x2ebUL
+ #define HWRM_TF_TCAM_SET 0x2f8UL
+ #define HWRM_TF_TCAM_GET 0x2f9UL
+ #define HWRM_TF_TCAM_MOVE 0x2faUL
+ #define HWRM_TF_TCAM_FREE 0x2fbUL
+ #define HWRM_TF_GLOBAL_CFG_SET 0x2fcUL
+ #define HWRM_TF_GLOBAL_CFG_GET 0x2fdUL
#define HWRM_SV 0x400UL
#define HWRM_DBG_READ_DIRECT 0xff10UL
#define HWRM_DBG_READ_INDIRECT 0xff11UL
@@ -391,6 +404,7 @@ struct cmd_nums {
#define HWRM_DBG_QCAPS 0xff20UL
#define HWRM_DBG_QCFG 0xff21UL
#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG 0xff22UL
+ #define HWRM_NVM_REQ_ARBITRATION 0xffedUL
#define HWRM_NVM_FACTORY_DEFAULTS 0xffeeUL
#define HWRM_NVM_VALIDATE_OPTION 0xffefUL
#define HWRM_NVM_FLUSH 0xfff0UL
@@ -464,8 +478,8 @@ struct hwrm_err_output {
#define HWRM_VERSION_MAJOR 1
#define HWRM_VERSION_MINOR 10
#define HWRM_VERSION_UPDATE 1
-#define HWRM_VERSION_RSVD 33
-#define HWRM_VERSION_STR "1.10.1.33"
+#define HWRM_VERSION_RSVD 54
+#define HWRM_VERSION_STR "1.10.1.54"
/* hwrm_ver_get_input (size:192b/24B) */
struct hwrm_ver_get_input {
@@ -1094,6 +1108,8 @@ struct hwrm_func_vf_cfg_input {
#define FUNC_VF_CFG_REQ_FLAGS_STAT_CTX_ASSETS_TEST 0x20UL
#define FUNC_VF_CFG_REQ_FLAGS_VNIC_ASSETS_TEST 0x40UL
#define FUNC_VF_CFG_REQ_FLAGS_L2_CTX_ASSETS_TEST 0x80UL
+ #define FUNC_VF_CFG_REQ_FLAGS_PPP_PUSH_MODE_ENABLE 0x100UL
+ #define FUNC_VF_CFG_REQ_FLAGS_PPP_PUSH_MODE_DISABLE 0x200UL
__le16 num_rsscos_ctxs;
__le16 num_cmpl_rings;
__le16 num_tx_rings;
@@ -1189,10 +1205,16 @@ struct hwrm_func_qcaps_output {
__le16 max_sp_tx_rings;
u8 unused_0[2];
__le32 flags_ext;
- #define FUNC_QCAPS_RESP_FLAGS_EXT_ECN_MARK_SUPPORTED 0x1UL
- #define FUNC_QCAPS_RESP_FLAGS_EXT_ECN_STATS_SUPPORTED 0x2UL
- #define FUNC_QCAPS_RESP_FLAGS_EXT_EXT_HW_STATS_SUPPORTED 0x4UL
- u8 unused_1[3];
+ #define FUNC_QCAPS_RESP_FLAGS_EXT_ECN_MARK_SUPPORTED 0x1UL
+ #define FUNC_QCAPS_RESP_FLAGS_EXT_ECN_STATS_SUPPORTED 0x2UL
+ #define FUNC_QCAPS_RESP_FLAGS_EXT_EXT_HW_STATS_SUPPORTED 0x4UL
+ #define FUNC_QCAPS_RESP_FLAGS_EXT_HOT_RESET_IF_SUPPORT 0x8UL
+ #define FUNC_QCAPS_RESP_FLAGS_EXT_PROXY_MODE_SUPPORT 0x10UL
+ #define FUNC_QCAPS_RESP_FLAGS_EXT_TX_PROXY_SRC_INTF_OVERRIDE_SUPPORT 0x20UL
+ #define FUNC_QCAPS_RESP_FLAGS_EXT_SCHQ_SUPPORTED 0x40UL
+ #define FUNC_QCAPS_RESP_FLAGS_EXT_PPP_PUSH_MODE_SUPPORTED 0x80UL
+ u8 max_schqs;
+ u8 unused_1[2];
u8 valid;
};
@@ -1226,6 +1248,8 @@ struct hwrm_func_qcfg_output {
#define FUNC_QCFG_RESP_FLAGS_TRUSTED_VF 0x40UL
#define FUNC_QCFG_RESP_FLAGS_SECURE_MODE_ENABLED 0x80UL
#define FUNC_QCFG_RESP_FLAGS_PREBOOT_LEGACY_L2_RINGS 0x100UL
+ #define FUNC_QCFG_RESP_FLAGS_HOT_RESET_ALLOWED 0x200UL
+ #define FUNC_QCFG_RESP_FLAGS_PPP_PUSH_MODE_ENABLED 0x400UL
u8 mac_address[6];
__le16 pci_id;
__le16 alloc_rsscos_ctx;
@@ -1321,7 +1345,7 @@ struct hwrm_func_qcfg_output {
u8 valid;
};
-/* hwrm_func_cfg_input (size:704b/88B) */
+/* hwrm_func_cfg_input (size:768b/96B) */
struct hwrm_func_cfg_input {
__le16 req_type;
__le16 cmpl_ring;
@@ -1352,30 +1376,35 @@ struct hwrm_func_cfg_input {
#define FUNC_CFG_REQ_FLAGS_NQ_ASSETS_TEST 0x800000UL
#define FUNC_CFG_REQ_FLAGS_TRUSTED_VF_DISABLE 0x1000000UL
#define FUNC_CFG_REQ_FLAGS_PREBOOT_LEGACY_L2_RINGS 0x2000000UL
+ #define FUNC_CFG_REQ_FLAGS_HOT_RESET_IF_EN_DIS 0x4000000UL
+ #define FUNC_CFG_REQ_FLAGS_PPP_PUSH_MODE_ENABLE 0x8000000UL
+ #define FUNC_CFG_REQ_FLAGS_PPP_PUSH_MODE_DISABLE 0x10000000UL
__le32 enables;
- #define FUNC_CFG_REQ_ENABLES_MTU 0x1UL
- #define FUNC_CFG_REQ_ENABLES_MRU 0x2UL
- #define FUNC_CFG_REQ_ENABLES_NUM_RSSCOS_CTXS 0x4UL
- #define FUNC_CFG_REQ_ENABLES_NUM_CMPL_RINGS 0x8UL
- #define FUNC_CFG_REQ_ENABLES_NUM_TX_RINGS 0x10UL
- #define FUNC_CFG_REQ_ENABLES_NUM_RX_RINGS 0x20UL
- #define FUNC_CFG_REQ_ENABLES_NUM_L2_CTXS 0x40UL
- #define FUNC_CFG_REQ_ENABLES_NUM_VNICS 0x80UL
- #define FUNC_CFG_REQ_ENABLES_NUM_STAT_CTXS 0x100UL
- #define FUNC_CFG_REQ_ENABLES_DFLT_MAC_ADDR 0x200UL
- #define FUNC_CFG_REQ_ENABLES_DFLT_VLAN 0x400UL
- #define FUNC_CFG_REQ_ENABLES_DFLT_IP_ADDR 0x800UL
- #define FUNC_CFG_REQ_ENABLES_MIN_BW 0x1000UL
- #define FUNC_CFG_REQ_ENABLES_MAX_BW 0x2000UL
- #define FUNC_CFG_REQ_ENABLES_ASYNC_EVENT_CR 0x4000UL
- #define FUNC_CFG_REQ_ENABLES_VLAN_ANTISPOOF_MODE 0x8000UL
- #define FUNC_CFG_REQ_ENABLES_ALLOWED_VLAN_PRIS 0x10000UL
- #define FUNC_CFG_REQ_ENABLES_EVB_MODE 0x20000UL
- #define FUNC_CFG_REQ_ENABLES_NUM_MCAST_FILTERS 0x40000UL
- #define FUNC_CFG_REQ_ENABLES_NUM_HW_RING_GRPS 0x80000UL
- #define FUNC_CFG_REQ_ENABLES_CACHE_LINESIZE 0x100000UL
- #define FUNC_CFG_REQ_ENABLES_NUM_MSIX 0x200000UL
- #define FUNC_CFG_REQ_ENABLES_ADMIN_LINK_STATE 0x400000UL
+ #define FUNC_CFG_REQ_ENABLES_MTU 0x1UL
+ #define FUNC_CFG_REQ_ENABLES_MRU 0x2UL
+ #define FUNC_CFG_REQ_ENABLES_NUM_RSSCOS_CTXS 0x4UL
+ #define FUNC_CFG_REQ_ENABLES_NUM_CMPL_RINGS 0x8UL
+ #define FUNC_CFG_REQ_ENABLES_NUM_TX_RINGS 0x10UL
+ #define FUNC_CFG_REQ_ENABLES_NUM_RX_RINGS 0x20UL
+ #define FUNC_CFG_REQ_ENABLES_NUM_L2_CTXS 0x40UL
+ #define FUNC_CFG_REQ_ENABLES_NUM_VNICS 0x80UL
+ #define FUNC_CFG_REQ_ENABLES_NUM_STAT_CTXS 0x100UL
+ #define FUNC_CFG_REQ_ENABLES_DFLT_MAC_ADDR 0x200UL
+ #define FUNC_CFG_REQ_ENABLES_DFLT_VLAN 0x400UL
+ #define FUNC_CFG_REQ_ENABLES_DFLT_IP_ADDR 0x800UL
+ #define FUNC_CFG_REQ_ENABLES_MIN_BW 0x1000UL
+ #define FUNC_CFG_REQ_ENABLES_MAX_BW 0x2000UL
+ #define FUNC_CFG_REQ_ENABLES_ASYNC_EVENT_CR 0x4000UL
+ #define FUNC_CFG_REQ_ENABLES_VLAN_ANTISPOOF_MODE 0x8000UL
+ #define FUNC_CFG_REQ_ENABLES_ALLOWED_VLAN_PRIS 0x10000UL
+ #define FUNC_CFG_REQ_ENABLES_EVB_MODE 0x20000UL
+ #define FUNC_CFG_REQ_ENABLES_NUM_MCAST_FILTERS 0x40000UL
+ #define FUNC_CFG_REQ_ENABLES_NUM_HW_RING_GRPS 0x80000UL
+ #define FUNC_CFG_REQ_ENABLES_CACHE_LINESIZE 0x100000UL
+ #define FUNC_CFG_REQ_ENABLES_NUM_MSIX 0x200000UL
+ #define FUNC_CFG_REQ_ENABLES_ADMIN_LINK_STATE 0x400000UL
+ #define FUNC_CFG_REQ_ENABLES_HOT_RESET_IF_SUPPORT 0x800000UL
+ #define FUNC_CFG_REQ_ENABLES_SCHQ_ID 0x1000000UL
__le16 mtu;
__le16 mru;
__le16 num_rsscos_ctxs;
@@ -1449,6 +1478,8 @@ struct hwrm_func_cfg_input {
#define FUNC_CFG_REQ_OPTIONS_RSVD_MASK 0xf0UL
#define FUNC_CFG_REQ_OPTIONS_RSVD_SFT 4
__le16 num_mcast_filters;
+ __le16 schq_id;
+ u8 unused_0[6];
};
/* hwrm_func_cfg_output (size:128b/16B) */
@@ -1507,7 +1538,7 @@ struct hwrm_func_qstats_output {
u8 valid;
};
-/* hwrm_func_qstats_ext_input (size:192b/24B) */
+/* hwrm_func_qstats_ext_input (size:256b/32B) */
struct hwrm_func_qstats_ext_input {
__le16 req_type;
__le16 cmpl_ring;
@@ -1520,7 +1551,12 @@ struct hwrm_func_qstats_ext_input {
#define FUNC_QSTATS_EXT_REQ_FLAGS_ROCE_ONLY 0x1UL
#define FUNC_QSTATS_EXT_REQ_FLAGS_COUNTER_MASK 0x2UL
#define FUNC_QSTATS_EXT_REQ_FLAGS_LAST FUNC_QSTATS_EXT_REQ_FLAGS_COUNTER_MASK
- u8 unused_0[5];
+ u8 unused_0[1];
+ __le32 enables;
+ #define FUNC_QSTATS_EXT_REQ_ENABLES_SCHQ_ID 0x1UL
+ __le16 schq_id;
+ __le16 traffic_class;
+ u8 unused_1[4];
};
/* hwrm_func_qstats_ext_output (size:1472b/184B) */
@@ -1533,15 +1569,15 @@ struct hwrm_func_qstats_ext_output {
__le64 rx_mcast_pkts;
__le64 rx_bcast_pkts;
__le64 rx_discard_pkts;
- __le64 rx_drop_pkts;
+ __le64 rx_error_pkts;
__le64 rx_ucast_bytes;
__le64 rx_mcast_bytes;
__le64 rx_bcast_bytes;
__le64 tx_ucast_pkts;
__le64 tx_mcast_pkts;
__le64 tx_bcast_pkts;
+ __le64 tx_error_pkts;
__le64 tx_discard_pkts;
- __le64 tx_drop_pkts;
__le64 tx_ucast_bytes;
__le64 tx_mcast_bytes;
__le64 tx_bcast_bytes;
@@ -2376,33 +2412,39 @@ struct hwrm_port_phy_cfg_input {
__le16 target_id;
__le64 resp_addr;
__le32 flags;
- #define PORT_PHY_CFG_REQ_FLAGS_RESET_PHY 0x1UL
- #define PORT_PHY_CFG_REQ_FLAGS_DEPRECATED 0x2UL
- #define PORT_PHY_CFG_REQ_FLAGS_FORCE 0x4UL
- #define PORT_PHY_CFG_REQ_FLAGS_RESTART_AUTONEG 0x8UL
- #define PORT_PHY_CFG_REQ_FLAGS_EEE_ENABLE 0x10UL
- #define PORT_PHY_CFG_REQ_FLAGS_EEE_DISABLE 0x20UL
- #define PORT_PHY_CFG_REQ_FLAGS_EEE_TX_LPI_ENABLE 0x40UL
- #define PORT_PHY_CFG_REQ_FLAGS_EEE_TX_LPI_DISABLE 0x80UL
- #define PORT_PHY_CFG_REQ_FLAGS_FEC_AUTONEG_ENABLE 0x100UL
- #define PORT_PHY_CFG_REQ_FLAGS_FEC_AUTONEG_DISABLE 0x200UL
- #define PORT_PHY_CFG_REQ_FLAGS_FEC_CLAUSE74_ENABLE 0x400UL
- #define PORT_PHY_CFG_REQ_FLAGS_FEC_CLAUSE74_DISABLE 0x800UL
- #define PORT_PHY_CFG_REQ_FLAGS_FEC_CLAUSE91_ENABLE 0x1000UL
- #define PORT_PHY_CFG_REQ_FLAGS_FEC_CLAUSE91_DISABLE 0x2000UL
- #define PORT_PHY_CFG_REQ_FLAGS_FORCE_LINK_DWN 0x4000UL
+ #define PORT_PHY_CFG_REQ_FLAGS_RESET_PHY 0x1UL
+ #define PORT_PHY_CFG_REQ_FLAGS_DEPRECATED 0x2UL
+ #define PORT_PHY_CFG_REQ_FLAGS_FORCE 0x4UL
+ #define PORT_PHY_CFG_REQ_FLAGS_RESTART_AUTONEG 0x8UL
+ #define PORT_PHY_CFG_REQ_FLAGS_EEE_ENABLE 0x10UL
+ #define PORT_PHY_CFG_REQ_FLAGS_EEE_DISABLE 0x20UL
+ #define PORT_PHY_CFG_REQ_FLAGS_EEE_TX_LPI_ENABLE 0x40UL
+ #define PORT_PHY_CFG_REQ_FLAGS_EEE_TX_LPI_DISABLE 0x80UL
+ #define PORT_PHY_CFG_REQ_FLAGS_FEC_AUTONEG_ENABLE 0x100UL
+ #define PORT_PHY_CFG_REQ_FLAGS_FEC_AUTONEG_DISABLE 0x200UL
+ #define PORT_PHY_CFG_REQ_FLAGS_FEC_CLAUSE74_ENABLE 0x400UL
+ #define PORT_PHY_CFG_REQ_FLAGS_FEC_CLAUSE74_DISABLE 0x800UL
+ #define PORT_PHY_CFG_REQ_FLAGS_FEC_CLAUSE91_ENABLE 0x1000UL
+ #define PORT_PHY_CFG_REQ_FLAGS_FEC_CLAUSE91_DISABLE 0x2000UL
+ #define PORT_PHY_CFG_REQ_FLAGS_FORCE_LINK_DWN 0x4000UL
+ #define PORT_PHY_CFG_REQ_FLAGS_FEC_RS544_1XN_ENABLE 0x8000UL
+ #define PORT_PHY_CFG_REQ_FLAGS_FEC_RS544_1XN_DISABLE 0x10000UL
+ #define PORT_PHY_CFG_REQ_FLAGS_FEC_RS544_2XN_ENABLE 0x20000UL
+ #define PORT_PHY_CFG_REQ_FLAGS_FEC_RS544_2XN_DISABLE 0x40000UL
__le32 enables;
- #define PORT_PHY_CFG_REQ_ENABLES_AUTO_MODE 0x1UL
- #define PORT_PHY_CFG_REQ_ENABLES_AUTO_DUPLEX 0x2UL
- #define PORT_PHY_CFG_REQ_ENABLES_AUTO_PAUSE 0x4UL
- #define PORT_PHY_CFG_REQ_ENABLES_AUTO_LINK_SPEED 0x8UL
- #define PORT_PHY_CFG_REQ_ENABLES_AUTO_LINK_SPEED_MASK 0x10UL
- #define PORT_PHY_CFG_REQ_ENABLES_WIRESPEED 0x20UL
- #define PORT_PHY_CFG_REQ_ENABLES_LPBK 0x40UL
- #define PORT_PHY_CFG_REQ_ENABLES_PREEMPHASIS 0x80UL
- #define PORT_PHY_CFG_REQ_ENABLES_FORCE_PAUSE 0x100UL
- #define PORT_PHY_CFG_REQ_ENABLES_EEE_LINK_SPEED_MASK 0x200UL
- #define PORT_PHY_CFG_REQ_ENABLES_TX_LPI_TIMER 0x400UL
+ #define PORT_PHY_CFG_REQ_ENABLES_AUTO_MODE 0x1UL
+ #define PORT_PHY_CFG_REQ_ENABLES_AUTO_DUPLEX 0x2UL
+ #define PORT_PHY_CFG_REQ_ENABLES_AUTO_PAUSE 0x4UL
+ #define PORT_PHY_CFG_REQ_ENABLES_AUTO_LINK_SPEED 0x8UL
+ #define PORT_PHY_CFG_REQ_ENABLES_AUTO_LINK_SPEED_MASK 0x10UL
+ #define PORT_PHY_CFG_REQ_ENABLES_WIRESPEED 0x20UL
+ #define PORT_PHY_CFG_REQ_ENABLES_LPBK 0x40UL
+ #define PORT_PHY_CFG_REQ_ENABLES_PREEMPHASIS 0x80UL
+ #define PORT_PHY_CFG_REQ_ENABLES_FORCE_PAUSE 0x100UL
+ #define PORT_PHY_CFG_REQ_ENABLES_EEE_LINK_SPEED_MASK 0x200UL
+ #define PORT_PHY_CFG_REQ_ENABLES_TX_LPI_TIMER 0x400UL
+ #define PORT_PHY_CFG_REQ_ENABLES_FORCE_PAM4_LINK_SPEED 0x800UL
+ #define PORT_PHY_CFG_REQ_ENABLES_AUTO_PAM4_LINK_SPEED_MASK 0x1000UL
__le16 port_id;
__le16 force_link_speed;
#define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_100MB 0x1UL
@@ -2415,7 +2457,6 @@ struct hwrm_port_phy_cfg_input {
#define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_40GB 0x190UL
#define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_50GB 0x1f4UL
#define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_100GB 0x3e8UL
- #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_200GB 0x7d0UL
#define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_10MB 0xffffUL
#define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_LAST PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_10MB
u8 auto_mode;
@@ -2446,7 +2487,6 @@ struct hwrm_port_phy_cfg_input {
#define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_40GB 0x190UL
#define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_50GB 0x1f4UL
#define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_100GB 0x3e8UL
- #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_200GB 0x7d0UL
#define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_10MB 0xffffUL
#define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_LAST PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_10MB
__le16 auto_link_speed_mask;
@@ -2464,7 +2504,6 @@ struct hwrm_port_phy_cfg_input {
#define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_100GB 0x800UL
#define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_10MBHD 0x1000UL
#define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_10MB 0x2000UL
- #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_200GB 0x4000UL
u8 wirespeed;
#define PORT_PHY_CFG_REQ_WIRESPEED_OFF 0x0UL
#define PORT_PHY_CFG_REQ_WIRESPEED_ON 0x1UL
@@ -2488,11 +2527,19 @@ struct hwrm_port_phy_cfg_input {
#define PORT_PHY_CFG_REQ_EEE_LINK_SPEED_MASK_RSVD3 0x10UL
#define PORT_PHY_CFG_REQ_EEE_LINK_SPEED_MASK_RSVD4 0x20UL
#define PORT_PHY_CFG_REQ_EEE_LINK_SPEED_MASK_10GB 0x40UL
- u8 unused_2[2];
+ __le16 force_pam4_link_speed;
+ #define PORT_PHY_CFG_REQ_FORCE_PAM4_LINK_SPEED_50GB 0x1f4UL
+ #define PORT_PHY_CFG_REQ_FORCE_PAM4_LINK_SPEED_100GB 0x3e8UL
+ #define PORT_PHY_CFG_REQ_FORCE_PAM4_LINK_SPEED_200GB 0x7d0UL
+ #define PORT_PHY_CFG_REQ_FORCE_PAM4_LINK_SPEED_LAST PORT_PHY_CFG_REQ_FORCE_PAM4_LINK_SPEED_200GB
__le32 tx_lpi_timer;
#define PORT_PHY_CFG_REQ_TX_LPI_TIMER_MASK 0xffffffUL
#define PORT_PHY_CFG_REQ_TX_LPI_TIMER_SFT 0
- __le32 unused_3;
+ __le16 auto_link_pam4_speed_mask;
+ #define PORT_PHY_CFG_REQ_AUTO_LINK_PAM4_SPEED_MASK_50G 0x1UL
+ #define PORT_PHY_CFG_REQ_AUTO_LINK_PAM4_SPEED_MASK_100G 0x2UL
+ #define PORT_PHY_CFG_REQ_AUTO_LINK_PAM4_SPEED_MASK_200G 0x4UL
+ u8 unused_2[2];
};
/* hwrm_port_phy_cfg_output (size:128b/16B) */
@@ -2526,7 +2573,7 @@ struct hwrm_port_phy_qcfg_input {
u8 unused_0[6];
};
-/* hwrm_port_phy_qcfg_output (size:768b/96B) */
+/* hwrm_port_phy_qcfg_output (size:832b/104B) */
struct hwrm_port_phy_qcfg_output {
__le16 error_code;
__le16 req_type;
@@ -2537,7 +2584,10 @@ struct hwrm_port_phy_qcfg_output {
#define PORT_PHY_QCFG_RESP_LINK_SIGNAL 0x1UL
#define PORT_PHY_QCFG_RESP_LINK_LINK 0x2UL
#define PORT_PHY_QCFG_RESP_LINK_LAST PORT_PHY_QCFG_RESP_LINK_LINK
- u8 unused_0;
+ u8 link_signal_mode;
+ #define PORT_PHY_QCFG_RESP_LINK_SIGNAL_MODE_NRZ 0x0UL
+ #define PORT_PHY_QCFG_RESP_LINK_SIGNAL_MODE_PAM4 0x1UL
+ #define PORT_PHY_QCFG_RESP_LINK_SIGNAL_MODE_LAST PORT_PHY_QCFG_RESP_LINK_SIGNAL_MODE_PAM4
__le16 link_speed;
#define PORT_PHY_QCFG_RESP_LINK_SPEED_100MB 0x1UL
#define PORT_PHY_QCFG_RESP_LINK_SPEED_1GB 0xaUL
@@ -2574,7 +2624,6 @@ struct hwrm_port_phy_qcfg_output {
#define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_100GB 0x800UL
#define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_10MBHD 0x1000UL
#define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_10MB 0x2000UL
- #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_200GB 0x4000UL
__le16 force_link_speed;
#define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_100MB 0x1UL
#define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_1GB 0xaUL
@@ -2586,7 +2635,6 @@ struct hwrm_port_phy_qcfg_output {
#define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_40GB 0x190UL
#define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_50GB 0x1f4UL
#define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_100GB 0x3e8UL
- #define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_200GB 0x7d0UL
#define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_10MB 0xffffUL
#define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_LAST PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_10MB
u8 auto_mode;
@@ -2611,7 +2659,6 @@ struct hwrm_port_phy_qcfg_output {
#define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_40GB 0x190UL
#define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_50GB 0x1f4UL
#define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_100GB 0x3e8UL
- #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_200GB 0x7d0UL
#define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_10MB 0xffffUL
#define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_LAST PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_10MB
__le16 auto_link_speed_mask;
@@ -2629,7 +2676,6 @@ struct hwrm_port_phy_qcfg_output {
#define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_100GB 0x800UL
#define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_10MBHD 0x1000UL
#define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_10MB 0x2000UL
- #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_200GB 0x4000UL
u8 wirespeed;
#define PORT_PHY_QCFG_RESP_WIRESPEED_OFF 0x0UL
#define PORT_PHY_QCFG_RESP_WIRESPEED_ON 0x1UL
@@ -2763,13 +2809,21 @@ struct hwrm_port_phy_qcfg_output {
#define PORT_PHY_QCFG_RESP_XCVR_IDENTIFIER_TYPE_QSFP28 (0x11UL << 24)
#define PORT_PHY_QCFG_RESP_XCVR_IDENTIFIER_TYPE_LAST PORT_PHY_QCFG_RESP_XCVR_IDENTIFIER_TYPE_QSFP28
__le16 fec_cfg;
- #define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_NONE_SUPPORTED 0x1UL
- #define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_AUTONEG_SUPPORTED 0x2UL
- #define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_AUTONEG_ENABLED 0x4UL
- #define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_CLAUSE74_SUPPORTED 0x8UL
- #define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_CLAUSE74_ENABLED 0x10UL
- #define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_CLAUSE91_SUPPORTED 0x20UL
- #define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_CLAUSE91_ENABLED 0x40UL
+ #define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_NONE_SUPPORTED 0x1UL
+ #define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_AUTONEG_SUPPORTED 0x2UL
+ #define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_AUTONEG_ENABLED 0x4UL
+ #define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_CLAUSE74_SUPPORTED 0x8UL
+ #define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_CLAUSE74_ENABLED 0x10UL
+ #define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_CLAUSE91_SUPPORTED 0x20UL
+ #define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_CLAUSE91_ENABLED 0x40UL
+ #define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_RS544_1XN_SUPPORTED 0x80UL
+ #define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_RS544_1XN_ENABLED 0x100UL
+ #define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_RS544_2XN_SUPPORTED 0x200UL
+ #define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_RS544_2XN_ENABLED 0x400UL
+ #define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_CLAUSE74_ACTIVE 0x800UL
+ #define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_CLAUSE91_ACTIVE 0x1000UL
+ #define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_RS544_1XN_ACTIVE 0x2000UL
+ #define PORT_PHY_QCFG_RESP_FEC_CFG_FEC_RS544_2XN_ACTIVE 0x4000UL
u8 duplex_state;
#define PORT_PHY_QCFG_RESP_DUPLEX_STATE_HALF 0x0UL
#define PORT_PHY_QCFG_RESP_DUPLEX_STATE_FULL 0x1UL
@@ -2778,7 +2832,24 @@ struct hwrm_port_phy_qcfg_output {
#define PORT_PHY_QCFG_RESP_OPTION_FLAGS_MEDIA_AUTO_DETECT 0x1UL
char phy_vendor_name[16];
char phy_vendor_partnumber[16];
- u8 unused_2[7];
+ __le16 support_pam4_speeds;
+ #define PORT_PHY_QCFG_RESP_SUPPORT_PAM4_SPEEDS_50G 0x1UL
+ #define PORT_PHY_QCFG_RESP_SUPPORT_PAM4_SPEEDS_100G 0x2UL
+ #define PORT_PHY_QCFG_RESP_SUPPORT_PAM4_SPEEDS_200G 0x4UL
+ __le16 force_pam4_link_speed;
+ #define PORT_PHY_QCFG_RESP_FORCE_PAM4_LINK_SPEED_50GB 0x1f4UL
+ #define PORT_PHY_QCFG_RESP_FORCE_PAM4_LINK_SPEED_100GB 0x3e8UL
+ #define PORT_PHY_QCFG_RESP_FORCE_PAM4_LINK_SPEED_200GB 0x7d0UL
+ #define PORT_PHY_QCFG_RESP_FORCE_PAM4_LINK_SPEED_LAST PORT_PHY_QCFG_RESP_FORCE_PAM4_LINK_SPEED_200GB
+ __le16 auto_pam4_link_speed_mask;
+ #define PORT_PHY_QCFG_RESP_AUTO_PAM4_LINK_SPEED_MASK_50G 0x1UL
+ #define PORT_PHY_QCFG_RESP_AUTO_PAM4_LINK_SPEED_MASK_100G 0x2UL
+ #define PORT_PHY_QCFG_RESP_AUTO_PAM4_LINK_SPEED_MASK_200G 0x4UL
+ __le16 link_partner_pam4_adv_speeds;
+ #define PORT_PHY_QCFG_RESP_LINK_PARTNER_PAM4_ADV_SPEEDS_50GB 0x1UL
+ #define PORT_PHY_QCFG_RESP_LINK_PARTNER_PAM4_ADV_SPEEDS_100GB 0x2UL
+ #define PORT_PHY_QCFG_RESP_LINK_PARTNER_PAM4_ADV_SPEEDS_200GB 0x4UL
+ u8 unused_0[7];
u8 valid;
};
@@ -3304,19 +3375,20 @@ struct hwrm_port_phy_qcaps_input {
u8 unused_0[6];
};
-/* hwrm_port_phy_qcaps_output (size:192b/24B) */
+/* hwrm_port_phy_qcaps_output (size:256b/32B) */
struct hwrm_port_phy_qcaps_output {
__le16 error_code;
__le16 req_type;
__le16 seq_id;
__le16 resp_len;
u8 flags;
- #define PORT_PHY_QCAPS_RESP_FLAGS_EEE_SUPPORTED 0x1UL
- #define PORT_PHY_QCAPS_RESP_FLAGS_EXTERNAL_LPBK_SUPPORTED 0x2UL
- #define PORT_PHY_QCAPS_RESP_FLAGS_AUTONEG_LPBK_SUPPORTED 0x4UL
- #define PORT_PHY_QCAPS_RESP_FLAGS_SHARED_PHY_CFG_SUPPORTED 0x8UL
- #define PORT_PHY_QCAPS_RESP_FLAGS_RSVD1_MASK 0xf0UL
- #define PORT_PHY_QCAPS_RESP_FLAGS_RSVD1_SFT 4
+ #define PORT_PHY_QCAPS_RESP_FLAGS_EEE_SUPPORTED 0x1UL
+ #define PORT_PHY_QCAPS_RESP_FLAGS_EXTERNAL_LPBK_SUPPORTED 0x2UL
+ #define PORT_PHY_QCAPS_RESP_FLAGS_AUTONEG_LPBK_SUPPORTED 0x4UL
+ #define PORT_PHY_QCAPS_RESP_FLAGS_SHARED_PHY_CFG_SUPPORTED 0x8UL
+ #define PORT_PHY_QCAPS_RESP_FLAGS_CUMULATIVE_COUNTERS_ON_RESET 0x10UL
+ #define PORT_PHY_QCAPS_RESP_FLAGS_RSVD1_MASK 0xe0UL
+ #define PORT_PHY_QCAPS_RESP_FLAGS_RSVD1_SFT 5
u8 port_cnt;
#define PORT_PHY_QCAPS_RESP_PORT_CNT_UNKNOWN 0x0UL
#define PORT_PHY_QCAPS_RESP_PORT_CNT_1 0x1UL
@@ -3339,7 +3411,6 @@ struct hwrm_port_phy_qcaps_output {
#define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_FORCE_MODE_100GB 0x800UL
#define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_FORCE_MODE_10MBHD 0x1000UL
#define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_FORCE_MODE_10MB 0x2000UL
- #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_FORCE_MODE_200GB 0x4000UL
__le16 supported_speeds_auto_mode;
#define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_AUTO_MODE_100MBHD 0x1UL
#define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_AUTO_MODE_100MB 0x2UL
@@ -3355,7 +3426,6 @@ struct hwrm_port_phy_qcaps_output {
#define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_AUTO_MODE_100GB 0x800UL
#define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_AUTO_MODE_10MBHD 0x1000UL
#define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_AUTO_MODE_10MB 0x2000UL
- #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_AUTO_MODE_200GB 0x4000UL
__le16 supported_speeds_eee_mode;
#define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_EEE_MODE_RSVD1 0x1UL
#define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_EEE_MODE_100MB 0x2UL
@@ -3372,8 +3442,18 @@ struct hwrm_port_phy_qcaps_output {
__le32 valid_tx_lpi_timer_high;
#define PORT_PHY_QCAPS_RESP_TX_LPI_TIMER_HIGH_MASK 0xffffffUL
#define PORT_PHY_QCAPS_RESP_TX_LPI_TIMER_HIGH_SFT 0
- #define PORT_PHY_QCAPS_RESP_VALID_MASK 0xff000000UL
- #define PORT_PHY_QCAPS_RESP_VALID_SFT 24
+ #define PORT_PHY_QCAPS_RESP_RSVD_MASK 0xff000000UL
+ #define PORT_PHY_QCAPS_RESP_RSVD_SFT 24
+ __le16 supported_pam4_speeds_auto_mode;
+ #define PORT_PHY_QCAPS_RESP_SUPPORTED_PAM4_SPEEDS_AUTO_MODE_50G 0x1UL
+ #define PORT_PHY_QCAPS_RESP_SUPPORTED_PAM4_SPEEDS_AUTO_MODE_100G 0x2UL
+ #define PORT_PHY_QCAPS_RESP_SUPPORTED_PAM4_SPEEDS_AUTO_MODE_200G 0x4UL
+ __le16 supported_pam4_speeds_force_mode;
+ #define PORT_PHY_QCAPS_RESP_SUPPORTED_PAM4_SPEEDS_FORCE_MODE_50G 0x1UL
+ #define PORT_PHY_QCAPS_RESP_SUPPORTED_PAM4_SPEEDS_FORCE_MODE_100G 0x2UL
+ #define PORT_PHY_QCAPS_RESP_SUPPORTED_PAM4_SPEEDS_FORCE_MODE_200G 0x4UL
+ u8 unused_0[3];
+ u8 valid;
};
/* hwrm_port_phy_i2c_read_input (size:320b/40B) */
@@ -3812,7 +3892,7 @@ struct hwrm_queue_qportcfg_input {
u8 unused_0;
};
-/* hwrm_queue_qportcfg_output (size:256b/32B) */
+/* hwrm_queue_qportcfg_output (size:1344b/168B) */
struct hwrm_queue_qportcfg_output {
__le16 error_code;
__le16 req_type;
@@ -3898,6 +3978,49 @@ struct hwrm_queue_qportcfg_output {
#define QUEUE_QPORTCFG_RESP_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_NIC 0x3UL
#define QUEUE_QPORTCFG_RESP_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN 0xffUL
#define QUEUE_QPORTCFG_RESP_QUEUE_ID7_SERVICE_PROFILE_LAST QUEUE_QPORTCFG_RESP_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN
+ u8 unused_0;
+ char qid0_name[16];
+ char qid1_name[16];
+ char qid2_name[16];
+ char qid3_name[16];
+ char qid4_name[16];
+ char qid5_name[16];
+ char qid6_name[16];
+ char qid7_name[16];
+ u8 unused_1[7];
+ u8 valid;
+};
+
+/* hwrm_queue_qcfg_input (size:192b/24B) */
+struct hwrm_queue_qcfg_input {
+ __le16 req_type;
+ __le16 cmpl_ring;
+ __le16 seq_id;
+ __le16 target_id;
+ __le64 resp_addr;
+ __le32 flags;
+ #define QUEUE_QCFG_REQ_FLAGS_PATH 0x1UL
+ #define QUEUE_QCFG_REQ_FLAGS_PATH_TX 0x0UL
+ #define QUEUE_QCFG_REQ_FLAGS_PATH_RX 0x1UL
+ #define QUEUE_QCFG_REQ_FLAGS_PATH_LAST QUEUE_QCFG_REQ_FLAGS_PATH_RX
+ __le32 queue_id;
+};
+
+/* hwrm_queue_qcfg_output (size:128b/16B) */
+struct hwrm_queue_qcfg_output {
+ __le16 error_code;
+ __le16 req_type;
+ __le16 seq_id;
+ __le16 resp_len;
+ __le32 queue_len;
+ u8 service_profile;
+ #define QUEUE_QCFG_RESP_SERVICE_PROFILE_LOSSY 0x0UL
+ #define QUEUE_QCFG_RESP_SERVICE_PROFILE_LOSSLESS 0x1UL
+ #define QUEUE_QCFG_RESP_SERVICE_PROFILE_UNKNOWN 0xffUL
+ #define QUEUE_QCFG_RESP_SERVICE_PROFILE_LAST QUEUE_QCFG_RESP_SERVICE_PROFILE_UNKNOWN
+ u8 queue_cfg_info;
+ #define QUEUE_QCFG_RESP_QUEUE_CFG_INFO_ASYM_CFG 0x1UL
+ u8 unused_0;
u8 valid;
};
@@ -4938,6 +5061,7 @@ struct hwrm_vnic_cfg_input {
#define VNIC_CFG_REQ_ENABLES_DEFAULT_RX_RING_ID 0x20UL
#define VNIC_CFG_REQ_ENABLES_DEFAULT_CMPL_RING_ID 0x40UL
#define VNIC_CFG_REQ_ENABLES_QUEUE_ID 0x80UL
+ #define VNIC_CFG_REQ_ENABLES_RX_CSUM_V2_MODE 0x100UL
__le16 vnic_id;
__le16 dflt_ring_grp;
__le16 rss_rule;
@@ -4947,7 +5071,12 @@ struct hwrm_vnic_cfg_input {
__le16 default_rx_ring_id;
__le16 default_cmpl_ring_id;
__le16 queue_id;
- u8 unused0[6];
+ u8 rx_csum_v2_mode;
+ #define VNIC_CFG_REQ_RX_CSUM_V2_MODE_DEFAULT 0x0UL
+ #define VNIC_CFG_REQ_RX_CSUM_V2_MODE_ALL_OK 0x1UL
+ #define VNIC_CFG_REQ_RX_CSUM_V2_MODE_MAX 0x2UL
+ #define VNIC_CFG_REQ_RX_CSUM_V2_MODE_LAST VNIC_CFG_REQ_RX_CSUM_V2_MODE_MAX
+ u8 unused0[5];
};
/* hwrm_vnic_cfg_output (size:128b/16B) */
@@ -4989,6 +5118,7 @@ struct hwrm_vnic_qcaps_output {
#define VNIC_QCAPS_RESP_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_CAP 0x40UL
#define VNIC_QCAPS_RESP_FLAGS_OUTERMOST_RSS_CAP 0x80UL
#define VNIC_QCAPS_RESP_FLAGS_COS_ASSIGNMENT_CAP 0x100UL
+ #define VNIC_QCAPS_RESP_FLAGS_RX_CMPL_V2_CAP 0x200UL
__le16 max_aggs_supported;
u8 unused_1[5];
u8 valid;
@@ -5155,15 +5285,18 @@ struct hwrm_vnic_plcmodes_cfg_input {
#define VNIC_PLCMODES_CFG_REQ_FLAGS_HDS_IPV6 0x8UL
#define VNIC_PLCMODES_CFG_REQ_FLAGS_HDS_FCOE 0x10UL
#define VNIC_PLCMODES_CFG_REQ_FLAGS_HDS_ROCE 0x20UL
+ #define VNIC_PLCMODES_CFG_REQ_FLAGS_VIRTIO_PLACEMENT 0x40UL
__le32 enables;
#define VNIC_PLCMODES_CFG_REQ_ENABLES_JUMBO_THRESH_VALID 0x1UL
#define VNIC_PLCMODES_CFG_REQ_ENABLES_HDS_OFFSET_VALID 0x2UL
#define VNIC_PLCMODES_CFG_REQ_ENABLES_HDS_THRESHOLD_VALID 0x4UL
+ #define VNIC_PLCMODES_CFG_REQ_ENABLES_MAX_BDS_VALID 0x8UL
__le32 vnic_id;
__le16 jumbo_thresh;
__le16 hds_offset;
__le16 hds_threshold;
- u8 unused_0[6];
+ __le16 max_bds;
+ u8 unused_0[4];
};
/* hwrm_vnic_plcmodes_cfg_output (size:128b/16B) */
@@ -5231,6 +5364,7 @@ struct hwrm_ring_alloc_input {
#define RING_ALLOC_REQ_ENABLES_RX_RING_ID_VALID 0x40UL
#define RING_ALLOC_REQ_ENABLES_NQ_RING_ID_VALID 0x80UL
#define RING_ALLOC_REQ_ENABLES_RX_BUF_SIZE_VALID 0x100UL
+ #define RING_ALLOC_REQ_ENABLES_SCHQ_ID 0x200UL
u8 ring_type;
#define RING_ALLOC_REQ_RING_TYPE_L2_CMPL 0x0UL
#define RING_ALLOC_REQ_RING_TYPE_TX 0x1UL
@@ -5246,7 +5380,7 @@ struct hwrm_ring_alloc_input {
__le32 fbo;
u8 page_size;
u8 page_tbl_depth;
- u8 unused_1[2];
+ __le16 schq_id;
__le32 length;
__le16 logical_id;
__le16 cmpl_ring_id;
@@ -5344,11 +5478,12 @@ struct hwrm_ring_reset_input {
__le16 target_id;
__le64 resp_addr;
u8 ring_type;
- #define RING_RESET_REQ_RING_TYPE_L2_CMPL 0x0UL
- #define RING_RESET_REQ_RING_TYPE_TX 0x1UL
- #define RING_RESET_REQ_RING_TYPE_RX 0x2UL
- #define RING_RESET_REQ_RING_TYPE_ROCE_CMPL 0x3UL
- #define RING_RESET_REQ_RING_TYPE_LAST RING_RESET_REQ_RING_TYPE_ROCE_CMPL
+ #define RING_RESET_REQ_RING_TYPE_L2_CMPL 0x0UL
+ #define RING_RESET_REQ_RING_TYPE_TX 0x1UL
+ #define RING_RESET_REQ_RING_TYPE_RX 0x2UL
+ #define RING_RESET_REQ_RING_TYPE_ROCE_CMPL 0x3UL
+ #define RING_RESET_REQ_RING_TYPE_RX_RING_GRP 0x6UL
+ #define RING_RESET_REQ_RING_TYPE_LAST RING_RESET_REQ_RING_TYPE_RX_RING_GRP
u8 unused_0;
__le16 ring_id;
u8 unused_1[4];
@@ -5529,6 +5664,7 @@ struct hwrm_ring_grp_free_output {
u8 unused_0[7];
u8 valid;
};
+
#define DEFAULT_FLOW_ID 0xFFFFFFFFUL
#define ROCEV1_FLOW_ID 0xFFFFFFFEUL
#define ROCEV2_FLOW_ID 0xFFFFFFFDUL
@@ -6816,15 +6952,15 @@ struct ctx_hw_stats {
__le64 rx_mcast_pkts;
__le64 rx_bcast_pkts;
__le64 rx_discard_pkts;
- __le64 rx_drop_pkts;
+ __le64 rx_error_pkts;
__le64 rx_ucast_bytes;
__le64 rx_mcast_bytes;
__le64 rx_bcast_bytes;
__le64 tx_ucast_pkts;
__le64 tx_mcast_pkts;
__le64 tx_bcast_pkts;
+ __le64 tx_error_pkts;
__le64 tx_discard_pkts;
- __le64 tx_drop_pkts;
__le64 tx_ucast_bytes;
__le64 tx_mcast_bytes;
__le64 tx_bcast_bytes;
@@ -6840,15 +6976,15 @@ struct ctx_hw_stats_ext {
__le64 rx_mcast_pkts;
__le64 rx_bcast_pkts;
__le64 rx_discard_pkts;
- __le64 rx_drop_pkts;
+ __le64 rx_error_pkts;
__le64 rx_ucast_bytes;
__le64 rx_mcast_bytes;
__le64 rx_bcast_bytes;
__le64 tx_ucast_pkts;
__le64 tx_mcast_pkts;
__le64 tx_bcast_pkts;
+ __le64 tx_error_pkts;
__le64 tx_discard_pkts;
- __le64 tx_drop_pkts;
__le64 tx_ucast_bytes;
__le64 tx_mcast_bytes;
__le64 tx_bcast_bytes;
@@ -6915,7 +7051,9 @@ struct hwrm_stat_ctx_query_input {
__le16 target_id;
__le64 resp_addr;
__le32 stat_ctx_id;
- u8 unused_0[4];
+ u8 flags;
+ #define STAT_CTX_QUERY_REQ_FLAGS_COUNTER_MASK 0x1UL
+ u8 unused_0[3];
};
/* hwrm_stat_ctx_query_output (size:1408b/176B) */
@@ -6948,6 +7086,50 @@ struct hwrm_stat_ctx_query_output {
u8 valid;
};
+/* hwrm_stat_ext_ctx_query_input (size:192b/24B) */
+struct hwrm_stat_ext_ctx_query_input {
+ __le16 req_type;
+ __le16 cmpl_ring;
+ __le16 seq_id;
+ __le16 target_id;
+ __le64 resp_addr;
+ __le32 stat_ctx_id;
+ u8 flags;
+ #define STAT_EXT_CTX_QUERY_REQ_FLAGS_COUNTER_MASK 0x1UL
+ u8 unused_0[3];
+};
+
+/* hwrm_stat_ext_ctx_query_output (size:1472b/184B) */
+struct hwrm_stat_ext_ctx_query_output {
+ __le16 error_code;
+ __le16 req_type;
+ __le16 seq_id;
+ __le16 resp_len;
+ __le64 rx_ucast_pkts;
+ __le64 rx_mcast_pkts;
+ __le64 rx_bcast_pkts;
+ __le64 rx_discard_pkts;
+ __le64 rx_error_pkts;
+ __le64 rx_ucast_bytes;
+ __le64 rx_mcast_bytes;
+ __le64 rx_bcast_bytes;
+ __le64 tx_ucast_pkts;
+ __le64 tx_mcast_pkts;
+ __le64 tx_bcast_pkts;
+ __le64 tx_error_pkts;
+ __le64 tx_discard_pkts;
+ __le64 tx_ucast_bytes;
+ __le64 tx_mcast_bytes;
+ __le64 tx_bcast_bytes;
+ __le64 rx_tpa_eligible_pkt;
+ __le64 rx_tpa_eligible_bytes;
+ __le64 rx_tpa_pkt;
+ __le64 rx_tpa_bytes;
+ __le64 rx_tpa_errors;
+ u8 unused_0[7];
+ u8 valid;
+};
+
/* hwrm_stat_ctx_clr_stats_input (size:192b/24B) */
struct hwrm_stat_ctx_clr_stats_input {
__le16 req_type;
@@ -7497,6 +7679,29 @@ struct hwrm_wol_reason_qcfg_output {
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;
+};
+
/* coredump_segment_record (size:128b/16B) */
struct coredump_segment_record {
__le16 component_id;
@@ -7507,7 +7712,8 @@ struct coredump_segment_record {
u8 seg_flags;
u8 compress_flags;
#define SFLAG_COMPRESSED_ZLIB 0x1UL
- u8 unused_0[6];
+ u8 unused_0[2];
+ __le32 segment_len;
};
/* hwrm_dbg_coredump_list_input (size:256b/32B) */
@@ -7620,7 +7826,8 @@ struct hwrm_dbg_ring_info_get_input {
#define DBG_RING_INFO_GET_REQ_RING_TYPE_L2_CMPL 0x0UL
#define DBG_RING_INFO_GET_REQ_RING_TYPE_TX 0x1UL
#define DBG_RING_INFO_GET_REQ_RING_TYPE_RX 0x2UL
- #define DBG_RING_INFO_GET_REQ_RING_TYPE_LAST DBG_RING_INFO_GET_REQ_RING_TYPE_RX
+ #define DBG_RING_INFO_GET_REQ_RING_TYPE_NQ 0x3UL
+ #define DBG_RING_INFO_GET_REQ_RING_TYPE_LAST DBG_RING_INFO_GET_REQ_RING_TYPE_NQ
u8 unused_0[3];
__le32 fw_ring_id;
};
@@ -7633,7 +7840,8 @@ struct hwrm_dbg_ring_info_get_output {
__le16 resp_len;
__le32 producer_index;
__le32 consumer_index;
- u8 unused_0[7];
+ __le32 cag_vector_ctrl;
+ u8 unused_0[3];
u8 valid;
};
@@ -7922,6 +8130,7 @@ struct hwrm_nvm_install_update_input {
#define NVM_INSTALL_UPDATE_REQ_FLAGS_ERASE_UNUSED_SPACE 0x1UL
#define NVM_INSTALL_UPDATE_REQ_FLAGS_REMOVE_UNUSED_PKG 0x2UL
#define NVM_INSTALL_UPDATE_REQ_FLAGS_ALLOWED_TO_DEFRAG 0x4UL
+ #define NVM_INSTALL_UPDATE_REQ_FLAGS_VERIFY_ONLY 0x8UL
u8 unused_0[2];
};
@@ -8101,7 +8310,14 @@ struct hwrm_selftest_qlist_output {
char test5_name[32];
char test6_name[32];
char test7_name[32];
- u8 unused_2[7];
+ u8 eyescope_target_BER_support;
+ #define SELFTEST_QLIST_RESP_EYESCOPE_TARGET_BER_SUPPORT_BER_1E8_SUPPORTED 0x0UL
+ #define SELFTEST_QLIST_RESP_EYESCOPE_TARGET_BER_SUPPORT_BER_1E9_SUPPORTED 0x1UL
+ #define SELFTEST_QLIST_RESP_EYESCOPE_TARGET_BER_SUPPORT_BER_1E10_SUPPORTED 0x2UL
+ #define SELFTEST_QLIST_RESP_EYESCOPE_TARGET_BER_SUPPORT_BER_1E11_SUPPORTED 0x3UL
+ #define SELFTEST_QLIST_RESP_EYESCOPE_TARGET_BER_SUPPORT_BER_1E12_SUPPORTED 0x4UL
+ #define SELFTEST_QLIST_RESP_EYESCOPE_TARGET_BER_SUPPORT_LAST SELFTEST_QLIST_RESP_EYESCOPE_TARGET_BER_SUPPORT_BER_1E12_SUPPORTED
+ u8 unused_2[6];
u8 valid;
};
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
index 392e32c..cc2ee4d 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
@@ -1029,7 +1029,7 @@ static int bnxt_vf_set_link(struct bnxt *bp, struct bnxt_vf_info *vf)
rc = bnxt_hwrm_exec_fwd_resp(
bp, vf, sizeof(struct hwrm_port_phy_qcfg_input));
} else {
- struct hwrm_port_phy_qcfg_output phy_qcfg_resp;
+ struct hwrm_port_phy_qcfg_output_compat phy_qcfg_resp = {0};
struct hwrm_port_phy_qcfg_input *phy_qcfg_req;
phy_qcfg_req =
--
1.8.3.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net-next 03/10] bnxt_en: Use macros to define port statistics size and offset.
2020-07-27 3:29 [PATCH net-next 00/10] bnxt_en update Michael Chan
2020-07-27 3:29 ` [PATCH net-next 01/10] bnxt_en: Remove PCIe non-counters from ethtool statistics Michael Chan
2020-07-27 3:29 ` [PATCH net-next 02/10] bnxt_en: Update firmware interface to 1.10.1.54 Michael Chan
@ 2020-07-27 3:29 ` Michael Chan
2020-07-27 3:29 ` [PATCH net-next 04/10] bnxt_en: Refactor statistics code and structures Michael Chan
` (7 subsequent siblings)
10 siblings, 0 replies; 15+ messages in thread
From: Michael Chan @ 2020-07-27 3:29 UTC (permalink / raw)
To: davem; +Cc: netdev, kuba
The port statistics structures have hard coded padding and offset.
Define macros to make this look cleaner.
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 8 ++++----
drivers/net/ethernet/broadcom/bnxt/bnxt.h | 8 +++++++-
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index cd794b0..b4a387c 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -3780,8 +3780,7 @@ static int bnxt_alloc_stats(struct bnxt *bp)
if (bp->hw_rx_port_stats)
goto alloc_ext_stats;
- bp->hw_port_stats_size = sizeof(struct rx_port_stats) +
- sizeof(struct tx_port_stats) + 1024;
+ bp->hw_port_stats_size = BNXT_PORT_STATS_SIZE;
bp->hw_rx_port_stats =
dma_alloc_coherent(&pdev->dev, bp->hw_port_stats_size,
@@ -3790,9 +3789,10 @@ static int bnxt_alloc_stats(struct bnxt *bp)
if (!bp->hw_rx_port_stats)
return -ENOMEM;
- bp->hw_tx_port_stats = (void *)(bp->hw_rx_port_stats + 1) + 512;
+ bp->hw_tx_port_stats = (void *)bp->hw_rx_port_stats +
+ BNXT_TX_PORT_STATS_BYTE_OFFSET;
bp->hw_tx_port_stats_map = bp->hw_rx_port_stats_map +
- sizeof(struct rx_port_stats) + 512;
+ BNXT_TX_PORT_STATS_BYTE_OFFSET;
bp->flags |= BNXT_FLAG_PORT_STATS;
alloc_ext_stats:
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index 306636d..df62897 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -1926,12 +1926,18 @@ struct bnxt {
struct device *hwmon_dev;
};
+#define BNXT_PORT_STATS_SIZE \
+ (sizeof(struct rx_port_stats) + sizeof(struct tx_port_stats) + 1024)
+
+#define BNXT_TX_PORT_STATS_BYTE_OFFSET \
+ (sizeof(struct rx_port_stats) + 512)
+
#define BNXT_RX_STATS_OFFSET(counter) \
(offsetof(struct rx_port_stats, counter) / 8)
#define BNXT_TX_STATS_OFFSET(counter) \
((offsetof(struct tx_port_stats, counter) + \
- sizeof(struct rx_port_stats) + 512) / 8)
+ BNXT_TX_PORT_STATS_BYTE_OFFSET) / 8)
#define BNXT_RX_STATS_EXT_OFFSET(counter) \
(offsetof(struct rx_port_stats_ext, counter) / 8)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net-next 04/10] bnxt_en: Refactor statistics code and structures.
2020-07-27 3:29 [PATCH net-next 00/10] bnxt_en update Michael Chan
` (2 preceding siblings ...)
2020-07-27 3:29 ` [PATCH net-next 03/10] bnxt_en: Use macros to define port statistics size and offset Michael Chan
@ 2020-07-27 3:29 ` Michael Chan
2020-07-27 3:29 ` [PATCH net-next 05/10] bnxt_en: Allocate additional memory for all statistics blocks Michael Chan
` (6 subsequent siblings)
10 siblings, 0 replies; 15+ messages in thread
From: Michael Chan @ 2020-07-27 3:29 UTC (permalink / raw)
To: davem; +Cc: netdev, kuba
The driver manages multiple statistics structures of different sizes.
They are all allocated, freed, and handled practically the same. Define
a new bnxt_stats_mem structure and common allocation and free functions
for all staistics memory blocks.
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 129 ++++++++++------------
drivers/net/ethernet/broadcom/bnxt/bnxt.h | 21 ++--
drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c | 2 +-
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 13 ++-
4 files changed, 76 insertions(+), 89 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index b4a387c..d232618 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -3703,61 +3703,55 @@ static int bnxt_alloc_hwrm_short_cmd_req(struct bnxt *bp)
return 0;
}
-static void bnxt_free_port_stats(struct bnxt *bp)
+static void bnxt_free_stats_mem(struct bnxt *bp, struct bnxt_stats_mem *stats)
{
- struct pci_dev *pdev = bp->pdev;
+ if (stats->hw_stats) {
+ dma_free_coherent(&bp->pdev->dev, stats->len, stats->hw_stats,
+ stats->hw_stats_map);
+ stats->hw_stats = NULL;
+ }
+}
- bp->flags &= ~BNXT_FLAG_PORT_STATS;
- bp->flags &= ~BNXT_FLAG_PORT_STATS_EXT;
+static int bnxt_alloc_stats_mem(struct bnxt *bp, struct bnxt_stats_mem *stats)
+{
+ stats->hw_stats = dma_alloc_coherent(&bp->pdev->dev, stats->len,
+ &stats->hw_stats_map, GFP_KERNEL);
+ if (!stats->hw_stats)
+ return -ENOMEM;
- if (bp->hw_rx_port_stats) {
- dma_free_coherent(&pdev->dev, bp->hw_port_stats_size,
- bp->hw_rx_port_stats,
- bp->hw_rx_port_stats_map);
- bp->hw_rx_port_stats = NULL;
- }
+ memset(stats->hw_stats, 0, stats->len);
+ return 0;
+}
- if (bp->hw_tx_port_stats_ext) {
- dma_free_coherent(&pdev->dev, sizeof(struct tx_port_stats_ext),
- bp->hw_tx_port_stats_ext,
- bp->hw_tx_port_stats_ext_map);
- bp->hw_tx_port_stats_ext = NULL;
- }
+static void bnxt_free_port_stats(struct bnxt *bp)
+{
+ bp->flags &= ~BNXT_FLAG_PORT_STATS;
+ bp->flags &= ~BNXT_FLAG_PORT_STATS_EXT;
- if (bp->hw_rx_port_stats_ext) {
- dma_free_coherent(&pdev->dev, sizeof(struct rx_port_stats_ext),
- bp->hw_rx_port_stats_ext,
- bp->hw_rx_port_stats_ext_map);
- bp->hw_rx_port_stats_ext = NULL;
- }
+ bnxt_free_stats_mem(bp, &bp->port_stats);
+ bnxt_free_stats_mem(bp, &bp->rx_port_stats_ext);
+ bnxt_free_stats_mem(bp, &bp->tx_port_stats_ext);
}
static void bnxt_free_ring_stats(struct bnxt *bp)
{
- struct pci_dev *pdev = bp->pdev;
- int size, i;
+ int i;
if (!bp->bnapi)
return;
- size = bp->hw_ring_stats_size;
-
for (i = 0; i < bp->cp_nr_rings; i++) {
struct bnxt_napi *bnapi = bp->bnapi[i];
struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
- if (cpr->hw_stats) {
- dma_free_coherent(&pdev->dev, size, cpr->hw_stats,
- cpr->hw_stats_map);
- cpr->hw_stats = NULL;
- }
+ bnxt_free_stats_mem(bp, &cpr->stats);
}
}
static int bnxt_alloc_stats(struct bnxt *bp)
{
u32 size, i;
- struct pci_dev *pdev = bp->pdev;
+ int rc;
size = bp->hw_ring_stats_size;
@@ -3765,11 +3759,10 @@ static int bnxt_alloc_stats(struct bnxt *bp)
struct bnxt_napi *bnapi = bp->bnapi[i];
struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
- cpr->hw_stats = dma_alloc_coherent(&pdev->dev, size,
- &cpr->hw_stats_map,
- GFP_KERNEL);
- if (!cpr->hw_stats)
- return -ENOMEM;
+ cpr->stats.len = size;
+ rc = bnxt_alloc_stats_mem(bp, &cpr->stats);
+ if (rc)
+ return rc;
cpr->hw_stats_ctx_id = INVALID_STATS_CTX_ID;
}
@@ -3777,22 +3770,14 @@ static int bnxt_alloc_stats(struct bnxt *bp)
if (BNXT_VF(bp) || bp->chip_num == CHIP_NUM_58700)
return 0;
- if (bp->hw_rx_port_stats)
+ if (bp->port_stats.hw_stats)
goto alloc_ext_stats;
- bp->hw_port_stats_size = BNXT_PORT_STATS_SIZE;
-
- bp->hw_rx_port_stats =
- dma_alloc_coherent(&pdev->dev, bp->hw_port_stats_size,
- &bp->hw_rx_port_stats_map,
- GFP_KERNEL);
- if (!bp->hw_rx_port_stats)
- return -ENOMEM;
+ bp->port_stats.len = BNXT_PORT_STATS_SIZE;
+ rc = bnxt_alloc_stats_mem(bp, &bp->port_stats);
+ if (rc)
+ return rc;
- bp->hw_tx_port_stats = (void *)bp->hw_rx_port_stats +
- BNXT_TX_PORT_STATS_BYTE_OFFSET;
- bp->hw_tx_port_stats_map = bp->hw_rx_port_stats_map +
- BNXT_TX_PORT_STATS_BYTE_OFFSET;
bp->flags |= BNXT_FLAG_PORT_STATS;
alloc_ext_stats:
@@ -3801,26 +3786,26 @@ static int bnxt_alloc_stats(struct bnxt *bp)
if (!(bp->fw_cap & BNXT_FW_CAP_EXT_STATS_SUPPORTED))
return 0;
- if (bp->hw_rx_port_stats_ext)
+ if (bp->rx_port_stats_ext.hw_stats)
goto alloc_tx_ext_stats;
- bp->hw_rx_port_stats_ext =
- dma_alloc_coherent(&pdev->dev, sizeof(struct rx_port_stats_ext),
- &bp->hw_rx_port_stats_ext_map, GFP_KERNEL);
- if (!bp->hw_rx_port_stats_ext)
+ bp->rx_port_stats_ext.len = sizeof(struct rx_port_stats_ext);
+ rc = bnxt_alloc_stats_mem(bp, &bp->rx_port_stats_ext);
+ /* Extended stats are optional */
+ if (rc)
return 0;
alloc_tx_ext_stats:
- if (bp->hw_tx_port_stats_ext)
+ if (bp->tx_port_stats_ext.hw_stats)
return 0;
if (bp->hwrm_spec_code >= 0x10902 ||
(bp->fw_cap & BNXT_FW_CAP_EXT_STATS_SUPPORTED)) {
- bp->hw_tx_port_stats_ext =
- dma_alloc_coherent(&pdev->dev,
- sizeof(struct tx_port_stats_ext),
- &bp->hw_tx_port_stats_ext_map,
- GFP_KERNEL);
+ bp->tx_port_stats_ext.len = sizeof(struct tx_port_stats_ext);
+ rc = bnxt_alloc_stats_mem(bp, &bp->tx_port_stats_ext);
+ /* Extended stats are optional */
+ if (rc)
+ return 0;
}
bp->flags |= BNXT_FLAG_PORT_STATS_EXT;
return 0;
@@ -6431,7 +6416,7 @@ static int bnxt_hwrm_stat_ctx_alloc(struct bnxt *bp)
struct bnxt_napi *bnapi = bp->bnapi[i];
struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
- req.stats_dma_addr = cpu_to_le64(cpr->hw_stats_map);
+ req.stats_dma_addr = cpu_to_le64(cpr->stats.hw_stats_map);
rc = _hwrm_send_message(bp, &req, sizeof(req),
HWRM_CMD_TIMEOUT);
@@ -7472,8 +7457,9 @@ static int bnxt_hwrm_port_qstats(struct bnxt *bp)
bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_PORT_QSTATS, -1, -1);
req.port_id = cpu_to_le16(pf->port_id);
- req.tx_stat_host_addr = cpu_to_le64(bp->hw_tx_port_stats_map);
- req.rx_stat_host_addr = cpu_to_le64(bp->hw_rx_port_stats_map);
+ req.tx_stat_host_addr = cpu_to_le64(bp->port_stats.hw_stats_map +
+ BNXT_TX_PORT_STATS_BYTE_OFFSET);
+ req.rx_stat_host_addr = cpu_to_le64(bp->port_stats.hw_stats_map);
return hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
}
@@ -7492,11 +7478,11 @@ static int bnxt_hwrm_port_qstats_ext(struct bnxt *bp)
bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_PORT_QSTATS_EXT, -1, -1);
req.port_id = cpu_to_le16(pf->port_id);
req.rx_stat_size = cpu_to_le16(sizeof(struct rx_port_stats_ext));
- req.rx_stat_host_addr = cpu_to_le64(bp->hw_rx_port_stats_ext_map);
- tx_stat_size = bp->hw_tx_port_stats_ext ?
- sizeof(*bp->hw_tx_port_stats_ext) : 0;
+ req.rx_stat_host_addr = cpu_to_le64(bp->rx_port_stats_ext.hw_stats_map);
+ tx_stat_size = bp->tx_port_stats_ext.hw_stats ?
+ sizeof(struct tx_port_stats_ext) : 0;
req.tx_stat_size = cpu_to_le16(tx_stat_size);
- req.tx_stat_host_addr = cpu_to_le64(bp->hw_tx_port_stats_ext_map);
+ req.tx_stat_host_addr = cpu_to_le64(bp->tx_port_stats_ext.hw_stats_map);
mutex_lock(&bp->hwrm_cmd_lock);
rc = _hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
if (!rc) {
@@ -9574,7 +9560,7 @@ static void bnxt_get_ring_stats(struct bnxt *bp,
for (i = 0; i < bp->cp_nr_rings; i++) {
struct bnxt_napi *bnapi = bp->bnapi[i];
struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
- struct ctx_hw_stats *hw_stats = cpr->hw_stats;
+ struct ctx_hw_stats *hw_stats = cpr->stats.hw_stats;
stats->rx_packets += le64_to_cpu(hw_stats->rx_ucast_pkts);
stats->rx_packets += le64_to_cpu(hw_stats->rx_mcast_pkts);
@@ -9635,8 +9621,9 @@ static void bnxt_add_prev_stats(struct bnxt *bp,
bnxt_add_prev_stats(bp, stats);
if (bp->flags & BNXT_FLAG_PORT_STATS) {
- struct rx_port_stats *rx = bp->hw_rx_port_stats;
- struct tx_port_stats *tx = bp->hw_tx_port_stats;
+ struct rx_port_stats *rx = bp->port_stats.hw_stats;
+ struct tx_port_stats *tx = bp->port_stats.hw_stats +
+ BNXT_TX_PORT_STATS_BYTE_OFFSET;
stats->rx_crc_errors = le64_to_cpu(rx->rx_fcs_err_frames);
stats->rx_frame_errors = le64_to_cpu(rx->rx_align_err_frames);
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index df62897..7e9fe1f 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -919,6 +919,12 @@ struct bnxt_sw_stats {
struct bnxt_cmn_sw_stats cmn;
};
+struct bnxt_stats_mem {
+ void *hw_stats;
+ dma_addr_t hw_stats_map;
+ int len;
+};
+
struct bnxt_cp_ring_info {
struct bnxt_napi *bnapi;
u32 cp_raw_cons;
@@ -943,8 +949,7 @@ struct bnxt_cp_ring_info {
dma_addr_t cp_desc_mapping[MAX_CP_PAGES];
- struct ctx_hw_stats *hw_stats;
- dma_addr_t hw_stats_map;
+ struct bnxt_stats_mem stats;
u32 hw_stats_ctx_id;
struct bnxt_sw_stats sw_stats;
@@ -1776,15 +1781,9 @@ struct bnxt {
dma_addr_t hwrm_cmd_kong_resp_dma_addr;
struct rtnl_link_stats64 net_stats_prev;
- struct rx_port_stats *hw_rx_port_stats;
- struct tx_port_stats *hw_tx_port_stats;
- struct rx_port_stats_ext *hw_rx_port_stats_ext;
- struct tx_port_stats_ext *hw_tx_port_stats_ext;
- dma_addr_t hw_rx_port_stats_map;
- dma_addr_t hw_tx_port_stats_map;
- dma_addr_t hw_rx_port_stats_ext_map;
- dma_addr_t hw_tx_port_stats_ext_map;
- int hw_port_stats_size;
+ struct bnxt_stats_mem port_stats;
+ struct bnxt_stats_mem rx_port_stats_ext;
+ struct bnxt_stats_mem tx_port_stats_ext;
u16 fw_rx_stats_ext_size;
u16 fw_tx_stats_ext_size;
u16 hw_ring_stats_size;
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c
index 02b2755..8e90224 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c
@@ -544,7 +544,7 @@ static int bnxt_dcbnl_ieee_setets(struct net_device *dev, struct ieee_ets *ets)
static int bnxt_dcbnl_ieee_getpfc(struct net_device *dev, struct ieee_pfc *pfc)
{
struct bnxt *bp = netdev_priv(dev);
- __le64 *stats = (__le64 *)bp->hw_rx_port_stats;
+ __le64 *stats = bp->port_stats.hw_stats;
struct ieee_pfc *my_pfc = bp->ieee_pfc;
long rx_off, tx_off;
int i, rc;
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index c8bafab..59ebb2b 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -559,7 +559,8 @@ static void bnxt_get_ethtool_stats(struct net_device *dev,
for (i = 0; i < bp->cp_nr_rings; i++) {
struct bnxt_napi *bnapi = bp->bnapi[i];
struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
- __le64 *hw_stats = (__le64 *)cpr->hw_stats;
+ struct ctx_hw_stats *hw = cpr->stats.hw_stats;
+ __le64 *hw_stats = cpr->stats.hw_stats;
u64 *sw;
int k;
@@ -593,9 +594,9 @@ static void bnxt_get_ethtool_stats(struct net_device *dev,
buf[j] = sw[k];
bnxt_sw_func_stats[RX_TOTAL_DISCARDS].counter +=
- le64_to_cpu(cpr->hw_stats->rx_discard_pkts);
+ le64_to_cpu(hw->rx_discard_pkts);
bnxt_sw_func_stats[TX_TOTAL_DISCARDS].counter +=
- le64_to_cpu(cpr->hw_stats->tx_discard_pkts);
+ le64_to_cpu(hw->tx_discard_pkts);
}
for (i = 0; i < BNXT_NUM_SW_FUNC_STATS; i++, j++)
@@ -603,7 +604,7 @@ static void bnxt_get_ethtool_stats(struct net_device *dev,
skip_ring_stats:
if (bp->flags & BNXT_FLAG_PORT_STATS) {
- __le64 *port_stats = (__le64 *)bp->hw_rx_port_stats;
+ __le64 *port_stats = bp->port_stats.hw_stats;
for (i = 0; i < BNXT_NUM_PORT_STATS; i++, j++) {
buf[j] = le64_to_cpu(*(port_stats +
@@ -611,8 +612,8 @@ static void bnxt_get_ethtool_stats(struct net_device *dev,
}
}
if (bp->flags & BNXT_FLAG_PORT_STATS_EXT) {
- __le64 *rx_port_stats_ext = (__le64 *)bp->hw_rx_port_stats_ext;
- __le64 *tx_port_stats_ext = (__le64 *)bp->hw_tx_port_stats_ext;
+ __le64 *rx_port_stats_ext = bp->rx_port_stats_ext.hw_stats;
+ __le64 *tx_port_stats_ext = bp->tx_port_stats_ext.hw_stats;
for (i = 0; i < bp->fw_rx_stats_ext_size; i++, j++) {
buf[j] = le64_to_cpu(*(rx_port_stats_ext +
--
1.8.3.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net-next 05/10] bnxt_en: Allocate additional memory for all statistics blocks.
2020-07-27 3:29 [PATCH net-next 00/10] bnxt_en update Michael Chan
` (3 preceding siblings ...)
2020-07-27 3:29 ` [PATCH net-next 04/10] bnxt_en: Refactor statistics code and structures Michael Chan
@ 2020-07-27 3:29 ` Michael Chan
2020-07-27 3:29 ` [PATCH net-next 06/10] bnxt_en: Retrieve hardware counter masks from firmware if available Michael Chan
` (5 subsequent siblings)
10 siblings, 0 replies; 15+ messages in thread
From: Michael Chan @ 2020-07-27 3:29 UTC (permalink / raw)
To: davem; +Cc: netdev, kuba
Some of these DMAed hardware counters are not full 64-bit counters and
so we need to accumulate them as they overflow. Allocate copies of these
DMA statistics memory blocks with the same size for accumulation. The
hardware counter widths are also counter specific so we allocate
memory for masks that correspond to each counter.
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 29 ++++++++++++++++++++++++-----
drivers/net/ethernet/broadcom/bnxt/bnxt.h | 2 ++
2 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index d232618..33dcb98 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -3705,6 +3705,10 @@ static int bnxt_alloc_hwrm_short_cmd_req(struct bnxt *bp)
static void bnxt_free_stats_mem(struct bnxt *bp, struct bnxt_stats_mem *stats)
{
+ kfree(stats->hw_masks);
+ stats->hw_masks = NULL;
+ kfree(stats->sw_stats);
+ stats->sw_stats = NULL;
if (stats->hw_stats) {
dma_free_coherent(&bp->pdev->dev, stats->len, stats->hw_stats,
stats->hw_stats_map);
@@ -3712,7 +3716,8 @@ static void bnxt_free_stats_mem(struct bnxt *bp, struct bnxt_stats_mem *stats)
}
}
-static int bnxt_alloc_stats_mem(struct bnxt *bp, struct bnxt_stats_mem *stats)
+static int bnxt_alloc_stats_mem(struct bnxt *bp, struct bnxt_stats_mem *stats,
+ bool alloc_masks)
{
stats->hw_stats = dma_alloc_coherent(&bp->pdev->dev, stats->len,
&stats->hw_stats_map, GFP_KERNEL);
@@ -3720,7 +3725,21 @@ static int bnxt_alloc_stats_mem(struct bnxt *bp, struct bnxt_stats_mem *stats)
return -ENOMEM;
memset(stats->hw_stats, 0, stats->len);
+
+ stats->sw_stats = kzalloc(stats->len, GFP_KERNEL);
+ if (!stats->sw_stats)
+ goto stats_mem_err;
+
+ if (alloc_masks) {
+ stats->hw_masks = kzalloc(stats->len, GFP_KERNEL);
+ if (!stats->hw_masks)
+ goto stats_mem_err;
+ }
return 0;
+
+stats_mem_err:
+ bnxt_free_stats_mem(bp, stats);
+ return -ENOMEM;
}
static void bnxt_free_port_stats(struct bnxt *bp)
@@ -3760,7 +3779,7 @@ static int bnxt_alloc_stats(struct bnxt *bp)
struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
cpr->stats.len = size;
- rc = bnxt_alloc_stats_mem(bp, &cpr->stats);
+ rc = bnxt_alloc_stats_mem(bp, &cpr->stats, !i);
if (rc)
return rc;
@@ -3774,7 +3793,7 @@ static int bnxt_alloc_stats(struct bnxt *bp)
goto alloc_ext_stats;
bp->port_stats.len = BNXT_PORT_STATS_SIZE;
- rc = bnxt_alloc_stats_mem(bp, &bp->port_stats);
+ rc = bnxt_alloc_stats_mem(bp, &bp->port_stats, true);
if (rc)
return rc;
@@ -3790,7 +3809,7 @@ static int bnxt_alloc_stats(struct bnxt *bp)
goto alloc_tx_ext_stats;
bp->rx_port_stats_ext.len = sizeof(struct rx_port_stats_ext);
- rc = bnxt_alloc_stats_mem(bp, &bp->rx_port_stats_ext);
+ rc = bnxt_alloc_stats_mem(bp, &bp->rx_port_stats_ext, true);
/* Extended stats are optional */
if (rc)
return 0;
@@ -3802,7 +3821,7 @@ static int bnxt_alloc_stats(struct bnxt *bp)
if (bp->hwrm_spec_code >= 0x10902 ||
(bp->fw_cap & BNXT_FW_CAP_EXT_STATS_SUPPORTED)) {
bp->tx_port_stats_ext.len = sizeof(struct tx_port_stats_ext);
- rc = bnxt_alloc_stats_mem(bp, &bp->tx_port_stats_ext);
+ rc = bnxt_alloc_stats_mem(bp, &bp->tx_port_stats_ext, true);
/* Extended stats are optional */
if (rc)
return 0;
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index 7e9fe1f..69672ec 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -920,6 +920,8 @@ struct bnxt_sw_stats {
};
struct bnxt_stats_mem {
+ u64 *sw_stats;
+ u64 *hw_masks;
void *hw_stats;
dma_addr_t hw_stats_map;
int len;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net-next 06/10] bnxt_en: Retrieve hardware counter masks from firmware if available.
2020-07-27 3:29 [PATCH net-next 00/10] bnxt_en update Michael Chan
` (4 preceding siblings ...)
2020-07-27 3:29 ` [PATCH net-next 05/10] bnxt_en: Allocate additional memory for all statistics blocks Michael Chan
@ 2020-07-27 3:29 ` Michael Chan
2020-07-27 3:29 ` [PATCH net-next 07/10] bnxt_en: Retrieve hardware masks for port counters Michael Chan
` (4 subsequent siblings)
10 siblings, 0 replies; 15+ messages in thread
From: Michael Chan @ 2020-07-27 3:29 UTC (permalink / raw)
To: davem; +Cc: netdev, kuba
Newer firmware has a new call HWRM_FUNC_QSTATS_EXT to retrieve the
masks of all ring counters. Make this call when supported to
initialize the hardware masks of all ring counters. If the call
is not available, assume 48-bit ring counter masks on P5 chips.
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 64 +++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 33dcb98..65d503f 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -3742,6 +3742,69 @@ static int bnxt_alloc_stats_mem(struct bnxt *bp, struct bnxt_stats_mem *stats,
return -ENOMEM;
}
+static void bnxt_fill_masks(u64 *mask_arr, u64 mask, int count)
+{
+ int i;
+
+ for (i = 0; i < count; i++)
+ mask_arr[i] = mask;
+}
+
+static void bnxt_copy_hw_masks(u64 *mask_arr, __le64 *hw_mask_arr, int count)
+{
+ int i;
+
+ for (i = 0; i < count; i++)
+ mask_arr[i] = le64_to_cpu(hw_mask_arr[i]);
+}
+
+static int bnxt_hwrm_func_qstat_ext(struct bnxt *bp,
+ struct bnxt_stats_mem *stats)
+{
+ struct hwrm_func_qstats_ext_output *resp = bp->hwrm_cmd_resp_addr;
+ struct hwrm_func_qstats_ext_input req = {0};
+ __le64 *hw_masks;
+ int rc;
+
+ if (!(bp->fw_cap & BNXT_FW_CAP_EXT_HW_STATS_SUPPORTED) ||
+ !(bp->flags & BNXT_FLAG_CHIP_P5))
+ return -EOPNOTSUPP;
+
+ bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_QSTATS_EXT, -1, -1);
+ req.flags = FUNC_QSTATS_EXT_REQ_FLAGS_COUNTER_MASK;
+ mutex_lock(&bp->hwrm_cmd_lock);
+ rc = _hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
+ if (rc)
+ goto qstat_exit;
+
+ hw_masks = &resp->rx_ucast_pkts;
+ bnxt_copy_hw_masks(stats->hw_masks, hw_masks, stats->len / 8);
+
+qstat_exit:
+ mutex_unlock(&bp->hwrm_cmd_lock);
+ return rc;
+}
+
+static void bnxt_init_stats(struct bnxt *bp)
+{
+ struct bnxt_napi *bnapi = bp->bnapi[0];
+ struct bnxt_cp_ring_info *cpr;
+ struct bnxt_stats_mem *stats;
+ u64 mask;
+ int rc;
+
+ cpr = &bnapi->cp_ring;
+ stats = &cpr->stats;
+ rc = bnxt_hwrm_func_qstat_ext(bp, stats);
+ if (rc) {
+ if (bp->flags & BNXT_FLAG_CHIP_P5)
+ mask = (1ULL << 48) - 1;
+ else
+ mask = -1ULL;
+ bnxt_fill_masks(stats->hw_masks, mask, stats->len / 8);
+ }
+}
+
static void bnxt_free_port_stats(struct bnxt *bp)
{
bp->flags &= ~BNXT_FLAG_PORT_STATS;
@@ -4029,6 +4092,7 @@ static int bnxt_alloc_mem(struct bnxt *bp, bool irq_re_init)
rc = bnxt_alloc_stats(bp);
if (rc)
goto alloc_mem_err;
+ bnxt_init_stats(bp);
rc = bnxt_alloc_ntp_fltrs(bp);
if (rc)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net-next 07/10] bnxt_en: Retrieve hardware masks for port counters.
2020-07-27 3:29 [PATCH net-next 00/10] bnxt_en update Michael Chan
` (5 preceding siblings ...)
2020-07-27 3:29 ` [PATCH net-next 06/10] bnxt_en: Retrieve hardware counter masks from firmware if available Michael Chan
@ 2020-07-27 3:29 ` Michael Chan
2020-07-27 3:29 ` [PATCH net-next 08/10] bnxt_en: Accumulate all counters Michael Chan
` (3 subsequent siblings)
10 siblings, 0 replies; 15+ messages in thread
From: Michael Chan @ 2020-07-27 3:29 UTC (permalink / raw)
To: davem; +Cc: netdev, kuba
If supported by newer firmware, make the firmware call to query all
the port counter masks. If not supported, assume 40-bit port
counter masks.
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 75 ++++++++++++++++++++++++++++---
1 file changed, 70 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 65d503f..b79d8e9 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -3785,13 +3785,19 @@ static int bnxt_hwrm_func_qstat_ext(struct bnxt *bp,
return rc;
}
+static int bnxt_hwrm_port_qstats(struct bnxt *bp, u8 flags);
+static int bnxt_hwrm_port_qstats_ext(struct bnxt *bp, u8 flags);
+
static void bnxt_init_stats(struct bnxt *bp)
{
struct bnxt_napi *bnapi = bp->bnapi[0];
struct bnxt_cp_ring_info *cpr;
struct bnxt_stats_mem *stats;
+ __le64 *rx_stats, *tx_stats;
+ int rc, rx_count, tx_count;
+ u64 *rx_masks, *tx_masks;
u64 mask;
- int rc;
+ u8 flags;
cpr = &bnapi->cp_ring;
stats = &cpr->stats;
@@ -3803,6 +3809,54 @@ static void bnxt_init_stats(struct bnxt *bp)
mask = -1ULL;
bnxt_fill_masks(stats->hw_masks, mask, stats->len / 8);
}
+ if (bp->flags & BNXT_FLAG_PORT_STATS) {
+ stats = &bp->port_stats;
+ rx_stats = stats->hw_stats;
+ rx_masks = stats->hw_masks;
+ rx_count = sizeof(struct rx_port_stats) / 8;
+ tx_stats = rx_stats + BNXT_TX_PORT_STATS_BYTE_OFFSET / 8;
+ tx_masks = rx_masks + BNXT_TX_PORT_STATS_BYTE_OFFSET / 8;
+ tx_count = sizeof(struct tx_port_stats) / 8;
+
+ flags = PORT_QSTATS_REQ_FLAGS_COUNTER_MASK;
+ rc = bnxt_hwrm_port_qstats(bp, flags);
+ if (rc) {
+ mask = (1ULL << 40) - 1;
+
+ bnxt_fill_masks(rx_masks, mask, rx_count);
+ bnxt_fill_masks(tx_masks, mask, tx_count);
+ } else {
+ bnxt_copy_hw_masks(rx_masks, rx_stats, rx_count);
+ bnxt_copy_hw_masks(tx_masks, tx_stats, tx_count);
+ bnxt_hwrm_port_qstats(bp, 0);
+ }
+ }
+ if (bp->flags & BNXT_FLAG_PORT_STATS_EXT) {
+ stats = &bp->rx_port_stats_ext;
+ rx_stats = stats->hw_stats;
+ rx_masks = stats->hw_masks;
+ rx_count = sizeof(struct rx_port_stats_ext) / 8;
+ stats = &bp->tx_port_stats_ext;
+ tx_stats = stats->hw_stats;
+ tx_masks = stats->hw_masks;
+ tx_count = sizeof(struct tx_port_stats_ext) / 8;
+
+ flags = FUNC_QSTATS_EXT_REQ_FLAGS_COUNTER_MASK;
+ rc = bnxt_hwrm_port_qstats_ext(bp, flags);
+ if (rc) {
+ mask = (1ULL << 40) - 1;
+
+ bnxt_fill_masks(rx_masks, mask, rx_count);
+ if (tx_stats)
+ bnxt_fill_masks(tx_masks, mask, tx_count);
+ } else {
+ bnxt_copy_hw_masks(rx_masks, rx_stats, rx_count);
+ if (tx_stats)
+ bnxt_copy_hw_masks(tx_masks, tx_stats,
+ tx_count);
+ bnxt_hwrm_port_qstats_ext(bp, 0);
+ }
+ }
}
static void bnxt_free_port_stats(struct bnxt *bp)
@@ -7530,7 +7584,7 @@ int bnxt_hwrm_fw_set_time(struct bnxt *bp)
return hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
}
-static int bnxt_hwrm_port_qstats(struct bnxt *bp)
+static int bnxt_hwrm_port_qstats(struct bnxt *bp, u8 flags)
{
struct bnxt_pf_info *pf = &bp->pf;
struct hwrm_port_qstats_input req = {0};
@@ -7538,6 +7592,10 @@ static int bnxt_hwrm_port_qstats(struct bnxt *bp)
if (!(bp->flags & BNXT_FLAG_PORT_STATS))
return 0;
+ if (flags && !(bp->fw_cap & BNXT_FW_CAP_EXT_HW_STATS_SUPPORTED))
+ return -EOPNOTSUPP;
+
+ req.flags = flags;
bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_PORT_QSTATS, -1, -1);
req.port_id = cpu_to_le16(pf->port_id);
req.tx_stat_host_addr = cpu_to_le64(bp->port_stats.hw_stats_map +
@@ -7546,7 +7604,7 @@ static int bnxt_hwrm_port_qstats(struct bnxt *bp)
return hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
}
-static int bnxt_hwrm_port_qstats_ext(struct bnxt *bp)
+static int bnxt_hwrm_port_qstats_ext(struct bnxt *bp, u8 flags)
{
struct hwrm_port_qstats_ext_output *resp = bp->hwrm_cmd_resp_addr;
struct hwrm_queue_pri2cos_qcfg_input req2 = {0};
@@ -7558,7 +7616,11 @@ static int bnxt_hwrm_port_qstats_ext(struct bnxt *bp)
if (!(bp->flags & BNXT_FLAG_PORT_STATS_EXT))
return 0;
+ if (flags && !(bp->fw_cap & BNXT_FW_CAP_EXT_HW_STATS_SUPPORTED))
+ return -EOPNOTSUPP;
+
bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_PORT_QSTATS_EXT, -1, -1);
+ req.flags = flags;
req.port_id = cpu_to_le16(pf->port_id);
req.rx_stat_size = cpu_to_le16(sizeof(struct rx_port_stats_ext));
req.rx_stat_host_addr = cpu_to_le64(bp->rx_port_stats_ext.hw_stats_map);
@@ -7576,6 +7638,9 @@ static int bnxt_hwrm_port_qstats_ext(struct bnxt *bp)
bp->fw_rx_stats_ext_size = 0;
bp->fw_tx_stats_ext_size = 0;
}
+ if (flags)
+ goto qstats_done;
+
if (bp->fw_tx_stats_ext_size <=
offsetof(struct tx_port_stats_ext, pfc_pri0_tx_duration_us) / 8) {
mutex_unlock(&bp->hwrm_cmd_lock);
@@ -10494,8 +10559,8 @@ static void bnxt_sp_task(struct work_struct *work)
if (test_and_clear_bit(BNXT_HWRM_EXEC_FWD_REQ_SP_EVENT, &bp->sp_event))
bnxt_hwrm_exec_fwd_req(bp);
if (test_and_clear_bit(BNXT_PERIODIC_STATS_SP_EVENT, &bp->sp_event)) {
- bnxt_hwrm_port_qstats(bp);
- bnxt_hwrm_port_qstats_ext(bp);
+ bnxt_hwrm_port_qstats(bp, 0);
+ bnxt_hwrm_port_qstats_ext(bp, 0);
}
if (test_and_clear_bit(BNXT_LINK_CHNG_SP_EVENT, &bp->sp_event)) {
--
1.8.3.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net-next 08/10] bnxt_en: Accumulate all counters.
2020-07-27 3:29 [PATCH net-next 00/10] bnxt_en update Michael Chan
` (6 preceding siblings ...)
2020-07-27 3:29 ` [PATCH net-next 07/10] bnxt_en: Retrieve hardware masks for port counters Michael Chan
@ 2020-07-27 3:29 ` Michael Chan
2020-07-27 3:29 ` [PATCH net-next 09/10] bnxt_en: Switch over to use the 64-bit software accumulated counters Michael Chan
` (2 subsequent siblings)
10 siblings, 0 replies; 15+ messages in thread
From: Michael Chan @ 2020-07-27 3:29 UTC (permalink / raw)
To: davem; +Cc: netdev, kuba
Now that we have the infrastructure in place, add the new function
bnxt_accumulate_all_stats() to periodically accumulate and check for
counter rollover of all ring stats and port stats.
A chip bug was also discovered that could cause some ring counters to
become 0 during DMA. Workaround by ignoring zeros on the affected
chips.
Some older frimware will reset port counters during ifdown. We need
to check for that and free the accumulated port counters during ifdown
to prevent bogus counter overflow detection during ifup.
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 91 ++++++++++++++++++++++++++++++-
drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 +
2 files changed, 90 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index b79d8e9..a8e86da 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -4043,6 +4043,8 @@ static void bnxt_free_mem(struct bnxt *bp, bool irq_re_init)
bnxt_free_ntp_fltrs(bp, irq_re_init);
if (irq_re_init) {
bnxt_free_ring_stats(bp);
+ if (!(bp->fw_cap & BNXT_FW_CAP_PORT_STATS_NO_RESET))
+ bnxt_free_port_stats(bp);
bnxt_free_ring_grps(bp);
bnxt_free_vnics(bp);
kfree(bp->tx_ring_map);
@@ -7584,6 +7586,88 @@ int bnxt_hwrm_fw_set_time(struct bnxt *bp)
return hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
}
+static void bnxt_add_one_ctr(u64 hw, u64 *sw, u64 mask)
+{
+ u64 sw_tmp;
+
+ sw_tmp = (*sw & ~mask) | hw;
+ if (hw < (*sw & mask))
+ sw_tmp += mask + 1;
+ WRITE_ONCE(*sw, sw_tmp);
+}
+
+static void __bnxt_accumulate_stats(__le64 *hw_stats, u64 *sw_stats, u64 *masks,
+ int count, bool ignore_zero)
+{
+ int i;
+
+ for (i = 0; i < count; i++) {
+ u64 hw = le64_to_cpu(READ_ONCE(hw_stats[i]));
+
+ if (ignore_zero && !hw)
+ continue;
+
+ if (masks[i] == -1ULL)
+ sw_stats[i] = hw;
+ else
+ bnxt_add_one_ctr(hw, &sw_stats[i], masks[i]);
+ }
+}
+
+static void bnxt_accumulate_stats(struct bnxt_stats_mem *stats)
+{
+ if (!stats->hw_stats)
+ return;
+
+ __bnxt_accumulate_stats(stats->hw_stats, stats->sw_stats,
+ stats->hw_masks, stats->len / 8, false);
+}
+
+static void bnxt_accumulate_all_stats(struct bnxt *bp)
+{
+ struct bnxt_stats_mem *ring0_stats;
+ bool ignore_zero = false;
+ int i;
+
+ /* Chip bug. Counter intermittently becomes 0. */
+ if (bp->flags & BNXT_FLAG_CHIP_P5)
+ ignore_zero = true;
+
+ for (i = 0; i < bp->cp_nr_rings; i++) {
+ struct bnxt_napi *bnapi = bp->bnapi[i];
+ struct bnxt_cp_ring_info *cpr;
+ struct bnxt_stats_mem *stats;
+
+ cpr = &bnapi->cp_ring;
+ stats = &cpr->stats;
+ if (!i)
+ ring0_stats = stats;
+ __bnxt_accumulate_stats(stats->hw_stats, stats->sw_stats,
+ ring0_stats->hw_masks,
+ ring0_stats->len / 8, ignore_zero);
+ }
+ if (bp->flags & BNXT_FLAG_PORT_STATS) {
+ struct bnxt_stats_mem *stats = &bp->port_stats;
+ __le64 *hw_stats = stats->hw_stats;
+ u64 *sw_stats = stats->sw_stats;
+ u64 *masks = stats->hw_masks;
+ int cnt;
+
+ cnt = sizeof(struct rx_port_stats) / 8;
+ __bnxt_accumulate_stats(hw_stats, sw_stats, masks, cnt, false);
+
+ hw_stats += BNXT_TX_PORT_STATS_BYTE_OFFSET / 8;
+ sw_stats += BNXT_TX_PORT_STATS_BYTE_OFFSET / 8;
+ masks += BNXT_TX_PORT_STATS_BYTE_OFFSET / 8;
+ cnt = sizeof(struct tx_port_stats) / 8;
+ __bnxt_accumulate_stats(hw_stats, sw_stats, masks, cnt, false);
+ }
+ if (bp->flags & BNXT_FLAG_PORT_STATS_EXT) {
+ bnxt_accumulate_stats(&bp->rx_port_stats_ext);
+ bnxt_accumulate_stats(&bp->tx_port_stats_ext);
+ }
+}
+
static int bnxt_hwrm_port_qstats(struct bnxt *bp, u8 flags)
{
struct bnxt_pf_info *pf = &bp->pf;
@@ -8702,6 +8786,9 @@ static int bnxt_hwrm_phy_qcaps(struct bnxt *bp)
if (BNXT_PF(bp))
bp->fw_cap |= BNXT_FW_CAP_SHARED_PORT_CFG;
}
+ if (resp->flags & PORT_PHY_QCAPS_RESP_FLAGS_CUMULATIVE_COUNTERS_ON_RESET)
+ bp->fw_cap |= BNXT_FW_CAP_PORT_STATS_NO_RESET;
+
if (resp->supported_speeds_auto_mode)
link_info->support_auto_speeds =
le16_to_cpu(resp->supported_speeds_auto_mode);
@@ -10272,8 +10359,7 @@ static void bnxt_timer(struct timer_list *t)
if (bp->fw_cap & BNXT_FW_CAP_ERROR_RECOVERY)
bnxt_fw_health_check(bp);
- if (bp->link_info.link_up && (bp->flags & BNXT_FLAG_PORT_STATS) &&
- bp->stats_coal_ticks) {
+ if (bp->link_info.link_up && bp->stats_coal_ticks) {
set_bit(BNXT_PERIODIC_STATS_SP_EVENT, &bp->sp_event);
bnxt_queue_sp_work(bp);
}
@@ -10561,6 +10647,7 @@ static void bnxt_sp_task(struct work_struct *work)
if (test_and_clear_bit(BNXT_PERIODIC_STATS_SP_EVENT, &bp->sp_event)) {
bnxt_hwrm_port_qstats(bp, 0);
bnxt_hwrm_port_qstats_ext(bp, 0);
+ bnxt_accumulate_all_stats(bp);
}
if (test_and_clear_bit(BNXT_LINK_CHNG_SP_EVENT, &bp->sp_event)) {
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index 69672ec..44c7812 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -1769,6 +1769,7 @@ struct bnxt {
#define BNXT_FW_CAP_VLAN_RX_STRIP 0x01000000
#define BNXT_FW_CAP_VLAN_TX_INSERT 0x02000000
#define BNXT_FW_CAP_EXT_HW_STATS_SUPPORTED 0x04000000
+ #define BNXT_FW_CAP_PORT_STATS_NO_RESET 0x10000000
#define BNXT_NEW_RM(bp) ((bp)->fw_cap & BNXT_FW_CAP_NEW_RM)
u32 hwrm_spec_code;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net-next 09/10] bnxt_en: Switch over to use the 64-bit software accumulated counters.
2020-07-27 3:29 [PATCH net-next 00/10] bnxt_en update Michael Chan
` (7 preceding siblings ...)
2020-07-27 3:29 ` [PATCH net-next 08/10] bnxt_en: Accumulate all counters Michael Chan
@ 2020-07-27 3:29 ` Michael Chan
2020-07-27 3:29 ` [PATCH net-next 10/10] bnxt_en: Add support for 'ethtool -d' Michael Chan
2020-07-27 18:36 ` [PATCH net-next 00/10] bnxt_en update David Miller
10 siblings, 0 replies; 15+ messages in thread
From: Michael Chan @ 2020-07-27 3:29 UTC (permalink / raw)
To: davem; +Cc: netdev, kuba
Now we can report all the full 64-bit CPU endian software accumulated
counters instead of the hw counters, some of which may be less than
64-bit wide. Define the necessary macros to access the software
counters.
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 67 ++++++++++++-----------
drivers/net/ethernet/broadcom/bnxt/bnxt.h | 9 +++
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 41 +++++++-------
3 files changed, 64 insertions(+), 53 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index a8e86da..014edd8 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -9791,34 +9791,33 @@ static void bnxt_get_ring_stats(struct bnxt *bp,
{
int i;
-
for (i = 0; i < bp->cp_nr_rings; i++) {
struct bnxt_napi *bnapi = bp->bnapi[i];
struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
- struct ctx_hw_stats *hw_stats = cpr->stats.hw_stats;
+ u64 *sw = cpr->stats.sw_stats;
- stats->rx_packets += le64_to_cpu(hw_stats->rx_ucast_pkts);
- stats->rx_packets += le64_to_cpu(hw_stats->rx_mcast_pkts);
- stats->rx_packets += le64_to_cpu(hw_stats->rx_bcast_pkts);
+ stats->rx_packets += BNXT_GET_RING_STATS64(sw, rx_ucast_pkts);
+ stats->rx_packets += BNXT_GET_RING_STATS64(sw, rx_mcast_pkts);
+ stats->rx_packets += BNXT_GET_RING_STATS64(sw, rx_bcast_pkts);
- stats->tx_packets += le64_to_cpu(hw_stats->tx_ucast_pkts);
- stats->tx_packets += le64_to_cpu(hw_stats->tx_mcast_pkts);
- stats->tx_packets += le64_to_cpu(hw_stats->tx_bcast_pkts);
+ stats->tx_packets += BNXT_GET_RING_STATS64(sw, tx_ucast_pkts);
+ stats->tx_packets += BNXT_GET_RING_STATS64(sw, tx_mcast_pkts);
+ stats->tx_packets += BNXT_GET_RING_STATS64(sw, tx_bcast_pkts);
- stats->rx_bytes += le64_to_cpu(hw_stats->rx_ucast_bytes);
- stats->rx_bytes += le64_to_cpu(hw_stats->rx_mcast_bytes);
- stats->rx_bytes += le64_to_cpu(hw_stats->rx_bcast_bytes);
+ stats->rx_bytes += BNXT_GET_RING_STATS64(sw, rx_ucast_bytes);
+ stats->rx_bytes += BNXT_GET_RING_STATS64(sw, rx_mcast_bytes);
+ stats->rx_bytes += BNXT_GET_RING_STATS64(sw, rx_bcast_bytes);
- stats->tx_bytes += le64_to_cpu(hw_stats->tx_ucast_bytes);
- stats->tx_bytes += le64_to_cpu(hw_stats->tx_mcast_bytes);
- stats->tx_bytes += le64_to_cpu(hw_stats->tx_bcast_bytes);
+ stats->tx_bytes += BNXT_GET_RING_STATS64(sw, tx_ucast_bytes);
+ stats->tx_bytes += BNXT_GET_RING_STATS64(sw, tx_mcast_bytes);
+ stats->tx_bytes += BNXT_GET_RING_STATS64(sw, tx_bcast_bytes);
stats->rx_missed_errors +=
- le64_to_cpu(hw_stats->rx_discard_pkts);
+ BNXT_GET_RING_STATS64(sw, rx_discard_pkts);
- stats->multicast += le64_to_cpu(hw_stats->rx_mcast_pkts);
+ stats->multicast += BNXT_GET_RING_STATS64(sw, rx_mcast_pkts);
- stats->tx_dropped += le64_to_cpu(hw_stats->tx_error_pkts);
+ stats->tx_dropped += BNXT_GET_RING_STATS64(sw, tx_error_pkts);
}
}
@@ -9856,20 +9855,26 @@ static void bnxt_add_prev_stats(struct bnxt *bp,
bnxt_add_prev_stats(bp, stats);
if (bp->flags & BNXT_FLAG_PORT_STATS) {
- struct rx_port_stats *rx = bp->port_stats.hw_stats;
- struct tx_port_stats *tx = bp->port_stats.hw_stats +
- BNXT_TX_PORT_STATS_BYTE_OFFSET;
-
- stats->rx_crc_errors = le64_to_cpu(rx->rx_fcs_err_frames);
- stats->rx_frame_errors = le64_to_cpu(rx->rx_align_err_frames);
- stats->rx_length_errors = le64_to_cpu(rx->rx_undrsz_frames) +
- le64_to_cpu(rx->rx_ovrsz_frames) +
- le64_to_cpu(rx->rx_runt_frames);
- stats->rx_errors = le64_to_cpu(rx->rx_false_carrier_frames) +
- le64_to_cpu(rx->rx_jbr_frames);
- stats->collisions = le64_to_cpu(tx->tx_total_collisions);
- stats->tx_fifo_errors = le64_to_cpu(tx->tx_fifo_underruns);
- stats->tx_errors = le64_to_cpu(tx->tx_err);
+ u64 *rx = bp->port_stats.sw_stats;
+ u64 *tx = bp->port_stats.sw_stats +
+ BNXT_TX_PORT_STATS_BYTE_OFFSET / 8;
+
+ stats->rx_crc_errors =
+ BNXT_GET_RX_PORT_STATS64(rx, rx_fcs_err_frames);
+ stats->rx_frame_errors =
+ BNXT_GET_RX_PORT_STATS64(rx, rx_align_err_frames);
+ stats->rx_length_errors =
+ BNXT_GET_RX_PORT_STATS64(rx, rx_undrsz_frames) +
+ BNXT_GET_RX_PORT_STATS64(rx, rx_ovrsz_frames) +
+ BNXT_GET_RX_PORT_STATS64(rx, rx_runt_frames);
+ stats->rx_errors =
+ BNXT_GET_RX_PORT_STATS64(rx, rx_false_carrier_frames) +
+ BNXT_GET_RX_PORT_STATS64(rx, rx_jbr_frames);
+ stats->collisions =
+ BNXT_GET_TX_PORT_STATS64(tx, tx_total_collisions);
+ stats->tx_fifo_errors =
+ BNXT_GET_TX_PORT_STATS64(tx, tx_fifo_underruns);
+ stats->tx_errors = BNXT_GET_TX_PORT_STATS64(tx, tx_err);
}
clear_bit(BNXT_STATE_READ_STATS, &bp->state);
}
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index 44c7812..0c9b79b 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -1928,6 +1928,15 @@ struct bnxt {
struct device *hwmon_dev;
};
+#define BNXT_GET_RING_STATS64(sw, counter) \
+ (*((sw) + offsetof(struct ctx_hw_stats, counter) / 8))
+
+#define BNXT_GET_RX_PORT_STATS64(sw, counter) \
+ (*((sw) + offsetof(struct rx_port_stats, counter) / 8))
+
+#define BNXT_GET_TX_PORT_STATS64(sw, counter) \
+ (*((sw) + offsetof(struct tx_port_stats, counter) / 8))
+
#define BNXT_PORT_STATS_SIZE \
(sizeof(struct rx_port_stats) + sizeof(struct tx_port_stats) + 1024)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index 59ebb2b..ff380d7 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -559,20 +559,19 @@ static void bnxt_get_ethtool_stats(struct net_device *dev,
for (i = 0; i < bp->cp_nr_rings; i++) {
struct bnxt_napi *bnapi = bp->bnapi[i];
struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
- struct ctx_hw_stats *hw = cpr->stats.hw_stats;
- __le64 *hw_stats = cpr->stats.hw_stats;
+ u64 *sw_stats = cpr->stats.sw_stats;
u64 *sw;
int k;
if (is_rx_ring(bp, i)) {
for (k = 0; k < NUM_RING_RX_HW_STATS; j++, k++)
- buf[j] = le64_to_cpu(hw_stats[k]);
+ buf[j] = sw_stats[k];
}
if (is_tx_ring(bp, i)) {
k = NUM_RING_RX_HW_STATS;
for (; k < NUM_RING_RX_HW_STATS + NUM_RING_TX_HW_STATS;
j++, k++)
- buf[j] = le64_to_cpu(hw_stats[k]);
+ buf[j] = sw_stats[k];
}
if (!tpa_stats || !is_rx_ring(bp, i))
goto skip_tpa_ring_stats;
@@ -580,7 +579,7 @@ static void bnxt_get_ethtool_stats(struct net_device *dev,
k = NUM_RING_RX_HW_STATS + NUM_RING_TX_HW_STATS;
for (; k < NUM_RING_RX_HW_STATS + NUM_RING_TX_HW_STATS +
tpa_stats; j++, k++)
- buf[j] = le64_to_cpu(hw_stats[k]);
+ buf[j] = sw_stats[k];
skip_tpa_ring_stats:
sw = (u64 *)&cpr->sw_stats.rx;
@@ -594,9 +593,9 @@ static void bnxt_get_ethtool_stats(struct net_device *dev,
buf[j] = sw[k];
bnxt_sw_func_stats[RX_TOTAL_DISCARDS].counter +=
- le64_to_cpu(hw->rx_discard_pkts);
+ BNXT_GET_RING_STATS64(sw_stats, rx_discard_pkts);
bnxt_sw_func_stats[TX_TOTAL_DISCARDS].counter +=
- le64_to_cpu(hw->tx_discard_pkts);
+ BNXT_GET_RING_STATS64(sw_stats, tx_discard_pkts);
}
for (i = 0; i < BNXT_NUM_SW_FUNC_STATS; i++, j++)
@@ -604,49 +603,47 @@ static void bnxt_get_ethtool_stats(struct net_device *dev,
skip_ring_stats:
if (bp->flags & BNXT_FLAG_PORT_STATS) {
- __le64 *port_stats = bp->port_stats.hw_stats;
+ u64 *port_stats = bp->port_stats.sw_stats;
- for (i = 0; i < BNXT_NUM_PORT_STATS; i++, j++) {
- buf[j] = le64_to_cpu(*(port_stats +
- bnxt_port_stats_arr[i].offset));
- }
+ for (i = 0; i < BNXT_NUM_PORT_STATS; i++, j++)
+ buf[j] = *(port_stats + bnxt_port_stats_arr[i].offset);
}
if (bp->flags & BNXT_FLAG_PORT_STATS_EXT) {
- __le64 *rx_port_stats_ext = bp->rx_port_stats_ext.hw_stats;
- __le64 *tx_port_stats_ext = bp->tx_port_stats_ext.hw_stats;
+ u64 *rx_port_stats_ext = bp->rx_port_stats_ext.sw_stats;
+ u64 *tx_port_stats_ext = bp->tx_port_stats_ext.sw_stats;
for (i = 0; i < bp->fw_rx_stats_ext_size; i++, j++) {
- buf[j] = le64_to_cpu(*(rx_port_stats_ext +
- bnxt_port_stats_ext_arr[i].offset));
+ buf[j] = *(rx_port_stats_ext +
+ bnxt_port_stats_ext_arr[i].offset);
}
for (i = 0; i < bp->fw_tx_stats_ext_size; i++, j++) {
- buf[j] = le64_to_cpu(*(tx_port_stats_ext +
- bnxt_tx_port_stats_ext_arr[i].offset));
+ buf[j] = *(tx_port_stats_ext +
+ bnxt_tx_port_stats_ext_arr[i].offset);
}
if (bp->pri2cos_valid) {
for (i = 0; i < 8; i++, j++) {
long n = bnxt_rx_bytes_pri_arr[i].base_off +
bp->pri2cos_idx[i];
- buf[j] = le64_to_cpu(*(rx_port_stats_ext + n));
+ buf[j] = *(rx_port_stats_ext + n);
}
for (i = 0; i < 8; i++, j++) {
long n = bnxt_rx_pkts_pri_arr[i].base_off +
bp->pri2cos_idx[i];
- buf[j] = le64_to_cpu(*(rx_port_stats_ext + n));
+ buf[j] = *(rx_port_stats_ext + n);
}
for (i = 0; i < 8; i++, j++) {
long n = bnxt_tx_bytes_pri_arr[i].base_off +
bp->pri2cos_idx[i];
- buf[j] = le64_to_cpu(*(tx_port_stats_ext + n));
+ buf[j] = *(tx_port_stats_ext + n);
}
for (i = 0; i < 8; i++, j++) {
long n = bnxt_tx_pkts_pri_arr[i].base_off +
bp->pri2cos_idx[i];
- buf[j] = le64_to_cpu(*(tx_port_stats_ext + n));
+ buf[j] = *(tx_port_stats_ext + n);
}
}
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net-next 10/10] bnxt_en: Add support for 'ethtool -d'
2020-07-27 3:29 [PATCH net-next 00/10] bnxt_en update Michael Chan
` (8 preceding siblings ...)
2020-07-27 3:29 ` [PATCH net-next 09/10] bnxt_en: Switch over to use the 64-bit software accumulated counters Michael Chan
@ 2020-07-27 3:29 ` Michael Chan
2020-07-27 18:36 ` [PATCH net-next 00/10] bnxt_en update David Miller
10 siblings, 0 replies; 15+ messages in thread
From: Michael Chan @ 2020-07-27 3:29 UTC (permalink / raw)
To: davem; +Cc: netdev, kuba, Vasundhara Volam
From: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Add support to dump PXP registers and PCIe statistics.
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.c | 32 +++++++++++++
drivers/net/ethernet/broadcom/bnxt/bnxt.h | 5 +++
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 55 +++++++++++++++++++++++
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h | 2 +
4 files changed, 94 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 014edd8..943345b 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -10220,6 +10220,38 @@ static int bnxt_set_features(struct net_device *dev, netdev_features_t features)
return rc;
}
+int bnxt_dbg_hwrm_rd_reg(struct bnxt *bp, u32 reg_off, u16 num_words,
+ u32 *reg_buf)
+{
+ struct hwrm_dbg_read_direct_output *resp = bp->hwrm_cmd_resp_addr;
+ struct hwrm_dbg_read_direct_input req = {0};
+ __le32 *dbg_reg_buf;
+ dma_addr_t mapping;
+ int rc, i;
+
+ dbg_reg_buf = dma_alloc_coherent(&bp->pdev->dev, num_words * 4,
+ &mapping, GFP_KERNEL);
+ if (!dbg_reg_buf)
+ return -ENOMEM;
+ bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_DBG_READ_DIRECT, -1, -1);
+ req.host_dest_addr = cpu_to_le64(mapping);
+ req.read_addr = cpu_to_le32(reg_off + CHIMP_REG_VIEW_ADDR);
+ req.read_len32 = cpu_to_le32(num_words);
+ mutex_lock(&bp->hwrm_cmd_lock);
+ rc = _hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
+ if (rc || resp->error_code) {
+ rc = -EIO;
+ goto dbg_rd_reg_exit;
+ }
+ for (i = 0; i < num_words; i++)
+ reg_buf[i] = le32_to_cpu(dbg_reg_buf[i]);
+
+dbg_rd_reg_exit:
+ mutex_unlock(&bp->hwrm_cmd_lock);
+ dma_free_coherent(&bp->pdev->dev, num_words * 4, dbg_reg_buf, mapping);
+ return rc;
+}
+
static int bnxt_dbg_hwrm_ring_info_get(struct bnxt *bp, u8 ring_type,
u32 ring_id, u32 *prod, u32 *cons)
{
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index 0c9b79b..5a13eb6 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -1304,6 +1304,9 @@ struct bnxt_test_info {
char string[BNXT_MAX_TEST][ETH_GSTRING_LEN];
};
+#define CHIMP_REG_VIEW_ADDR \
+ ((bp->flags & BNXT_FLAG_CHIP_P5) ? 0x80000000 : 0xb1000000)
+
#define BNXT_GRCPF_REG_CHIMP_COMM 0x0
#define BNXT_GRCPF_REG_CHIMP_COMM_TRIGGER 0x100
#define BNXT_GRCPF_REG_WINDOW_BASE_OUT 0x400
@@ -2117,6 +2120,8 @@ int bnxt_hwrm_func_drv_rgtr(struct bnxt *bp, unsigned long *bmap,
int bnxt_half_open_nic(struct bnxt *bp);
void bnxt_half_close_nic(struct bnxt *bp);
int bnxt_close_nic(struct bnxt *, bool, bool);
+int bnxt_dbg_hwrm_rd_reg(struct bnxt *bp, u32 reg_off, u16 num_words,
+ u32 *reg_buf);
void bnxt_fw_exception(struct bnxt *bp);
void bnxt_fw_reset(struct bnxt *bp);
int bnxt_check_rings(struct bnxt *bp, int tx, int rx, bool sh, int tcs,
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index ff380d7..7fd7997 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -1324,6 +1324,59 @@ static void bnxt_get_drvinfo(struct net_device *dev,
info->regdump_len = 0;
}
+static int bnxt_get_regs_len(struct net_device *dev)
+{
+ struct bnxt *bp = netdev_priv(dev);
+ int reg_len;
+
+ reg_len = BNXT_PXP_REG_LEN;
+
+ if (bp->fw_cap & BNXT_FW_CAP_PCIE_STATS_SUPPORTED)
+ reg_len += sizeof(struct pcie_ctx_hw_stats);
+
+ return reg_len;
+}
+
+static void bnxt_get_regs(struct net_device *dev, struct ethtool_regs *regs,
+ void *_p)
+{
+ struct pcie_ctx_hw_stats *hw_pcie_stats;
+ struct hwrm_pcie_qstats_input req = {0};
+ struct bnxt *bp = netdev_priv(dev);
+ dma_addr_t hw_pcie_stats_addr;
+ int rc;
+
+ regs->version = 0;
+ bnxt_dbg_hwrm_rd_reg(bp, 0, BNXT_PXP_REG_LEN / 4, _p);
+
+ if (!(bp->fw_cap & BNXT_FW_CAP_PCIE_STATS_SUPPORTED))
+ return;
+
+ hw_pcie_stats = dma_alloc_coherent(&bp->pdev->dev,
+ sizeof(*hw_pcie_stats),
+ &hw_pcie_stats_addr, GFP_KERNEL);
+ if (!hw_pcie_stats)
+ return;
+
+ regs->version = 1;
+ bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_PCIE_QSTATS, -1, -1);
+ req.pcie_stat_size = cpu_to_le16(sizeof(*hw_pcie_stats));
+ req.pcie_stat_host_addr = cpu_to_le64(hw_pcie_stats_addr);
+ mutex_lock(&bp->hwrm_cmd_lock);
+ rc = _hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
+ if (!rc) {
+ __le64 *src = (__le64 *)hw_pcie_stats;
+ u64 *dst = (u64 *)(_p + BNXT_PXP_REG_LEN);
+ int i;
+
+ for (i = 0; i < sizeof(*hw_pcie_stats) / sizeof(__le64); i++)
+ dst[i] = le64_to_cpu(src[i]);
+ }
+ mutex_unlock(&bp->hwrm_cmd_lock);
+ dma_free_coherent(&bp->pdev->dev, sizeof(*hw_pcie_stats), hw_pcie_stats,
+ hw_pcie_stats_addr);
+}
+
static void bnxt_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{
struct bnxt *bp = netdev_priv(dev);
@@ -3596,6 +3649,8 @@ void bnxt_ethtool_free(struct bnxt *bp)
.get_pauseparam = bnxt_get_pauseparam,
.set_pauseparam = bnxt_set_pauseparam,
.get_drvinfo = bnxt_get_drvinfo,
+ .get_regs_len = bnxt_get_regs_len,
+ .get_regs = bnxt_get_regs,
.get_wol = bnxt_get_wol,
.set_wol = bnxt_set_wol,
.get_coalesce = bnxt_get_coalesce,
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h
index dddbca1..34f44dd 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h
@@ -84,6 +84,8 @@ struct hwrm_dbg_cmn_output {
ETH_RESET_PHY | ETH_RESET_RAM) \
<< ETH_RESET_SHARED_SHIFT)
+#define BNXT_PXP_REG_LEN 0x3110
+
extern const struct ethtool_ops bnxt_ethtool_ops;
u32 bnxt_get_rxfh_indir_size(struct net_device *dev);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH net-next 02/10] bnxt_en: Update firmware interface to 1.10.1.54.
2020-07-27 3:29 ` [PATCH net-next 02/10] bnxt_en: Update firmware interface to 1.10.1.54 Michael Chan
@ 2020-07-27 7:31 ` kernel test robot
0 siblings, 0 replies; 15+ messages in thread
From: kernel test robot @ 2020-07-27 7:31 UTC (permalink / raw)
To: Michael Chan, davem; +Cc: kbuild-all, netdev, kuba
[-- Attachment #1: Type: text/plain, Size: 19484 bytes --]
Hi Michael,
I love your patch! Yet something to improve:
[auto build test ERROR on net-next/master]
url: https://github.com/0day-ci/linux/commits/Michael-Chan/bnxt_en-update/20200727-113250
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git a57066b1a01977a646145f4ce8dfb4538b08368a
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/swab.h:5,
from include/uapi/linux/byteorder/big_endian.h:13,
from include/linux/byteorder/big_endian.h:5,
from arch/powerpc/include/uapi/asm/byteorder.h:14,
from include/asm-generic/bitops/le.h:6,
from arch/powerpc/include/asm/bitops.h:246,
from include/linux/bitops.h:29,
from include/linux/kernel.h:12,
from include/linux/interrupt.h:6,
from drivers/infiniband/hw/bnxt_re/hw_counters.c:40:
drivers/infiniband/hw/bnxt_re/hw_counters.c: In function 'bnxt_re_ib_get_hw_stats':
>> drivers/infiniband/hw/bnxt_re/hw_counters.c:135:31: error: 'struct ctx_hw_stats' has no member named 'rx_drop_pkts'; did you mean 'rx_error_pkts'?
135 | le64_to_cpu(bnxt_re_stats->rx_drop_pkts);
| ^~~~~~~~~~~~
include/uapi/linux/swab.h:128:54: note: in definition of macro '__swab64'
128 | #define __swab64(x) (__u64)__builtin_bswap64((__u64)(x))
| ^
include/linux/byteorder/generic.h:87:21: note: in expansion of macro '__le64_to_cpu'
87 | #define le64_to_cpu __le64_to_cpu
| ^~~~~~~~~~~~~
drivers/infiniband/hw/bnxt_re/hw_counters.c:135:4: note: in expansion of macro 'le64_to_cpu'
135 | le64_to_cpu(bnxt_re_stats->rx_drop_pkts);
| ^~~~~~~~~~~
vim +135 drivers/infiniband/hw/bnxt_re/hw_counters.c
225937d6ccff3b Somnath Kotur 2017-08-02 @40 #include <linux/interrupt.h>
225937d6ccff3b Somnath Kotur 2017-08-02 41 #include <linux/types.h>
225937d6ccff3b Somnath Kotur 2017-08-02 42 #include <linux/spinlock.h>
225937d6ccff3b Somnath Kotur 2017-08-02 43 #include <linux/sched.h>
225937d6ccff3b Somnath Kotur 2017-08-02 44 #include <linux/slab.h>
225937d6ccff3b Somnath Kotur 2017-08-02 45 #include <linux/pci.h>
225937d6ccff3b Somnath Kotur 2017-08-02 46 #include <linux/prefetch.h>
225937d6ccff3b Somnath Kotur 2017-08-02 47 #include <linux/delay.h>
225937d6ccff3b Somnath Kotur 2017-08-02 48
225937d6ccff3b Somnath Kotur 2017-08-02 49 #include <rdma/ib_addr.h>
225937d6ccff3b Somnath Kotur 2017-08-02 50
225937d6ccff3b Somnath Kotur 2017-08-02 51 #include "bnxt_ulp.h"
225937d6ccff3b Somnath Kotur 2017-08-02 52 #include "roce_hsi.h"
225937d6ccff3b Somnath Kotur 2017-08-02 53 #include "qplib_res.h"
225937d6ccff3b Somnath Kotur 2017-08-02 54 #include "qplib_sp.h"
225937d6ccff3b Somnath Kotur 2017-08-02 55 #include "qplib_fp.h"
225937d6ccff3b Somnath Kotur 2017-08-02 56 #include "qplib_rcfw.h"
225937d6ccff3b Somnath Kotur 2017-08-02 57 #include "bnxt_re.h"
225937d6ccff3b Somnath Kotur 2017-08-02 58 #include "hw_counters.h"
225937d6ccff3b Somnath Kotur 2017-08-02 59
225937d6ccff3b Somnath Kotur 2017-08-02 60 static const char * const bnxt_re_stat_name[] = {
225937d6ccff3b Somnath Kotur 2017-08-02 61 [BNXT_RE_ACTIVE_QP] = "active_qps",
225937d6ccff3b Somnath Kotur 2017-08-02 62 [BNXT_RE_ACTIVE_SRQ] = "active_srqs",
225937d6ccff3b Somnath Kotur 2017-08-02 63 [BNXT_RE_ACTIVE_CQ] = "active_cqs",
225937d6ccff3b Somnath Kotur 2017-08-02 64 [BNXT_RE_ACTIVE_MR] = "active_mrs",
225937d6ccff3b Somnath Kotur 2017-08-02 65 [BNXT_RE_ACTIVE_MW] = "active_mws",
225937d6ccff3b Somnath Kotur 2017-08-02 66 [BNXT_RE_RX_PKTS] = "rx_pkts",
225937d6ccff3b Somnath Kotur 2017-08-02 67 [BNXT_RE_RX_BYTES] = "rx_bytes",
225937d6ccff3b Somnath Kotur 2017-08-02 68 [BNXT_RE_TX_PKTS] = "tx_pkts",
225937d6ccff3b Somnath Kotur 2017-08-02 69 [BNXT_RE_TX_BYTES] = "tx_bytes",
89f81008baac88 Selvin Xavier 2018-01-11 70 [BNXT_RE_RECOVERABLE_ERRORS] = "recoverable_errors",
5c80c9138e28f6 Selvin Xavier 2018-10-08 71 [BNXT_RE_RX_DROPS] = "rx_roce_drops",
5c80c9138e28f6 Selvin Xavier 2018-10-08 72 [BNXT_RE_RX_DISCARDS] = "rx_roce_discards",
89f81008baac88 Selvin Xavier 2018-01-11 73 [BNXT_RE_TO_RETRANSMITS] = "to_retransmits",
89f81008baac88 Selvin Xavier 2018-01-11 74 [BNXT_RE_SEQ_ERR_NAKS_RCVD] = "seq_err_naks_rcvd",
89f81008baac88 Selvin Xavier 2018-01-11 75 [BNXT_RE_MAX_RETRY_EXCEEDED] = "max_retry_exceeded",
89f81008baac88 Selvin Xavier 2018-01-11 76 [BNXT_RE_RNR_NAKS_RCVD] = "rnr_naks_rcvd",
d97a3e92f33685 Colin Ian King 2019-09-11 77 [BNXT_RE_MISSING_RESP] = "missing_resp",
89f81008baac88 Selvin Xavier 2018-01-11 78 [BNXT_RE_UNRECOVERABLE_ERR] = "unrecoverable_err",
89f81008baac88 Selvin Xavier 2018-01-11 79 [BNXT_RE_BAD_RESP_ERR] = "bad_resp_err",
89f81008baac88 Selvin Xavier 2018-01-11 80 [BNXT_RE_LOCAL_QP_OP_ERR] = "local_qp_op_err",
89f81008baac88 Selvin Xavier 2018-01-11 81 [BNXT_RE_LOCAL_PROTECTION_ERR] = "local_protection_err",
89f81008baac88 Selvin Xavier 2018-01-11 82 [BNXT_RE_MEM_MGMT_OP_ERR] = "mem_mgmt_op_err",
89f81008baac88 Selvin Xavier 2018-01-11 83 [BNXT_RE_REMOTE_INVALID_REQ_ERR] = "remote_invalid_req_err",
89f81008baac88 Selvin Xavier 2018-01-11 84 [BNXT_RE_REMOTE_ACCESS_ERR] = "remote_access_err",
89f81008baac88 Selvin Xavier 2018-01-11 85 [BNXT_RE_REMOTE_OP_ERR] = "remote_op_err",
89f81008baac88 Selvin Xavier 2018-01-11 86 [BNXT_RE_DUP_REQ] = "dup_req",
89f81008baac88 Selvin Xavier 2018-01-11 87 [BNXT_RE_RES_EXCEED_MAX] = "res_exceed_max",
89f81008baac88 Selvin Xavier 2018-01-11 88 [BNXT_RE_RES_LENGTH_MISMATCH] = "res_length_mismatch",
89f81008baac88 Selvin Xavier 2018-01-11 89 [BNXT_RE_RES_EXCEEDS_WQE] = "res_exceeds_wqe",
89f81008baac88 Selvin Xavier 2018-01-11 90 [BNXT_RE_RES_OPCODE_ERR] = "res_opcode_err",
89f81008baac88 Selvin Xavier 2018-01-11 91 [BNXT_RE_RES_RX_INVALID_RKEY] = "res_rx_invalid_rkey",
89f81008baac88 Selvin Xavier 2018-01-11 92 [BNXT_RE_RES_RX_DOMAIN_ERR] = "res_rx_domain_err",
89f81008baac88 Selvin Xavier 2018-01-11 93 [BNXT_RE_RES_RX_NO_PERM] = "res_rx_no_perm",
89f81008baac88 Selvin Xavier 2018-01-11 94 [BNXT_RE_RES_RX_RANGE_ERR] = "res_rx_range_err",
89f81008baac88 Selvin Xavier 2018-01-11 95 [BNXT_RE_RES_TX_INVALID_RKEY] = "res_tx_invalid_rkey",
89f81008baac88 Selvin Xavier 2018-01-11 96 [BNXT_RE_RES_TX_DOMAIN_ERR] = "res_tx_domain_err",
89f81008baac88 Selvin Xavier 2018-01-11 97 [BNXT_RE_RES_TX_NO_PERM] = "res_tx_no_perm",
89f81008baac88 Selvin Xavier 2018-01-11 98 [BNXT_RE_RES_TX_RANGE_ERR] = "res_tx_range_err",
89f81008baac88 Selvin Xavier 2018-01-11 99 [BNXT_RE_RES_IRRQ_OFLOW] = "res_irrq_oflow",
89f81008baac88 Selvin Xavier 2018-01-11 100 [BNXT_RE_RES_UNSUP_OPCODE] = "res_unsup_opcode",
89f81008baac88 Selvin Xavier 2018-01-11 101 [BNXT_RE_RES_UNALIGNED_ATOMIC] = "res_unaligned_atomic",
89f81008baac88 Selvin Xavier 2018-01-11 102 [BNXT_RE_RES_REM_INV_ERR] = "res_rem_inv_err",
89f81008baac88 Selvin Xavier 2018-01-11 103 [BNXT_RE_RES_MEM_ERROR] = "res_mem_err",
89f81008baac88 Selvin Xavier 2018-01-11 104 [BNXT_RE_RES_SRQ_ERR] = "res_srq_err",
89f81008baac88 Selvin Xavier 2018-01-11 105 [BNXT_RE_RES_CMP_ERR] = "res_cmp_err",
89f81008baac88 Selvin Xavier 2018-01-11 106 [BNXT_RE_RES_INVALID_DUP_RKEY] = "res_invalid_dup_rkey",
89f81008baac88 Selvin Xavier 2018-01-11 107 [BNXT_RE_RES_WQE_FORMAT_ERR] = "res_wqe_format_err",
89f81008baac88 Selvin Xavier 2018-01-11 108 [BNXT_RE_RES_CQ_LOAD_ERR] = "res_cq_load_err",
89f81008baac88 Selvin Xavier 2018-01-11 109 [BNXT_RE_RES_SRQ_LOAD_ERR] = "res_srq_load_err",
89f81008baac88 Selvin Xavier 2018-01-11 110 [BNXT_RE_RES_TX_PCI_ERR] = "res_tx_pci_err",
316dd2825db139 Selvin Xavier 2018-10-08 111 [BNXT_RE_RES_RX_PCI_ERR] = "res_rx_pci_err",
316dd2825db139 Selvin Xavier 2018-10-08 112 [BNXT_RE_OUT_OF_SEQ_ERR] = "oos_drop_count"
225937d6ccff3b Somnath Kotur 2017-08-02 113 };
225937d6ccff3b Somnath Kotur 2017-08-02 114
225937d6ccff3b Somnath Kotur 2017-08-02 115 int bnxt_re_ib_get_hw_stats(struct ib_device *ibdev,
225937d6ccff3b Somnath Kotur 2017-08-02 116 struct rdma_hw_stats *stats,
225937d6ccff3b Somnath Kotur 2017-08-02 117 u8 port, int index)
225937d6ccff3b Somnath Kotur 2017-08-02 118 {
225937d6ccff3b Somnath Kotur 2017-08-02 119 struct bnxt_re_dev *rdev = to_bnxt_re_dev(ibdev, ibdev);
225937d6ccff3b Somnath Kotur 2017-08-02 120 struct ctx_hw_stats *bnxt_re_stats = rdev->qplib_ctx.stats.dma;
89f81008baac88 Selvin Xavier 2018-01-11 121 int rc = 0;
225937d6ccff3b Somnath Kotur 2017-08-02 122
225937d6ccff3b Somnath Kotur 2017-08-02 123 if (!port || !stats)
225937d6ccff3b Somnath Kotur 2017-08-02 124 return -EINVAL;
225937d6ccff3b Somnath Kotur 2017-08-02 125
225937d6ccff3b Somnath Kotur 2017-08-02 126 stats->value[BNXT_RE_ACTIVE_QP] = atomic_read(&rdev->qp_count);
225937d6ccff3b Somnath Kotur 2017-08-02 127 stats->value[BNXT_RE_ACTIVE_SRQ] = atomic_read(&rdev->srq_count);
225937d6ccff3b Somnath Kotur 2017-08-02 128 stats->value[BNXT_RE_ACTIVE_CQ] = atomic_read(&rdev->cq_count);
225937d6ccff3b Somnath Kotur 2017-08-02 129 stats->value[BNXT_RE_ACTIVE_MR] = atomic_read(&rdev->mr_count);
225937d6ccff3b Somnath Kotur 2017-08-02 130 stats->value[BNXT_RE_ACTIVE_MW] = atomic_read(&rdev->mw_count);
225937d6ccff3b Somnath Kotur 2017-08-02 131 if (bnxt_re_stats) {
225937d6ccff3b Somnath Kotur 2017-08-02 132 stats->value[BNXT_RE_RECOVERABLE_ERRORS] =
225937d6ccff3b Somnath Kotur 2017-08-02 133 le64_to_cpu(bnxt_re_stats->tx_bcast_pkts);
5c80c9138e28f6 Selvin Xavier 2018-10-08 134 stats->value[BNXT_RE_RX_DROPS] =
5c80c9138e28f6 Selvin Xavier 2018-10-08 @135 le64_to_cpu(bnxt_re_stats->rx_drop_pkts);
5c80c9138e28f6 Selvin Xavier 2018-10-08 136 stats->value[BNXT_RE_RX_DISCARDS] =
5c80c9138e28f6 Selvin Xavier 2018-10-08 137 le64_to_cpu(bnxt_re_stats->rx_discard_pkts);
225937d6ccff3b Somnath Kotur 2017-08-02 138 stats->value[BNXT_RE_RX_PKTS] =
225937d6ccff3b Somnath Kotur 2017-08-02 139 le64_to_cpu(bnxt_re_stats->rx_ucast_pkts);
225937d6ccff3b Somnath Kotur 2017-08-02 140 stats->value[BNXT_RE_RX_BYTES] =
225937d6ccff3b Somnath Kotur 2017-08-02 141 le64_to_cpu(bnxt_re_stats->rx_ucast_bytes);
225937d6ccff3b Somnath Kotur 2017-08-02 142 stats->value[BNXT_RE_TX_PKTS] =
225937d6ccff3b Somnath Kotur 2017-08-02 143 le64_to_cpu(bnxt_re_stats->tx_ucast_pkts);
225937d6ccff3b Somnath Kotur 2017-08-02 144 stats->value[BNXT_RE_TX_BYTES] =
225937d6ccff3b Somnath Kotur 2017-08-02 145 le64_to_cpu(bnxt_re_stats->tx_ucast_bytes);
225937d6ccff3b Somnath Kotur 2017-08-02 146 }
89f81008baac88 Selvin Xavier 2018-01-11 147 if (test_bit(BNXT_RE_FLAG_ISSUE_ROCE_STATS, &rdev->flags)) {
89f81008baac88 Selvin Xavier 2018-01-11 148 rc = bnxt_qplib_get_roce_stats(&rdev->rcfw, &rdev->stats);
89f81008baac88 Selvin Xavier 2018-01-11 149 if (rc)
89f81008baac88 Selvin Xavier 2018-01-11 150 clear_bit(BNXT_RE_FLAG_ISSUE_ROCE_STATS,
89f81008baac88 Selvin Xavier 2018-01-11 151 &rdev->flags);
89f81008baac88 Selvin Xavier 2018-01-11 152 stats->value[BNXT_RE_TO_RETRANSMITS] =
89f81008baac88 Selvin Xavier 2018-01-11 153 rdev->stats.to_retransmits;
89f81008baac88 Selvin Xavier 2018-01-11 154 stats->value[BNXT_RE_SEQ_ERR_NAKS_RCVD] =
89f81008baac88 Selvin Xavier 2018-01-11 155 rdev->stats.seq_err_naks_rcvd;
89f81008baac88 Selvin Xavier 2018-01-11 156 stats->value[BNXT_RE_MAX_RETRY_EXCEEDED] =
89f81008baac88 Selvin Xavier 2018-01-11 157 rdev->stats.max_retry_exceeded;
89f81008baac88 Selvin Xavier 2018-01-11 158 stats->value[BNXT_RE_RNR_NAKS_RCVD] =
89f81008baac88 Selvin Xavier 2018-01-11 159 rdev->stats.rnr_naks_rcvd;
89f81008baac88 Selvin Xavier 2018-01-11 160 stats->value[BNXT_RE_MISSING_RESP] =
89f81008baac88 Selvin Xavier 2018-01-11 161 rdev->stats.missing_resp;
89f81008baac88 Selvin Xavier 2018-01-11 162 stats->value[BNXT_RE_UNRECOVERABLE_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 163 rdev->stats.unrecoverable_err;
89f81008baac88 Selvin Xavier 2018-01-11 164 stats->value[BNXT_RE_BAD_RESP_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 165 rdev->stats.bad_resp_err;
89f81008baac88 Selvin Xavier 2018-01-11 166 stats->value[BNXT_RE_LOCAL_QP_OP_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 167 rdev->stats.local_qp_op_err;
89f81008baac88 Selvin Xavier 2018-01-11 168 stats->value[BNXT_RE_LOCAL_PROTECTION_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 169 rdev->stats.local_protection_err;
89f81008baac88 Selvin Xavier 2018-01-11 170 stats->value[BNXT_RE_MEM_MGMT_OP_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 171 rdev->stats.mem_mgmt_op_err;
89f81008baac88 Selvin Xavier 2018-01-11 172 stats->value[BNXT_RE_REMOTE_INVALID_REQ_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 173 rdev->stats.remote_invalid_req_err;
89f81008baac88 Selvin Xavier 2018-01-11 174 stats->value[BNXT_RE_REMOTE_ACCESS_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 175 rdev->stats.remote_access_err;
89f81008baac88 Selvin Xavier 2018-01-11 176 stats->value[BNXT_RE_REMOTE_OP_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 177 rdev->stats.remote_op_err;
89f81008baac88 Selvin Xavier 2018-01-11 178 stats->value[BNXT_RE_DUP_REQ] =
89f81008baac88 Selvin Xavier 2018-01-11 179 rdev->stats.dup_req;
89f81008baac88 Selvin Xavier 2018-01-11 180 stats->value[BNXT_RE_RES_EXCEED_MAX] =
89f81008baac88 Selvin Xavier 2018-01-11 181 rdev->stats.res_exceed_max;
89f81008baac88 Selvin Xavier 2018-01-11 182 stats->value[BNXT_RE_RES_LENGTH_MISMATCH] =
89f81008baac88 Selvin Xavier 2018-01-11 183 rdev->stats.res_length_mismatch;
89f81008baac88 Selvin Xavier 2018-01-11 184 stats->value[BNXT_RE_RES_EXCEEDS_WQE] =
89f81008baac88 Selvin Xavier 2018-01-11 185 rdev->stats.res_exceeds_wqe;
89f81008baac88 Selvin Xavier 2018-01-11 186 stats->value[BNXT_RE_RES_OPCODE_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 187 rdev->stats.res_opcode_err;
89f81008baac88 Selvin Xavier 2018-01-11 188 stats->value[BNXT_RE_RES_RX_INVALID_RKEY] =
89f81008baac88 Selvin Xavier 2018-01-11 189 rdev->stats.res_rx_invalid_rkey;
89f81008baac88 Selvin Xavier 2018-01-11 190 stats->value[BNXT_RE_RES_RX_DOMAIN_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 191 rdev->stats.res_rx_domain_err;
89f81008baac88 Selvin Xavier 2018-01-11 192 stats->value[BNXT_RE_RES_RX_NO_PERM] =
89f81008baac88 Selvin Xavier 2018-01-11 193 rdev->stats.res_rx_no_perm;
89f81008baac88 Selvin Xavier 2018-01-11 194 stats->value[BNXT_RE_RES_RX_RANGE_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 195 rdev->stats.res_rx_range_err;
89f81008baac88 Selvin Xavier 2018-01-11 196 stats->value[BNXT_RE_RES_TX_INVALID_RKEY] =
89f81008baac88 Selvin Xavier 2018-01-11 197 rdev->stats.res_tx_invalid_rkey;
89f81008baac88 Selvin Xavier 2018-01-11 198 stats->value[BNXT_RE_RES_TX_DOMAIN_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 199 rdev->stats.res_tx_domain_err;
89f81008baac88 Selvin Xavier 2018-01-11 200 stats->value[BNXT_RE_RES_TX_NO_PERM] =
89f81008baac88 Selvin Xavier 2018-01-11 201 rdev->stats.res_tx_no_perm;
89f81008baac88 Selvin Xavier 2018-01-11 202 stats->value[BNXT_RE_RES_TX_RANGE_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 203 rdev->stats.res_tx_range_err;
89f81008baac88 Selvin Xavier 2018-01-11 204 stats->value[BNXT_RE_RES_IRRQ_OFLOW] =
89f81008baac88 Selvin Xavier 2018-01-11 205 rdev->stats.res_irrq_oflow;
89f81008baac88 Selvin Xavier 2018-01-11 206 stats->value[BNXT_RE_RES_UNSUP_OPCODE] =
89f81008baac88 Selvin Xavier 2018-01-11 207 rdev->stats.res_unsup_opcode;
89f81008baac88 Selvin Xavier 2018-01-11 208 stats->value[BNXT_RE_RES_UNALIGNED_ATOMIC] =
89f81008baac88 Selvin Xavier 2018-01-11 209 rdev->stats.res_unaligned_atomic;
89f81008baac88 Selvin Xavier 2018-01-11 210 stats->value[BNXT_RE_RES_REM_INV_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 211 rdev->stats.res_rem_inv_err;
89f81008baac88 Selvin Xavier 2018-01-11 212 stats->value[BNXT_RE_RES_MEM_ERROR] =
89f81008baac88 Selvin Xavier 2018-01-11 213 rdev->stats.res_mem_error;
89f81008baac88 Selvin Xavier 2018-01-11 214 stats->value[BNXT_RE_RES_SRQ_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 215 rdev->stats.res_srq_err;
89f81008baac88 Selvin Xavier 2018-01-11 216 stats->value[BNXT_RE_RES_CMP_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 217 rdev->stats.res_cmp_err;
89f81008baac88 Selvin Xavier 2018-01-11 218 stats->value[BNXT_RE_RES_INVALID_DUP_RKEY] =
89f81008baac88 Selvin Xavier 2018-01-11 219 rdev->stats.res_invalid_dup_rkey;
89f81008baac88 Selvin Xavier 2018-01-11 220 stats->value[BNXT_RE_RES_WQE_FORMAT_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 221 rdev->stats.res_wqe_format_err;
89f81008baac88 Selvin Xavier 2018-01-11 222 stats->value[BNXT_RE_RES_CQ_LOAD_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 223 rdev->stats.res_cq_load_err;
89f81008baac88 Selvin Xavier 2018-01-11 224 stats->value[BNXT_RE_RES_SRQ_LOAD_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 225 rdev->stats.res_srq_load_err;
89f81008baac88 Selvin Xavier 2018-01-11 226 stats->value[BNXT_RE_RES_TX_PCI_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 227 rdev->stats.res_tx_pci_err;
89f81008baac88 Selvin Xavier 2018-01-11 228 stats->value[BNXT_RE_RES_RX_PCI_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 229 rdev->stats.res_rx_pci_err;
316dd2825db139 Selvin Xavier 2018-10-08 230 stats->value[BNXT_RE_OUT_OF_SEQ_ERR] =
316dd2825db139 Selvin Xavier 2018-10-08 231 rdev->stats.res_oos_drop_count;
89f81008baac88 Selvin Xavier 2018-01-11 232 }
89f81008baac88 Selvin Xavier 2018-01-11 233
225937d6ccff3b Somnath Kotur 2017-08-02 234 return ARRAY_SIZE(bnxt_re_stat_name);
225937d6ccff3b Somnath Kotur 2017-08-02 235 }
225937d6ccff3b Somnath Kotur 2017-08-02 236
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 69775 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH net-next 02/10] bnxt_en: Update firmware interface to 1.10.1.54.
@ 2020-07-27 7:31 ` kernel test robot
0 siblings, 0 replies; 15+ messages in thread
From: kernel test robot @ 2020-07-27 7:31 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 19734 bytes --]
Hi Michael,
I love your patch! Yet something to improve:
[auto build test ERROR on net-next/master]
url: https://github.com/0day-ci/linux/commits/Michael-Chan/bnxt_en-update/20200727-113250
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git a57066b1a01977a646145f4ce8dfb4538b08368a
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/swab.h:5,
from include/uapi/linux/byteorder/big_endian.h:13,
from include/linux/byteorder/big_endian.h:5,
from arch/powerpc/include/uapi/asm/byteorder.h:14,
from include/asm-generic/bitops/le.h:6,
from arch/powerpc/include/asm/bitops.h:246,
from include/linux/bitops.h:29,
from include/linux/kernel.h:12,
from include/linux/interrupt.h:6,
from drivers/infiniband/hw/bnxt_re/hw_counters.c:40:
drivers/infiniband/hw/bnxt_re/hw_counters.c: In function 'bnxt_re_ib_get_hw_stats':
>> drivers/infiniband/hw/bnxt_re/hw_counters.c:135:31: error: 'struct ctx_hw_stats' has no member named 'rx_drop_pkts'; did you mean 'rx_error_pkts'?
135 | le64_to_cpu(bnxt_re_stats->rx_drop_pkts);
| ^~~~~~~~~~~~
include/uapi/linux/swab.h:128:54: note: in definition of macro '__swab64'
128 | #define __swab64(x) (__u64)__builtin_bswap64((__u64)(x))
| ^
include/linux/byteorder/generic.h:87:21: note: in expansion of macro '__le64_to_cpu'
87 | #define le64_to_cpu __le64_to_cpu
| ^~~~~~~~~~~~~
drivers/infiniband/hw/bnxt_re/hw_counters.c:135:4: note: in expansion of macro 'le64_to_cpu'
135 | le64_to_cpu(bnxt_re_stats->rx_drop_pkts);
| ^~~~~~~~~~~
vim +135 drivers/infiniband/hw/bnxt_re/hw_counters.c
225937d6ccff3b Somnath Kotur 2017-08-02 @40 #include <linux/interrupt.h>
225937d6ccff3b Somnath Kotur 2017-08-02 41 #include <linux/types.h>
225937d6ccff3b Somnath Kotur 2017-08-02 42 #include <linux/spinlock.h>
225937d6ccff3b Somnath Kotur 2017-08-02 43 #include <linux/sched.h>
225937d6ccff3b Somnath Kotur 2017-08-02 44 #include <linux/slab.h>
225937d6ccff3b Somnath Kotur 2017-08-02 45 #include <linux/pci.h>
225937d6ccff3b Somnath Kotur 2017-08-02 46 #include <linux/prefetch.h>
225937d6ccff3b Somnath Kotur 2017-08-02 47 #include <linux/delay.h>
225937d6ccff3b Somnath Kotur 2017-08-02 48
225937d6ccff3b Somnath Kotur 2017-08-02 49 #include <rdma/ib_addr.h>
225937d6ccff3b Somnath Kotur 2017-08-02 50
225937d6ccff3b Somnath Kotur 2017-08-02 51 #include "bnxt_ulp.h"
225937d6ccff3b Somnath Kotur 2017-08-02 52 #include "roce_hsi.h"
225937d6ccff3b Somnath Kotur 2017-08-02 53 #include "qplib_res.h"
225937d6ccff3b Somnath Kotur 2017-08-02 54 #include "qplib_sp.h"
225937d6ccff3b Somnath Kotur 2017-08-02 55 #include "qplib_fp.h"
225937d6ccff3b Somnath Kotur 2017-08-02 56 #include "qplib_rcfw.h"
225937d6ccff3b Somnath Kotur 2017-08-02 57 #include "bnxt_re.h"
225937d6ccff3b Somnath Kotur 2017-08-02 58 #include "hw_counters.h"
225937d6ccff3b Somnath Kotur 2017-08-02 59
225937d6ccff3b Somnath Kotur 2017-08-02 60 static const char * const bnxt_re_stat_name[] = {
225937d6ccff3b Somnath Kotur 2017-08-02 61 [BNXT_RE_ACTIVE_QP] = "active_qps",
225937d6ccff3b Somnath Kotur 2017-08-02 62 [BNXT_RE_ACTIVE_SRQ] = "active_srqs",
225937d6ccff3b Somnath Kotur 2017-08-02 63 [BNXT_RE_ACTIVE_CQ] = "active_cqs",
225937d6ccff3b Somnath Kotur 2017-08-02 64 [BNXT_RE_ACTIVE_MR] = "active_mrs",
225937d6ccff3b Somnath Kotur 2017-08-02 65 [BNXT_RE_ACTIVE_MW] = "active_mws",
225937d6ccff3b Somnath Kotur 2017-08-02 66 [BNXT_RE_RX_PKTS] = "rx_pkts",
225937d6ccff3b Somnath Kotur 2017-08-02 67 [BNXT_RE_RX_BYTES] = "rx_bytes",
225937d6ccff3b Somnath Kotur 2017-08-02 68 [BNXT_RE_TX_PKTS] = "tx_pkts",
225937d6ccff3b Somnath Kotur 2017-08-02 69 [BNXT_RE_TX_BYTES] = "tx_bytes",
89f81008baac88 Selvin Xavier 2018-01-11 70 [BNXT_RE_RECOVERABLE_ERRORS] = "recoverable_errors",
5c80c9138e28f6 Selvin Xavier 2018-10-08 71 [BNXT_RE_RX_DROPS] = "rx_roce_drops",
5c80c9138e28f6 Selvin Xavier 2018-10-08 72 [BNXT_RE_RX_DISCARDS] = "rx_roce_discards",
89f81008baac88 Selvin Xavier 2018-01-11 73 [BNXT_RE_TO_RETRANSMITS] = "to_retransmits",
89f81008baac88 Selvin Xavier 2018-01-11 74 [BNXT_RE_SEQ_ERR_NAKS_RCVD] = "seq_err_naks_rcvd",
89f81008baac88 Selvin Xavier 2018-01-11 75 [BNXT_RE_MAX_RETRY_EXCEEDED] = "max_retry_exceeded",
89f81008baac88 Selvin Xavier 2018-01-11 76 [BNXT_RE_RNR_NAKS_RCVD] = "rnr_naks_rcvd",
d97a3e92f33685 Colin Ian King 2019-09-11 77 [BNXT_RE_MISSING_RESP] = "missing_resp",
89f81008baac88 Selvin Xavier 2018-01-11 78 [BNXT_RE_UNRECOVERABLE_ERR] = "unrecoverable_err",
89f81008baac88 Selvin Xavier 2018-01-11 79 [BNXT_RE_BAD_RESP_ERR] = "bad_resp_err",
89f81008baac88 Selvin Xavier 2018-01-11 80 [BNXT_RE_LOCAL_QP_OP_ERR] = "local_qp_op_err",
89f81008baac88 Selvin Xavier 2018-01-11 81 [BNXT_RE_LOCAL_PROTECTION_ERR] = "local_protection_err",
89f81008baac88 Selvin Xavier 2018-01-11 82 [BNXT_RE_MEM_MGMT_OP_ERR] = "mem_mgmt_op_err",
89f81008baac88 Selvin Xavier 2018-01-11 83 [BNXT_RE_REMOTE_INVALID_REQ_ERR] = "remote_invalid_req_err",
89f81008baac88 Selvin Xavier 2018-01-11 84 [BNXT_RE_REMOTE_ACCESS_ERR] = "remote_access_err",
89f81008baac88 Selvin Xavier 2018-01-11 85 [BNXT_RE_REMOTE_OP_ERR] = "remote_op_err",
89f81008baac88 Selvin Xavier 2018-01-11 86 [BNXT_RE_DUP_REQ] = "dup_req",
89f81008baac88 Selvin Xavier 2018-01-11 87 [BNXT_RE_RES_EXCEED_MAX] = "res_exceed_max",
89f81008baac88 Selvin Xavier 2018-01-11 88 [BNXT_RE_RES_LENGTH_MISMATCH] = "res_length_mismatch",
89f81008baac88 Selvin Xavier 2018-01-11 89 [BNXT_RE_RES_EXCEEDS_WQE] = "res_exceeds_wqe",
89f81008baac88 Selvin Xavier 2018-01-11 90 [BNXT_RE_RES_OPCODE_ERR] = "res_opcode_err",
89f81008baac88 Selvin Xavier 2018-01-11 91 [BNXT_RE_RES_RX_INVALID_RKEY] = "res_rx_invalid_rkey",
89f81008baac88 Selvin Xavier 2018-01-11 92 [BNXT_RE_RES_RX_DOMAIN_ERR] = "res_rx_domain_err",
89f81008baac88 Selvin Xavier 2018-01-11 93 [BNXT_RE_RES_RX_NO_PERM] = "res_rx_no_perm",
89f81008baac88 Selvin Xavier 2018-01-11 94 [BNXT_RE_RES_RX_RANGE_ERR] = "res_rx_range_err",
89f81008baac88 Selvin Xavier 2018-01-11 95 [BNXT_RE_RES_TX_INVALID_RKEY] = "res_tx_invalid_rkey",
89f81008baac88 Selvin Xavier 2018-01-11 96 [BNXT_RE_RES_TX_DOMAIN_ERR] = "res_tx_domain_err",
89f81008baac88 Selvin Xavier 2018-01-11 97 [BNXT_RE_RES_TX_NO_PERM] = "res_tx_no_perm",
89f81008baac88 Selvin Xavier 2018-01-11 98 [BNXT_RE_RES_TX_RANGE_ERR] = "res_tx_range_err",
89f81008baac88 Selvin Xavier 2018-01-11 99 [BNXT_RE_RES_IRRQ_OFLOW] = "res_irrq_oflow",
89f81008baac88 Selvin Xavier 2018-01-11 100 [BNXT_RE_RES_UNSUP_OPCODE] = "res_unsup_opcode",
89f81008baac88 Selvin Xavier 2018-01-11 101 [BNXT_RE_RES_UNALIGNED_ATOMIC] = "res_unaligned_atomic",
89f81008baac88 Selvin Xavier 2018-01-11 102 [BNXT_RE_RES_REM_INV_ERR] = "res_rem_inv_err",
89f81008baac88 Selvin Xavier 2018-01-11 103 [BNXT_RE_RES_MEM_ERROR] = "res_mem_err",
89f81008baac88 Selvin Xavier 2018-01-11 104 [BNXT_RE_RES_SRQ_ERR] = "res_srq_err",
89f81008baac88 Selvin Xavier 2018-01-11 105 [BNXT_RE_RES_CMP_ERR] = "res_cmp_err",
89f81008baac88 Selvin Xavier 2018-01-11 106 [BNXT_RE_RES_INVALID_DUP_RKEY] = "res_invalid_dup_rkey",
89f81008baac88 Selvin Xavier 2018-01-11 107 [BNXT_RE_RES_WQE_FORMAT_ERR] = "res_wqe_format_err",
89f81008baac88 Selvin Xavier 2018-01-11 108 [BNXT_RE_RES_CQ_LOAD_ERR] = "res_cq_load_err",
89f81008baac88 Selvin Xavier 2018-01-11 109 [BNXT_RE_RES_SRQ_LOAD_ERR] = "res_srq_load_err",
89f81008baac88 Selvin Xavier 2018-01-11 110 [BNXT_RE_RES_TX_PCI_ERR] = "res_tx_pci_err",
316dd2825db139 Selvin Xavier 2018-10-08 111 [BNXT_RE_RES_RX_PCI_ERR] = "res_rx_pci_err",
316dd2825db139 Selvin Xavier 2018-10-08 112 [BNXT_RE_OUT_OF_SEQ_ERR] = "oos_drop_count"
225937d6ccff3b Somnath Kotur 2017-08-02 113 };
225937d6ccff3b Somnath Kotur 2017-08-02 114
225937d6ccff3b Somnath Kotur 2017-08-02 115 int bnxt_re_ib_get_hw_stats(struct ib_device *ibdev,
225937d6ccff3b Somnath Kotur 2017-08-02 116 struct rdma_hw_stats *stats,
225937d6ccff3b Somnath Kotur 2017-08-02 117 u8 port, int index)
225937d6ccff3b Somnath Kotur 2017-08-02 118 {
225937d6ccff3b Somnath Kotur 2017-08-02 119 struct bnxt_re_dev *rdev = to_bnxt_re_dev(ibdev, ibdev);
225937d6ccff3b Somnath Kotur 2017-08-02 120 struct ctx_hw_stats *bnxt_re_stats = rdev->qplib_ctx.stats.dma;
89f81008baac88 Selvin Xavier 2018-01-11 121 int rc = 0;
225937d6ccff3b Somnath Kotur 2017-08-02 122
225937d6ccff3b Somnath Kotur 2017-08-02 123 if (!port || !stats)
225937d6ccff3b Somnath Kotur 2017-08-02 124 return -EINVAL;
225937d6ccff3b Somnath Kotur 2017-08-02 125
225937d6ccff3b Somnath Kotur 2017-08-02 126 stats->value[BNXT_RE_ACTIVE_QP] = atomic_read(&rdev->qp_count);
225937d6ccff3b Somnath Kotur 2017-08-02 127 stats->value[BNXT_RE_ACTIVE_SRQ] = atomic_read(&rdev->srq_count);
225937d6ccff3b Somnath Kotur 2017-08-02 128 stats->value[BNXT_RE_ACTIVE_CQ] = atomic_read(&rdev->cq_count);
225937d6ccff3b Somnath Kotur 2017-08-02 129 stats->value[BNXT_RE_ACTIVE_MR] = atomic_read(&rdev->mr_count);
225937d6ccff3b Somnath Kotur 2017-08-02 130 stats->value[BNXT_RE_ACTIVE_MW] = atomic_read(&rdev->mw_count);
225937d6ccff3b Somnath Kotur 2017-08-02 131 if (bnxt_re_stats) {
225937d6ccff3b Somnath Kotur 2017-08-02 132 stats->value[BNXT_RE_RECOVERABLE_ERRORS] =
225937d6ccff3b Somnath Kotur 2017-08-02 133 le64_to_cpu(bnxt_re_stats->tx_bcast_pkts);
5c80c9138e28f6 Selvin Xavier 2018-10-08 134 stats->value[BNXT_RE_RX_DROPS] =
5c80c9138e28f6 Selvin Xavier 2018-10-08 @135 le64_to_cpu(bnxt_re_stats->rx_drop_pkts);
5c80c9138e28f6 Selvin Xavier 2018-10-08 136 stats->value[BNXT_RE_RX_DISCARDS] =
5c80c9138e28f6 Selvin Xavier 2018-10-08 137 le64_to_cpu(bnxt_re_stats->rx_discard_pkts);
225937d6ccff3b Somnath Kotur 2017-08-02 138 stats->value[BNXT_RE_RX_PKTS] =
225937d6ccff3b Somnath Kotur 2017-08-02 139 le64_to_cpu(bnxt_re_stats->rx_ucast_pkts);
225937d6ccff3b Somnath Kotur 2017-08-02 140 stats->value[BNXT_RE_RX_BYTES] =
225937d6ccff3b Somnath Kotur 2017-08-02 141 le64_to_cpu(bnxt_re_stats->rx_ucast_bytes);
225937d6ccff3b Somnath Kotur 2017-08-02 142 stats->value[BNXT_RE_TX_PKTS] =
225937d6ccff3b Somnath Kotur 2017-08-02 143 le64_to_cpu(bnxt_re_stats->tx_ucast_pkts);
225937d6ccff3b Somnath Kotur 2017-08-02 144 stats->value[BNXT_RE_TX_BYTES] =
225937d6ccff3b Somnath Kotur 2017-08-02 145 le64_to_cpu(bnxt_re_stats->tx_ucast_bytes);
225937d6ccff3b Somnath Kotur 2017-08-02 146 }
89f81008baac88 Selvin Xavier 2018-01-11 147 if (test_bit(BNXT_RE_FLAG_ISSUE_ROCE_STATS, &rdev->flags)) {
89f81008baac88 Selvin Xavier 2018-01-11 148 rc = bnxt_qplib_get_roce_stats(&rdev->rcfw, &rdev->stats);
89f81008baac88 Selvin Xavier 2018-01-11 149 if (rc)
89f81008baac88 Selvin Xavier 2018-01-11 150 clear_bit(BNXT_RE_FLAG_ISSUE_ROCE_STATS,
89f81008baac88 Selvin Xavier 2018-01-11 151 &rdev->flags);
89f81008baac88 Selvin Xavier 2018-01-11 152 stats->value[BNXT_RE_TO_RETRANSMITS] =
89f81008baac88 Selvin Xavier 2018-01-11 153 rdev->stats.to_retransmits;
89f81008baac88 Selvin Xavier 2018-01-11 154 stats->value[BNXT_RE_SEQ_ERR_NAKS_RCVD] =
89f81008baac88 Selvin Xavier 2018-01-11 155 rdev->stats.seq_err_naks_rcvd;
89f81008baac88 Selvin Xavier 2018-01-11 156 stats->value[BNXT_RE_MAX_RETRY_EXCEEDED] =
89f81008baac88 Selvin Xavier 2018-01-11 157 rdev->stats.max_retry_exceeded;
89f81008baac88 Selvin Xavier 2018-01-11 158 stats->value[BNXT_RE_RNR_NAKS_RCVD] =
89f81008baac88 Selvin Xavier 2018-01-11 159 rdev->stats.rnr_naks_rcvd;
89f81008baac88 Selvin Xavier 2018-01-11 160 stats->value[BNXT_RE_MISSING_RESP] =
89f81008baac88 Selvin Xavier 2018-01-11 161 rdev->stats.missing_resp;
89f81008baac88 Selvin Xavier 2018-01-11 162 stats->value[BNXT_RE_UNRECOVERABLE_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 163 rdev->stats.unrecoverable_err;
89f81008baac88 Selvin Xavier 2018-01-11 164 stats->value[BNXT_RE_BAD_RESP_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 165 rdev->stats.bad_resp_err;
89f81008baac88 Selvin Xavier 2018-01-11 166 stats->value[BNXT_RE_LOCAL_QP_OP_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 167 rdev->stats.local_qp_op_err;
89f81008baac88 Selvin Xavier 2018-01-11 168 stats->value[BNXT_RE_LOCAL_PROTECTION_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 169 rdev->stats.local_protection_err;
89f81008baac88 Selvin Xavier 2018-01-11 170 stats->value[BNXT_RE_MEM_MGMT_OP_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 171 rdev->stats.mem_mgmt_op_err;
89f81008baac88 Selvin Xavier 2018-01-11 172 stats->value[BNXT_RE_REMOTE_INVALID_REQ_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 173 rdev->stats.remote_invalid_req_err;
89f81008baac88 Selvin Xavier 2018-01-11 174 stats->value[BNXT_RE_REMOTE_ACCESS_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 175 rdev->stats.remote_access_err;
89f81008baac88 Selvin Xavier 2018-01-11 176 stats->value[BNXT_RE_REMOTE_OP_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 177 rdev->stats.remote_op_err;
89f81008baac88 Selvin Xavier 2018-01-11 178 stats->value[BNXT_RE_DUP_REQ] =
89f81008baac88 Selvin Xavier 2018-01-11 179 rdev->stats.dup_req;
89f81008baac88 Selvin Xavier 2018-01-11 180 stats->value[BNXT_RE_RES_EXCEED_MAX] =
89f81008baac88 Selvin Xavier 2018-01-11 181 rdev->stats.res_exceed_max;
89f81008baac88 Selvin Xavier 2018-01-11 182 stats->value[BNXT_RE_RES_LENGTH_MISMATCH] =
89f81008baac88 Selvin Xavier 2018-01-11 183 rdev->stats.res_length_mismatch;
89f81008baac88 Selvin Xavier 2018-01-11 184 stats->value[BNXT_RE_RES_EXCEEDS_WQE] =
89f81008baac88 Selvin Xavier 2018-01-11 185 rdev->stats.res_exceeds_wqe;
89f81008baac88 Selvin Xavier 2018-01-11 186 stats->value[BNXT_RE_RES_OPCODE_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 187 rdev->stats.res_opcode_err;
89f81008baac88 Selvin Xavier 2018-01-11 188 stats->value[BNXT_RE_RES_RX_INVALID_RKEY] =
89f81008baac88 Selvin Xavier 2018-01-11 189 rdev->stats.res_rx_invalid_rkey;
89f81008baac88 Selvin Xavier 2018-01-11 190 stats->value[BNXT_RE_RES_RX_DOMAIN_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 191 rdev->stats.res_rx_domain_err;
89f81008baac88 Selvin Xavier 2018-01-11 192 stats->value[BNXT_RE_RES_RX_NO_PERM] =
89f81008baac88 Selvin Xavier 2018-01-11 193 rdev->stats.res_rx_no_perm;
89f81008baac88 Selvin Xavier 2018-01-11 194 stats->value[BNXT_RE_RES_RX_RANGE_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 195 rdev->stats.res_rx_range_err;
89f81008baac88 Selvin Xavier 2018-01-11 196 stats->value[BNXT_RE_RES_TX_INVALID_RKEY] =
89f81008baac88 Selvin Xavier 2018-01-11 197 rdev->stats.res_tx_invalid_rkey;
89f81008baac88 Selvin Xavier 2018-01-11 198 stats->value[BNXT_RE_RES_TX_DOMAIN_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 199 rdev->stats.res_tx_domain_err;
89f81008baac88 Selvin Xavier 2018-01-11 200 stats->value[BNXT_RE_RES_TX_NO_PERM] =
89f81008baac88 Selvin Xavier 2018-01-11 201 rdev->stats.res_tx_no_perm;
89f81008baac88 Selvin Xavier 2018-01-11 202 stats->value[BNXT_RE_RES_TX_RANGE_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 203 rdev->stats.res_tx_range_err;
89f81008baac88 Selvin Xavier 2018-01-11 204 stats->value[BNXT_RE_RES_IRRQ_OFLOW] =
89f81008baac88 Selvin Xavier 2018-01-11 205 rdev->stats.res_irrq_oflow;
89f81008baac88 Selvin Xavier 2018-01-11 206 stats->value[BNXT_RE_RES_UNSUP_OPCODE] =
89f81008baac88 Selvin Xavier 2018-01-11 207 rdev->stats.res_unsup_opcode;
89f81008baac88 Selvin Xavier 2018-01-11 208 stats->value[BNXT_RE_RES_UNALIGNED_ATOMIC] =
89f81008baac88 Selvin Xavier 2018-01-11 209 rdev->stats.res_unaligned_atomic;
89f81008baac88 Selvin Xavier 2018-01-11 210 stats->value[BNXT_RE_RES_REM_INV_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 211 rdev->stats.res_rem_inv_err;
89f81008baac88 Selvin Xavier 2018-01-11 212 stats->value[BNXT_RE_RES_MEM_ERROR] =
89f81008baac88 Selvin Xavier 2018-01-11 213 rdev->stats.res_mem_error;
89f81008baac88 Selvin Xavier 2018-01-11 214 stats->value[BNXT_RE_RES_SRQ_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 215 rdev->stats.res_srq_err;
89f81008baac88 Selvin Xavier 2018-01-11 216 stats->value[BNXT_RE_RES_CMP_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 217 rdev->stats.res_cmp_err;
89f81008baac88 Selvin Xavier 2018-01-11 218 stats->value[BNXT_RE_RES_INVALID_DUP_RKEY] =
89f81008baac88 Selvin Xavier 2018-01-11 219 rdev->stats.res_invalid_dup_rkey;
89f81008baac88 Selvin Xavier 2018-01-11 220 stats->value[BNXT_RE_RES_WQE_FORMAT_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 221 rdev->stats.res_wqe_format_err;
89f81008baac88 Selvin Xavier 2018-01-11 222 stats->value[BNXT_RE_RES_CQ_LOAD_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 223 rdev->stats.res_cq_load_err;
89f81008baac88 Selvin Xavier 2018-01-11 224 stats->value[BNXT_RE_RES_SRQ_LOAD_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 225 rdev->stats.res_srq_load_err;
89f81008baac88 Selvin Xavier 2018-01-11 226 stats->value[BNXT_RE_RES_TX_PCI_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 227 rdev->stats.res_tx_pci_err;
89f81008baac88 Selvin Xavier 2018-01-11 228 stats->value[BNXT_RE_RES_RX_PCI_ERR] =
89f81008baac88 Selvin Xavier 2018-01-11 229 rdev->stats.res_rx_pci_err;
316dd2825db139 Selvin Xavier 2018-10-08 230 stats->value[BNXT_RE_OUT_OF_SEQ_ERR] =
316dd2825db139 Selvin Xavier 2018-10-08 231 rdev->stats.res_oos_drop_count;
89f81008baac88 Selvin Xavier 2018-01-11 232 }
89f81008baac88 Selvin Xavier 2018-01-11 233
225937d6ccff3b Somnath Kotur 2017-08-02 234 return ARRAY_SIZE(bnxt_re_stat_name);
225937d6ccff3b Somnath Kotur 2017-08-02 235 }
225937d6ccff3b Somnath Kotur 2017-08-02 236
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 69775 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH net-next 00/10] bnxt_en update.
2020-07-27 3:29 [PATCH net-next 00/10] bnxt_en update Michael Chan
` (9 preceding siblings ...)
2020-07-27 3:29 ` [PATCH net-next 10/10] bnxt_en: Add support for 'ethtool -d' Michael Chan
@ 2020-07-27 18:36 ` David Miller
2020-07-27 18:42 ` Michael Chan
10 siblings, 1 reply; 15+ messages in thread
From: David Miller @ 2020-07-27 18:36 UTC (permalink / raw)
To: michael.chan; +Cc: netdev, kuba
From: Michael Chan <michael.chan@broadcom.com>
Date: Sun, 26 Jul 2020 23:29:36 -0400
> This patchset removes the PCIe histogram and other debug register
> data from ethtool -S. The removed data are not counters and they have
> very large and constantly fluctuating values that are not suitable for
> the ethtool -S decimal counter display.
>
> The rest of the patches implement counter rollover for all hardware
> counters that are not 64-bit counters. Different generations of
> hardware have different counter widths. The driver will now query
> the counter widths of all counters from firmware and implement
> rollover support on all non-64-bit counters.
>
> The last patch adds the PCIe histogram and other PCIe register data back
> using the ethtool -d interface.
I guess you missed the necessary infiniband driver updates necessary
with the firmware interface changes?
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH net-next 00/10] bnxt_en update.
2020-07-27 18:36 ` [PATCH net-next 00/10] bnxt_en update David Miller
@ 2020-07-27 18:42 ` Michael Chan
0 siblings, 0 replies; 15+ messages in thread
From: Michael Chan @ 2020-07-27 18:42 UTC (permalink / raw)
To: David Miller; +Cc: Netdev, Jakub Kicinski
On Mon, Jul 27, 2020 at 11:36 AM David Miller <davem@davemloft.net> wrote:
>
> From: Michael Chan <michael.chan@broadcom.com>
> Date: Sun, 26 Jul 2020 23:29:36 -0400
>
> > This patchset removes the PCIe histogram and other debug register
> > data from ethtool -S. The removed data are not counters and they have
> > very large and constantly fluctuating values that are not suitable for
> > the ethtool -S decimal counter display.
> >
> > The rest of the patches implement counter rollover for all hardware
> > counters that are not 64-bit counters. Different generations of
> > hardware have different counter widths. The driver will now query
> > the counter widths of all counters from firmware and implement
> > rollover support on all non-64-bit counters.
> >
> > The last patch adds the PCIe histogram and other PCIe register data back
> > using the ethtool -d interface.
>
> I guess you missed the necessary infiniband driver updates necessary
> with the firmware interface changes?
Yes, I missed it in v1, but v2 that I sent out afterwards has fixed it. Thanks.
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2020-07-27 18:43 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-27 3:29 [PATCH net-next 00/10] bnxt_en update Michael Chan
2020-07-27 3:29 ` [PATCH net-next 01/10] bnxt_en: Remove PCIe non-counters from ethtool statistics Michael Chan
2020-07-27 3:29 ` [PATCH net-next 02/10] bnxt_en: Update firmware interface to 1.10.1.54 Michael Chan
2020-07-27 7:31 ` kernel test robot
2020-07-27 7:31 ` kernel test robot
2020-07-27 3:29 ` [PATCH net-next 03/10] bnxt_en: Use macros to define port statistics size and offset Michael Chan
2020-07-27 3:29 ` [PATCH net-next 04/10] bnxt_en: Refactor statistics code and structures Michael Chan
2020-07-27 3:29 ` [PATCH net-next 05/10] bnxt_en: Allocate additional memory for all statistics blocks Michael Chan
2020-07-27 3:29 ` [PATCH net-next 06/10] bnxt_en: Retrieve hardware counter masks from firmware if available Michael Chan
2020-07-27 3:29 ` [PATCH net-next 07/10] bnxt_en: Retrieve hardware masks for port counters Michael Chan
2020-07-27 3:29 ` [PATCH net-next 08/10] bnxt_en: Accumulate all counters Michael Chan
2020-07-27 3:29 ` [PATCH net-next 09/10] bnxt_en: Switch over to use the 64-bit software accumulated counters Michael Chan
2020-07-27 3:29 ` [PATCH net-next 10/10] bnxt_en: Add support for 'ethtool -d' Michael Chan
2020-07-27 18:36 ` [PATCH net-next 00/10] bnxt_en update David Miller
2020-07-27 18:42 ` Michael Chan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.