From nobody Mon Jun 03 19:24:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VtNw86xzhz5Js2y; Mon, 03 Jun 2024 19:24:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VtNw85Yvfz4VDv; Mon, 3 Jun 2024 19:24:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WAkRNPtZB9Tt5f774Umf1Fr1sEAWBup73eZK1rlHrmI=; b=UkA66OrnZvu5CMP89UMI4IA2+85DTzLoa3MjMjjRqhqRE8TDlp6vK5kjdWs1WT+wubN/on kK859O0i+njZ/KGOk6McVKFcHaFRncKlxEYeZWxvEJPYvEPgvvNHulemJhayThWCssOBdm jAOwX3d+0y2Y2aak+rPFNE0rX//F5OnfZN0XCdU35+bqBn6r2QnsqKmbikROvaMcSb7MK6 QCKqQR72pucE0Q8quFwutiaYmhFKGFuCt0n2WXGIk5MM8WeqlHmeFjNlJskuv1fo6JYRJf tIusrZEh/wL5wxTkhfXo6au6Oaqj8WytS2Ri8Hg5N3/YTBZLu+uDy9U2Zy3o/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717442696; a=rsa-sha256; cv=none; b=Nd02hujzmO/2BMuJdB6kSwg1keIFf9kStNgE/3PDmI8wuSKCYigWkbz+ZvPUhRWcfXfKUu BIOG5TPuTl84xaZxd0Lf7EErebuhqKnQ7rq6pZsgPUzgUSiYtb6mzLp2DADL54hMVwRjgw 3GLa0dEZkFRRnGv5u2XMpd/L4CnV940e5NCY3d7FdYb7CPIQRXDb7Lu01QglJ/P74u0hQq C/8tFsNbotjWubrnPOqYvTt84ft2SVTtyyiYd6mlvALxrKJ/+OZWB1gXAvyI1oSTADH2VW gVNEcd7bTkVEk9aKAsaq6xo0ae2iz34WjHDMZ9dPdVV0pNensGZpHH11h8J1rA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717442696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WAkRNPtZB9Tt5f774Umf1Fr1sEAWBup73eZK1rlHrmI=; b=F4hyjE7YmTZfYx7MRhLp8fqMsK0kxrg7o6wfokhxrFoo24B0HqSG4tLTOr0oRrv7hTKA9f vmP3zv7O9NTRrwlHLjLasMN5uZyhicL2Y7/6QzZqYzt3B32MbvGqzuG1S6robOhyWzwWsn H74w7+cJ6lzNVZz2tH8ZBaYVN8/pYcy4D4A672N3nQ3PnNKbtTJ9rT9pfmpZDwwps+nBWj Zyz+EYaeSf5LbagwhXiNKCXdhYqpxJUeyXRGhYKxHyFPLEPS/YqJEcsi1E6Atl+FRNgy1r Z36igxds/cXwDnHQ5bUeGOItsXgaDBGTT5Ez322JdW3RW6UMMrvOHXUBaTRhVA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VtNw857x1znf0; Mon, 3 Jun 2024 19:24:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 453JOuhm067686; Mon, 3 Jun 2024 19:24:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453JOuSn067683; Mon, 3 Jun 2024 19:24:56 GMT (envelope-from git) Date: Mon, 3 Jun 2024 19:24:56 GMT Message-Id: <202406031924.453JOuSn067683@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 9b5383c53eac - stable/14 - if_bnxt: Implementation of Extended Port Hardware Stats Support for THOR Controller List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9b5383c53eac5610c34c59fb77abeba77203b104 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9b5383c53eac5610c34c59fb77abeba77203b104 commit 9b5383c53eac5610c34c59fb77abeba77203b104 Author: Chandrakanth Patil AuthorDate: 2024-03-06 13:20:28 +0000 Commit: Warner Losh CommitDate: 2024-06-03 19:23:13 +0000 if_bnxt: Implementation of Extended Port Hardware Stats Support for THOR Controller The newly added port extended hardware statistics are now accessible to users through the sysctl interface. Also, Few obsolete stats are removed and few stats are renamed. Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D42957 (cherry picked from commit d36b36621a9c0f785ebea495c57e975b8a526b67) --- sys/dev/bnxt/bnxt.h | 20 +- sys/dev/bnxt/bnxt_hwrm.c | 28 ++- sys/dev/bnxt/bnxt_hwrm.h | 1 + sys/dev/bnxt/bnxt_sysctl.c | 457 +++++++++++++++++++++++++++++++----------- sys/dev/bnxt/hsi_struct_def.h | 2 +- sys/dev/bnxt/if_bnxt.c | 48 ++++- 6 files changed, 419 insertions(+), 137 deletions(-) diff --git a/sys/dev/bnxt/bnxt.h b/sys/dev/bnxt/bnxt.h index 73122f82c7ad..a5c607dbe247 100644 --- a/sys/dev/bnxt/bnxt.h +++ b/sys/dev/bnxt/bnxt.h @@ -671,13 +671,14 @@ struct bnxt_softc { struct bnxt_bar_info hwrm_bar; struct bnxt_bar_info doorbell_bar; struct bnxt_link_info link_info; -#define BNXT_FLAG_VF 0x0001 -#define BNXT_FLAG_NPAR 0x0002 -#define BNXT_FLAG_WOL_CAP 0x0004 -#define BNXT_FLAG_SHORT_CMD 0x0008 -#define BNXT_FLAG_FW_CAP_NEW_RM 0x0010 -#define BNXT_FLAG_CHIP_P5 0x0020 -#define BNXT_FLAG_TPA 0x0040 +#define BNXT_FLAG_VF 0x0001 +#define BNXT_FLAG_NPAR 0x0002 +#define BNXT_FLAG_WOL_CAP 0x0004 +#define BNXT_FLAG_SHORT_CMD 0x0008 +#define BNXT_FLAG_FW_CAP_NEW_RM 0x0010 +#define BNXT_FLAG_CHIP_P5 0x0020 +#define BNXT_FLAG_TPA 0x0040 +#define BNXT_FLAG_FW_CAP_EXT_STATS 0x0080 uint32_t flags; #define BNXT_STATE_LINK_CHANGE (0) #define BNXT_STATE_MAX (BNXT_STATE_LINK_CHANGE + 1) @@ -714,6 +715,11 @@ struct bnxt_softc { struct rx_port_stats *rx_port_stats; struct tx_port_stats *tx_port_stats; + struct iflib_dma_info hw_tx_port_stats_ext; + struct iflib_dma_info hw_rx_port_stats_ext; + struct tx_port_stats_ext *tx_port_stats_ext; + struct rx_port_stats_ext *rx_port_stats_ext; + int num_cp_rings; struct bnxt_cp_ring *nq_rings; diff --git a/sys/dev/bnxt/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_hwrm.c index 88ba185e2c27..38e6c0db670f 100644 --- a/sys/dev/bnxt/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_hwrm.c @@ -550,7 +550,7 @@ bnxt_hwrm_passthrough(struct bnxt_softc *softc, void *req, uint32_t req_len, input->resp_addr = htole64(softc->hwrm_cmd_resp.idi_paddr); BNXT_HWRM_LOCK(softc); old_timeo = softc->hwrm_cmd_timeo; - if (input->req_type == HWRM_NVM_INSTALL_UPDATE) + if (input->req_type == HWRM_NVM_INSTALL_UPDATE) softc->hwrm_cmd_timeo = BNXT_NVM_TIMEO; else softc->hwrm_cmd_timeo = max(app_timeout, softc->hwrm_cmd_timeo); @@ -694,7 +694,8 @@ bnxt_hwrm_ver_get(struct bnxt_softc *softc) softc->hwrm_cmd_timeo = le16toh(resp->def_req_timeout); if (!softc->hwrm_cmd_timeo) softc->hwrm_cmd_timeo = DFLT_HWRM_CMD_TIMEOUT; - + + dev_caps_cfg = le32toh(resp->dev_caps_cfg); if ((dev_caps_cfg & HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_SUPPORTED) && (dev_caps_cfg & HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_REQUIRED)) @@ -777,6 +778,9 @@ bnxt_hwrm_func_qcaps(struct bnxt_softc *softc) if (resp->flags & htole32(HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_MAGICPKT_SUPPORTED)) softc->flags |= BNXT_FLAG_WOL_CAP; + if (resp->flags & + htole32(HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_STATS_SUPPORTED)) + softc->flags |= BNXT_FLAG_FW_CAP_EXT_STATS; func->fw_fid = le16toh(resp->fid); memcpy(func->mac_addr, resp->mac_address, ETHER_ADDR_LEN); @@ -1408,6 +1412,26 @@ bnxt_hwrm_port_qstats(struct bnxt_softc *softc) return rc; } +void +bnxt_hwrm_port_qstats_ext(struct bnxt_softc *softc) +{ + struct hwrm_port_qstats_ext_input req = {0}; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_PORT_QSTATS_EXT); + + req.port_id = htole16(softc->pf.port_id); + req.tx_stat_size = htole16(sizeof(struct tx_port_stats_ext)); + req.rx_stat_size = htole16(sizeof(struct rx_port_stats_ext)); + req.rx_stat_host_addr = htole64(softc->hw_rx_port_stats_ext.idi_paddr); + req.tx_stat_host_addr = htole64(softc->hw_tx_port_stats_ext.idi_paddr); + + BNXT_HWRM_LOCK(softc); + _hwrm_send_message(softc, &req, sizeof(req)); + BNXT_HWRM_UNLOCK(softc); + + return; +} + int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic) diff --git a/sys/dev/bnxt/bnxt_hwrm.h b/sys/dev/bnxt/bnxt_hwrm.h index e016677707ce..6dd015a15d40 100644 --- a/sys/dev/bnxt/bnxt_hwrm.h +++ b/sys/dev/bnxt/bnxt_hwrm.h @@ -64,6 +64,7 @@ int bnxt_hwrm_stat_ctx_alloc(struct bnxt_softc *softc, struct bnxt_cp_ring *cpr, uint64_t paddr); int bnxt_hwrm_stat_ctx_free(struct bnxt_softc *softc, struct bnxt_cp_ring *cpr); int bnxt_hwrm_port_qstats(struct bnxt_softc *softc); +void bnxt_hwrm_port_qstats_ext(struct bnxt_softc *softc); int bnxt_hwrm_ring_grp_alloc(struct bnxt_softc *softc, struct bnxt_grp_info *grp); int bnxt_hwrm_ring_grp_free(struct bnxt_softc *softc, struct bnxt_grp_info *gr); diff --git a/sys/dev/bnxt/bnxt_sysctl.c b/sys/dev/bnxt/bnxt_sysctl.c index 5e92cf8bd756..f1a49ee51328 100644 --- a/sys/dev/bnxt/bnxt_sysctl.c +++ b/sys/dev/bnxt/bnxt_sysctl.c @@ -234,17 +234,17 @@ bnxt_create_port_stats_sysctls(struct bnxt_softc *softc) &softc->tx_port_stats->tx_512b_1023b_frames, "Transmitted 512b 1023b frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_1024b_1518_frames", CTLFLAG_RD, + "tx_1024b_1518b_frames", CTLFLAG_RD, &softc->tx_port_stats->tx_1024b_1518b_frames, - "Transmitted 1024b 1518 frames"); + "Transmitted 1024b 1518b frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "tx_good_vlan_frames", CTLFLAG_RD, &softc->tx_port_stats->tx_good_vlan_frames, "Transmitted good vlan frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_1519b_2047_frames", CTLFLAG_RD, + "tx_1519b_2047b_frames", CTLFLAG_RD, &softc->tx_port_stats->tx_1519b_2047b_frames, - "Transmitted 1519b 2047 frames"); + "Transmitted 1519b 2047b frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "tx_2048b_4095b_frames", CTLFLAG_RD, &softc->tx_port_stats->tx_2048b_4095b_frames, @@ -285,53 +285,9 @@ bnxt_create_port_stats_sysctls(struct bnxt_softc *softc) "tx_fcs_err_frames", CTLFLAG_RD, &softc->tx_port_stats->tx_fcs_err_frames, "Transmitted fcs err frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_control_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_control_frames, - "Transmitted control frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_oversz_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_oversz_frames, "Transmitted oversz frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_single_dfrl_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_single_dfrl_frames, - "Transmitted single dfrl frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_multi_dfrl_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_multi_dfrl_frames, - "Transmitted multi dfrl frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_single_coll_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_single_coll_frames, - "Transmitted single coll frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_multi_coll_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_multi_coll_frames, - "Transmitted multi coll frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_late_coll_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_late_coll_frames, - "Transmitted late coll frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_excessive_coll_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_excessive_coll_frames, - "Transmitted excessive coll frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_frag_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_frag_frames, "Transmitted frag frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "tx_err", CTLFLAG_RD, &softc->tx_port_stats->tx_err, "Transmitted err"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_tagged_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_tagged_frames, "Transmitted tagged frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_dbl_tagged_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_dbl_tagged_frames, - "Transmitted dbl tagged frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx_runt_frames", CTLFLAG_RD, - &softc->tx_port_stats->tx_runt_frames, "Transmitted runt frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "tx_fifo_underruns", CTLFLAG_RD, &softc->tx_port_stats->tx_fifo_underruns, @@ -418,7 +374,7 @@ bnxt_create_port_stats_sysctls(struct bnxt_softc *softc) &softc->rx_port_stats->rx_512b_1023b_frames, "Received 512b 1023b frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_1024b_1518_frames", CTLFLAG_RD, + "rx_1024b_1518b_frames", CTLFLAG_RD, &softc->rx_port_stats->rx_1024b_1518b_frames, "Received 1024b 1518 frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, @@ -465,34 +421,10 @@ bnxt_create_port_stats_sysctls(struct bnxt_softc *softc) SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "rx_pfc_frames", CTLFLAG_RD, &softc->rx_port_stats->rx_pfc_frames, "Received pfc frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_unsupported_opcode_frames", CTLFLAG_RD, - &softc->rx_port_stats->rx_unsupported_opcode_frames, - "Received unsupported opcode frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_unsupported_da_pausepfc_frames", CTLFLAG_RD, - &softc->rx_port_stats->rx_unsupported_da_pausepfc_frames, - "Received unsupported da pausepfc frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_wrong_sa_frames", CTLFLAG_RD, - &softc->rx_port_stats->rx_wrong_sa_frames, - "Received wrong sa frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "rx_align_err_frames", CTLFLAG_RD, &softc->rx_port_stats->rx_align_err_frames, "Received align err frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_oor_len_frames", CTLFLAG_RD, - &softc->rx_port_stats->rx_oor_len_frames, - "Received oor len frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_code_err_frames", CTLFLAG_RD, - &softc->rx_port_stats->rx_code_err_frames, - "Received code err frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_false_carrier_frames", CTLFLAG_RD, - &softc->rx_port_stats->rx_false_carrier_frames, - "Received false carrier frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "rx_ovrsz_frames", CTLFLAG_RD, &softc->rx_port_stats->rx_ovrsz_frames, @@ -505,14 +437,6 @@ bnxt_create_port_stats_sysctls(struct bnxt_softc *softc) "rx_mtu_err_frames", CTLFLAG_RD, &softc->rx_port_stats->rx_mtu_err_frames, "Received mtu err frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_match_crc_frames", CTLFLAG_RD, - &softc->rx_port_stats->rx_match_crc_frames, - "Received match crc frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_promiscuous_frames", CTLFLAG_RD, - &softc->rx_port_stats->rx_promiscuous_frames, - "Received promiscuous frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "rx_tagged_frames", CTLFLAG_RD, &softc->rx_port_stats->rx_tagged_frames, @@ -521,46 +445,10 @@ bnxt_create_port_stats_sysctls(struct bnxt_softc *softc) "rx_double_tagged_frames", CTLFLAG_RD, &softc->rx_port_stats->rx_double_tagged_frames, "Received double tagged frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_trunc_frames", CTLFLAG_RD, - &softc->rx_port_stats->rx_trunc_frames, - "Received trunc frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "rx_good_frames", CTLFLAG_RD, &softc->rx_port_stats->rx_good_frames, "Received good frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_pfc_xon2xoff_frames_pri0", CTLFLAG_RD, - &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri0, - "Received pfc xon2xoff frames pri0"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_pfc_xon2xoff_frames_pri1", CTLFLAG_RD, - &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri1, - "Received pfc xon2xoff frames pri1"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_pfc_xon2xoff_frames_pri2", CTLFLAG_RD, - &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri2, - "Received pfc xon2xoff frames pri2"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_pfc_xon2xoff_frames_pri3", CTLFLAG_RD, - &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri3, - "Received pfc xon2xoff frames pri3"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_pfc_xon2xoff_frames_pri4", CTLFLAG_RD, - &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri4, - "Received pfc xon2xoff frames pri4"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_pfc_xon2xoff_frames_pri5", CTLFLAG_RD, - &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri5, - "Received pfc xon2xoff frames pri5"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_pfc_xon2xoff_frames_pri6", CTLFLAG_RD, - &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri6, - "Received pfc xon2xoff frames pri6"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_pfc_xon2xoff_frames_pri7", CTLFLAG_RD, - &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri7, - "Received pfc xon2xoff frames pri7"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "rx_pfc_ena_frames_pri0", CTLFLAG_RD, &softc->rx_port_stats->rx_pfc_ena_frames_pri0, @@ -600,9 +488,6 @@ bnxt_create_port_stats_sysctls(struct bnxt_softc *softc) SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "rx_undrsz_frames", CTLFLAG_RD, &softc->rx_port_stats->rx_undrsz_frames, "Received undrsz frames"); - SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx_frag_frames", CTLFLAG_RD, - &softc->rx_port_stats->rx_frag_frames, "Received frag frames"); SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, "rx_eee_lpi_events", CTLFLAG_RD, &softc->rx_port_stats->rx_eee_lpi_events, "Received eee lpi events"); @@ -645,6 +530,338 @@ bnxt_create_port_stats_sysctls(struct bnxt_softc *softc) "rx_stat_err", CTLFLAG_RD, &softc->rx_port_stats->rx_stat_err, "Received stat err"); + if (BNXT_CHIP_P5(softc) && + (softc->flags & BNXT_FLAG_FW_CAP_EXT_STATS)) { + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_cos0", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_bytes_cos0, "Transmitted bytes count cos0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_cos0", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_packets_cos0, "Transmitted packets count cos0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_cos1", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_bytes_cos1, "Transmitted bytes count cos1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_cos1", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_packets_cos1, "Transmitted packets count cos1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_cos2", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_bytes_cos2, "Transmitted bytes count cos2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_cos2", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_packets_cos2, "Transmitted packets count cos2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_cos3", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_bytes_cos3, "Transmitted bytes count cos3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_cos3", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_packets_cos3, "Transmitted packets count cos3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_cos4", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_bytes_cos4, "Transmitted bytes count cos4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_cos4", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_packets_cos4, "Transmitted packets count cos4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_cos5", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_bytes_cos5, "Transmitted bytes count cos5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_cos5", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_packets_cos5, "Transmitted packets count cos5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_cos6", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_bytes_cos6, "Transmitted bytes count cos6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_cos6", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_packets_cos6, "Transmitted packets count cos6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_bytes_cos7", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_bytes_cos7, "Transmitted bytes count cos7"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_packets_cos7", CTLFLAG_RD, + &softc->tx_port_stats_ext->tx_packets_cos7, "Transmitted packets count cos7"); + + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri0_tx_duration_us", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri0_tx_duration_us, "Time duration between" + "XON to XOFF and XOFF to XON for pri0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri0_tx_transitions", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri0_tx_transitions, "Num times transition" + "between XON to XOFF and XOFF to XON for pri0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri1_tx_duration_us", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri1_tx_duration_us, "Time duration between" + "XON to XOFF and XOFF to XON for pri1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri1_tx_transitions", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri1_tx_transitions, "Num times transition" + "between XON to XOFF and XOFF to XON for pri1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri2_tx_duration_us", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri2_tx_duration_us, "Time duration between" + "XON to XOFF and XOFF to XON for pri2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri2_tx_transitions", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri2_tx_transitions, "Num times transition" + "between XON to XOFF and XOFF to XON for pri2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri3_tx_duration_us", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri3_tx_duration_us, "Time duration between" + "XON to XOFF and XOFF to XON for pri3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri3_tx_transitions", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri3_tx_transitions, "Num times transition" + "between XON to XOFF and XOFF to XON for pri3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri4_tx_duration_us", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri4_tx_duration_us, "Time duration between" + "XON to XOFF and XOFF to XON for pri4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri4_tx_transitions", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri4_tx_transitions, "Num times transition" + "between XON to XOFF and XOFF to XON for pri4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri5_tx_duration_us", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri5_tx_duration_us, "Time duration between" + "XON to XOFF and XOFF to XON for pri5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri5_tx_transitions", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri5_tx_transitions, "Num times transition" + "between XON to XOFF and XOFF to XON for pri5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri6_tx_duration_us", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri6_tx_duration_us, "Time duration between" + "XON to XOFF and XOFF to XON for pri6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri6_tx_transitions", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri6_tx_transitions, "Num times transition" + "between XON to XOFF and XOFF to XON for pri6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri7_tx_duration_us", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri7_tx_duration_us, "Time duration between" + "XON to XOFF and XOFF to XON for pri7"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri7_tx_transitions", CTLFLAG_RD, + &softc->tx_port_stats_ext->pfc_pri7_tx_transitions, "Num times transition" + "between XON to XOFF and XOFF to XON for pri7"); + + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "link_down_events", CTLFLAG_RD, + &softc->rx_port_stats_ext->link_down_events, "Num times link states down"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "continuous_pause_events", CTLFLAG_RD, + &softc->rx_port_stats_ext->continuous_pause_events, "Num times pause events"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "resume_pause_events", CTLFLAG_RD, + &softc->rx_port_stats_ext->resume_pause_events, "Num times pause events" + "resumes"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "continuous_roce_pause_events", CTLFLAG_RD, + &softc->rx_port_stats_ext->continuous_roce_pause_events, "Num times roce" + "pause events"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "resume_roce_pause_events", CTLFLAG_RD, + &softc->rx_port_stats_ext->resume_roce_pause_events, "Num times roce pause" + "events resumes"); + + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_cos0", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_bytes_cos0, "Received bytes count cos0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_cos0", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_packets_cos0, "Received packets count cos0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_cos1", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_bytes_cos1, "Received bytes count cos1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_cos1", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_packets_cos1, "Received packets count cos1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_cos2", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_bytes_cos2, "Received bytes count cos2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_cos2", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_packets_cos2, "Received packets count cos2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_cos3", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_bytes_cos3, "Received bytes count cos3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_cos3", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_packets_cos3, "Received packets count cos3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_cos4", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_bytes_cos4, "Received bytes count cos4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_cos4", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_packets_cos4, "Received packets count cos4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_cos5", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_bytes_cos5, "Received bytes count cos5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_cos5", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_packets_cos5, "Received packets count cos5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_cos6", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_bytes_cos6, "Received bytes count cos6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_cos6", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_packets_cos6, "Received packets count cos6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bytes_cos7", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_bytes_cos7, "Received bytes count cos7"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_packets_cos7", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_packets_cos7, "Received packets count cos7"); + + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri0_rx_duration_us", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri0_rx_duration_us, "Time duration in receiving" + "between XON to XOFF and XOFF to XON for pri0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri0_rx_transitions", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri0_rx_transitions, "Num times rx transition" + "between XON to XOFF and XOFF to XON for pri0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri1_rx_duration_us", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri1_rx_duration_us, "Time duration in receiving" + "between XON to XOFF and XOFF to XON for pri1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri1_rx_transitions", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri1_rx_transitions, "Num times rx transition" + "between XON to XOFF and XOFF to XON for pri1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri2_rx_duration_us", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri2_rx_duration_us, "Time duration in receiving" + "between XON to XOFF and XOFF to XON for pri2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri2_rx_transitions", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri2_rx_transitions, "Num times rx transition" + "between XON to XOFF and XOFF to XON for pri2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri3_rx_duration_us", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri3_rx_duration_us, "Time duration in receiving" + "between XON to XOFF and XOFF to XON for pri3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri3_rx_transitions", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri3_rx_transitions, "Num times rx transition" + "between XON to XOFF and XOFF to XON for pri3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri4_rx_duration_us", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri4_rx_duration_us, "Time duration in receiving" + "between XON to XOFF and XOFF to XON for pri4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri4_rx_transitions", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri4_rx_transitions, "Num times rx transition" + "between XON to XOFF and XOFF to XON for pri4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri5_rx_duration_us", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri5_rx_duration_us, "Time duration in receiving" + "between XON to XOFF and XOFF to XON for pri5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri5_rx_transitions", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri5_rx_transitions, "Num times rx transition" + "between XON to XOFF and XOFF to XON for pri5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri6_rx_duration_us", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri6_rx_duration_us, "Time duration in receiving" + "between XON to XOFF and XOFF to XON for pri6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri6_rx_transitions", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri6_rx_transitions, "Num times rx transition" + "between XON to XOFF and XOFF to XON for pri6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri7_rx_duration_us", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri7_rx_duration_us, "Time duration in receiving" + "between XON to XOFF and XOFF to XON for pri7"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "pfc_pri7_rx_transitions", CTLFLAG_RD, + &softc->rx_port_stats_ext->pfc_pri7_rx_transitions, "Num times rx transition" + "between XON to XOFF and XOFF to XON for pri7"); + + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_bits", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_bits, "total number of received bits"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_buffer_passed_threshold", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_buffer_passed_threshold, "num of events port" + "buffer" + "was over 85%"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_pcs_symbol_err", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_pcs_symbol_err, "num of symbol errors wasn't" + "corrected by FEC"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_corrected_bits", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_corrected_bits, "num of bits corrected by FEC"); + + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_bytes_cos0", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_bytes_cos0, "num of rx discard bytes" + "count on cos0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_packets_cos0", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_packets_cos0, "num of rx discard packets" + "count on cos0"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_bytes_cos1", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_bytes_cos1, "num of rx discard bytes" + "count on cos1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_packets_cos1", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_packets_cos1, "num of rx discard packets" + "count on cos1"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_bytes_cos2", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_bytes_cos2, "num of rx discard bytes" + "count on cos2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_packets_cos2", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_packets_cos2, "num of rx discard packets" + "count on cos2"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_bytes_cos3", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_bytes_cos3, "num of rx discard bytes" + "count on cos3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_packets_cos3", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_packets_cos3, "num of rx discard packets" + "count on cos3"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_bytes_cos4", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_bytes_cos4, "num of rx discard bytes" + "count on cos4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_packets_cos4", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_packets_cos4, "num of rx discard packets" + "count on cos4"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_bytes_cos5", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_bytes_cos5, "num of rx discard bytes" + "count on cos5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_packets_cos5", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_packets_cos5, "num of rx discard packets" + "count on cos5"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_bytes_cos6", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_bytes_cos6, "num of rx discard bytes" + "count on cos6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_packets_cos6", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_packets_cos6, "num of rx discard packets" + "count on cos6"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_bytes_cos7", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_bytes_cos7, "num of rx discard bytes" + "count on cos7"); + SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_discard_packets_cos7", CTLFLAG_RD, + &softc->rx_port_stats_ext->rx_discard_packets_cos7, "num of rx discard packets" + "count on cos7"); + } + + return 0; } diff --git a/sys/dev/bnxt/hsi_struct_def.h b/sys/dev/bnxt/hsi_struct_def.h index d2097ca1ca33..12b112c42ca7 100644 --- a/sys/dev/bnxt/hsi_struct_def.h +++ b/sys/dev/bnxt/hsi_struct_def.h @@ -800,7 +800,7 @@ typedef struct cmd_nums { #define HWRM_FUNC_VLAN_QCFG UINT32_C(0x34) #define HWRM_QUEUE_PFCENABLE_QCFG UINT32_C(0x35) #define HWRM_QUEUE_PFCENABLE_CFG UINT32_C(0x36) - #define HWRM_QUEUE_PRI2COS_QCFG UINT32_C(0x37) + #define HWRM_QUEUE_PRI2COS_QCFG UINT32_C(0x37) #define HWRM_QUEUE_PRI2COS_CFG UINT32_C(0x38) #define HWRM_QUEUE_COS2BW_QCFG UINT32_C(0x39) #define HWRM_QUEUE_COS2BW_CFG UINT32_C(0x3a) diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index 872ffbb21e82..0de1ffe78db1 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -500,6 +500,8 @@ bnxt_queues_free(if_ctx_t ctx) iflib_dma_free(&softc->rx_stats[i]); iflib_dma_free(&softc->hw_tx_port_stats); iflib_dma_free(&softc->hw_rx_port_stats); + iflib_dma_free(&softc->hw_tx_port_stats_ext); + iflib_dma_free(&softc->hw_rx_port_stats_ext); free(softc->grp_info, M_DEVBUF); free(softc->ag_rings, M_DEVBUF); free(softc->rx_rings, M_DEVBUF); @@ -574,9 +576,9 @@ bnxt_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, bus_dmamap_sync(softc->hw_rx_port_stats.idi_tag, softc->hw_rx_port_stats.idi_map, BUS_DMASYNC_PREREAD); + rc = iflib_dma_alloc(ctx, sizeof(struct tx_port_stats) + BNXT_PORT_STAT_PADDING, &softc->hw_tx_port_stats, 0); - if (rc) goto hw_port_tx_stats_alloc_fail; @@ -586,6 +588,26 @@ bnxt_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, softc->rx_port_stats = (void *) softc->hw_rx_port_stats.idi_vaddr; softc->tx_port_stats = (void *) softc->hw_tx_port_stats.idi_vaddr; + + rc = iflib_dma_alloc(ctx, sizeof(struct rx_port_stats_ext), + &softc->hw_rx_port_stats_ext, 0); + if (rc) + goto hw_port_rx_stats_ext_alloc_fail; + + bus_dmamap_sync(softc->hw_rx_port_stats_ext.idi_tag, + softc->hw_rx_port_stats_ext.idi_map, BUS_DMASYNC_PREREAD); + + rc = iflib_dma_alloc(ctx, sizeof(struct tx_port_stats_ext), + &softc->hw_tx_port_stats_ext, 0); + if (rc) + goto hw_port_tx_stats_ext_alloc_fail; + + bus_dmamap_sync(softc->hw_tx_port_stats_ext.idi_tag, + softc->hw_tx_port_stats_ext.idi_map, BUS_DMASYNC_PREREAD); + + softc->rx_port_stats_ext = (void *) softc->hw_rx_port_stats_ext.idi_vaddr; + softc->tx_port_stats_ext = (void *) softc->hw_tx_port_stats_ext.idi_vaddr; + for (i = 0; i < nrxqsets; i++) { /* Allocation the completion ring */ softc->rx_cp_rings[i].stats_ctx_id = HWRM_NA_SIGNATURE; @@ -654,7 +676,7 @@ bnxt_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, * HWRM every sec with which firmware timeouts can happen */ if (BNXT_PF(softc)) - bnxt_create_port_stats_sysctls(softc); + bnxt_create_port_stats_sysctls(softc); /* And finally, the VNIC */ softc->vnic_info.id = (uint16_t)HWRM_NA_SIGNATURE; @@ -700,16 +722,24 @@ rss_grp_alloc_fail: iflib_dma_free(&softc->vnic_info.rss_hash_key_tbl); rss_hash_alloc_fail: iflib_dma_free(&softc->vnic_info.mc_list); -tpa_alloc_fail: mc_list_alloc_fail: - for (i = i - 1; i >= 0; i--) - free(softc->rx_rings[i].tpa_start, M_DEVBUF); + for (i = i - 1; i >= 0; i--) { + if (softc->rx_rings[i].tpa_start) + free(softc->rx_rings[i].tpa_start, M_DEVBUF); + } +tpa_alloc_fail: + iflib_dma_free(&softc->hw_tx_port_stats_ext); +hw_port_tx_stats_ext_alloc_fail: + iflib_dma_free(&softc->hw_rx_port_stats_ext); +hw_port_rx_stats_ext_alloc_fail: iflib_dma_free(&softc->hw_tx_port_stats); hw_port_tx_stats_alloc_fail: iflib_dma_free(&softc->hw_rx_port_stats); hw_port_rx_stats_alloc_fail: - for (i = i - 1; i >= 0; i--) - iflib_dma_free(&softc->rx_stats[i]); + for (i=0; i < nrxqsets; i++) { + if (softc->rx_stats[i].idi_vaddr) + iflib_dma_free(&softc->rx_stats[i]); + } hw_stats_alloc_fail: free(softc->grp_info, M_DEVBUF); grp_alloc_fail: @@ -2208,6 +2238,10 @@ bnxt_update_admin_status(if_ctx_t ctx) bnxt_hwrm_port_qstats(softc); + if (BNXT_CHIP_P5(softc) && + (softc->flags & BNXT_FLAG_FW_CAP_EXT_STATS)) + bnxt_hwrm_port_qstats_ext(softc); + if (BNXT_CHIP_P5(softc)) { struct ifmediareq ifmr;