get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/44154/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 44154,
    "url": "http://patches.dpdk.org/api/patches/44154/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180901043254.51000-6-ajit.khaparde@broadcom.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20180901043254.51000-6-ajit.khaparde@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180901043254.51000-6-ajit.khaparde@broadcom.com",
    "date": "2018-09-01T04:32:52",
    "name": "[5/7] net/bnxt: add support for extended port counters",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "c28911e1a0f838bb329b29196aa323804d512ab8",
    "submitter": {
        "id": 501,
        "url": "http://patches.dpdk.org/api/people/501/?format=api",
        "name": "Ajit Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20180901043254.51000-6-ajit.khaparde@broadcom.com/mbox/",
    "series": [
        {
            "id": 1150,
            "url": "http://patches.dpdk.org/api/series/1150/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1150",
            "date": "2018-09-01T04:32:47",
            "name": "bnxt patchset",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/1150/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/44154/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/44154/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 050635F11;\n\tSat,  1 Sep 2018 06:33:11 +0200 (CEST)",
            "from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com\n\t[192.19.229.170]) by dpdk.org (Postfix) with ESMTP id 59B8B58FA\n\tfor <dev@dpdk.org>; Sat,  1 Sep 2018 06:33:07 +0200 (CEST)",
            "from nis-sj1-27.broadcom.com (nis-sj1-27.lvn.broadcom.net\n\t[10.75.144.136])\n\tby rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 0B89230C037;\n\tFri, 31 Aug 2018 21:33:05 -0700 (PDT)",
            "from C02VPB22HTD6.vpn.broadcom.net (unknown [10.10.117.252])\n\tby nis-sj1-27.broadcom.com (Postfix) with ESMTP id 59293AC0766;\n\tFri, 31 Aug 2018 21:33:05 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 0B89230C037",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n\ts=dkimrelay; t=1535776385;\n\tbh=PPKZTFwbzNt3tay7PvgxefJGRzjNsPvBY4JOR0/M/wY=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=EXi8sJM0WQosAyZNqTn/gua0mxcTLy8c+XaWOF1xwYFHDe+VQ/fkyxUu2ORgFd0+h\n\tENZVJIesPuh3vFg+bsvehA6J8Y/6KGU9HRk5/m7hcz0epSD+7xawVZHGYqBNQ1Rdqh\n\tRriL+T82nzCtw5L3FhRo2GJzmbH53iN/fRKEzHH4=",
        "From": "Ajit Khaparde <ajit.khaparde@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com",
        "Date": "Fri, 31 Aug 2018 21:32:52 -0700",
        "Message-Id": "<20180901043254.51000-6-ajit.khaparde@broadcom.com>",
        "X-Mailer": "git-send-email 2.15.2 (Apple Git-101.1)",
        "In-Reply-To": "<20180901043254.51000-1-ajit.khaparde@broadcom.com>",
        "References": "<20180901043254.51000-1-ajit.khaparde@broadcom.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 5/7] net/bnxt: add support for extended port\n\tcounters",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This patch adds support extended port statistics like COS bytes,\npackets, XON -> XOFF and XOFF -> XON transitions in Tx and Rx path.\n\nSigned-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>\n---\n drivers/net/bnxt/bnxt.h        |   8 ++\n drivers/net/bnxt/bnxt_ethdev.c |  30 +++++-\n drivers/net/bnxt/bnxt_hwrm.c   |  44 +++++++++\n drivers/net/bnxt/bnxt_hwrm.h   |   5 +\n drivers/net/bnxt/bnxt_stats.c  | 209 ++++++++++++++++++++++++++++++++++++++++-\n 5 files changed, 289 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h\nindex 8218635d6..c163d0f18 100644\n--- a/drivers/net/bnxt/bnxt.h\n+++ b/drivers/net/bnxt/bnxt.h\n@@ -250,6 +250,8 @@ struct bnxt {\n #define BNXT_FLAG_UPDATE_HASH\t(1 << 5)\n #define BNXT_FLAG_PTP_SUPPORTED\t(1 << 6)\n #define BNXT_FLAG_MULTI_HOST    (1 << 7)\n+#define BNXT_FLAG_EXT_RX_PORT_STATS\t(1 << 8)\n+#define BNXT_FLAG_EXT_TX_PORT_STATS\t(1 << 9)\n #define BNXT_FLAG_NEW_RM\t(1 << 30)\n #define BNXT_FLAG_INIT_DONE\t(1 << 31)\n #define BNXT_PF(bp)\t\t(!((bp)->flags & BNXT_FLAG_VF))\n@@ -264,6 +266,9 @@ struct bnxt {\n \tconst void\t\t*rx_mem_zone;\n \tstruct rx_port_stats    *hw_rx_port_stats;\n \trte_iova_t\t\thw_rx_port_stats_map;\n+\tstruct rx_port_stats_ext    *hw_rx_port_stats_ext;\n+\trte_iova_t\t\thw_rx_port_stats_ext_map;\n+\tuint16_t\t\tfw_rx_port_stats_ext_size;\n \n \tunsigned int\t\ttx_nr_rings;\n \tunsigned int\t\ttx_cp_nr_rings;\n@@ -271,6 +276,9 @@ struct bnxt {\n \tconst void\t\t*tx_mem_zone;\n \tstruct tx_port_stats    *hw_tx_port_stats;\n \trte_iova_t\t\thw_tx_port_stats_map;\n+\tstruct tx_port_stats_ext    *hw_tx_port_stats_ext;\n+\trte_iova_t\t\thw_tx_port_stats_ext_map;\n+\tuint16_t\t\tfw_tx_port_stats_ext_size;\n \n \t/* Default completion ring */\n \tstruct bnxt_cp_ring_info\t*def_cp_ring;\ndiff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c\nindex cae9deea5..328cb88b0 100644\n--- a/drivers/net/bnxt/bnxt_ethdev.c\n+++ b/drivers/net/bnxt/bnxt_ethdev.c\n@@ -3221,7 +3221,9 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)\n \t\tmz_name[RTE_MEMZONE_NAMESIZE - 1] = 0;\n \t\tmz = rte_memzone_lookup(mz_name);\n \t\ttotal_alloc_len = RTE_CACHE_LINE_ROUNDUP(\n-\t\t\t\tsizeof(struct rx_port_stats) + 512);\n+\t\t\t\t\tsizeof(struct rx_port_stats) +\n+\t\t\t\t\tsizeof(struct rx_port_stats_ext) +\n+\t\t\t\t\t512);\n \t\tif (!mz) {\n \t\t\tmz = rte_memzone_reserve(mz_name, total_alloc_len,\n \t\t\t\t\tSOCKET_ID_ANY,\n@@ -3257,7 +3259,9 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)\n \t\tmz_name[RTE_MEMZONE_NAMESIZE - 1] = 0;\n \t\tmz = rte_memzone_lookup(mz_name);\n \t\ttotal_alloc_len = RTE_CACHE_LINE_ROUNDUP(\n-\t\t\t\tsizeof(struct tx_port_stats) + 512);\n+\t\t\t\t\tsizeof(struct tx_port_stats) +\n+\t\t\t\t\tsizeof(struct tx_port_stats_ext) +\n+\t\t\t\t\t512);\n \t\tif (!mz) {\n \t\t\tmz = rte_memzone_reserve(mz_name,\n \t\t\t\t\ttotal_alloc_len,\n@@ -3288,8 +3292,30 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)\n \t\tbp->hw_tx_port_stats_map = mz_phys_addr;\n \n \t\tbp->flags |= BNXT_FLAG_PORT_STATS;\n+\n+\t\t/* Display extended statistics if FW supports it */\n+\t\tif (bp->hwrm_spec_code < HWRM_SPEC_CODE_1_8_4 ||\n+\t\t    bp->hwrm_spec_code == HWRM_SPEC_CODE_1_9_0)\n+\t\t\tgoto skip_ext_stats;\n+\n+\t\tbp->hw_rx_port_stats_ext = (void *)\n+\t\t\t(bp->hw_rx_port_stats + sizeof(struct rx_port_stats));\n+\t\tbp->hw_rx_port_stats_ext_map = bp->hw_rx_port_stats_map +\n+\t\t\tsizeof(struct rx_port_stats);\n+\t\tbp->flags |= BNXT_FLAG_EXT_RX_PORT_STATS;\n+\n+\n+\t\tif (bp->hwrm_spec_code < HWRM_SPEC_CODE_1_9_2) {\n+\t\t\tbp->hw_tx_port_stats_ext = (void *)\n+\t\t\t(bp->hw_tx_port_stats + sizeof(struct tx_port_stats));\n+\t\t\tbp->hw_tx_port_stats_ext_map =\n+\t\t\t\tbp->hw_tx_port_stats_map +\n+\t\t\t\tsizeof(struct tx_port_stats);\n+\t\t\tbp->flags |= BNXT_FLAG_EXT_TX_PORT_STATS;\n+\t\t}\n \t}\n \n+skip_ext_stats:\n \trc = bnxt_alloc_hwrm_resources(bp);\n \tif (rc) {\n \t\tPMD_DRV_LOG(ERR,\ndiff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c\nindex c682488ae..99ecdae03 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.c\n+++ b/drivers/net/bnxt/bnxt_hwrm.c\n@@ -3945,3 +3945,47 @@ int bnxt_hwrm_set_ring_coal(struct bnxt *bp,\n \tHWRM_UNLOCK();\n \treturn 0;\n }\n+\n+int bnxt_hwrm_ext_port_qstats(struct bnxt *bp)\n+{\n+\tstruct hwrm_port_qstats_ext_input req = {0};\n+\tstruct hwrm_port_qstats_ext_output *resp = bp->hwrm_cmd_resp_addr;\n+\tstruct bnxt_pf_info *pf = &bp->pf;\n+\tint rc;\n+\n+\tif (!(bp->flags & BNXT_FLAG_EXT_RX_PORT_STATS ||\n+\t      bp->flags & BNXT_FLAG_EXT_TX_PORT_STATS))\n+\t\treturn 0;\n+\n+\tHWRM_PREP(req, PORT_QSTATS_EXT);\n+\n+\treq.port_id = rte_cpu_to_le_16(pf->port_id);\n+\tif (bp->flags & BNXT_FLAG_EXT_TX_PORT_STATS) {\n+\t\treq.tx_stat_host_addr =\n+\t\t\trte_cpu_to_le_64(bp->hw_tx_port_stats_map);\n+\t\treq.tx_stat_size =\n+\t\t\trte_cpu_to_le_16(sizeof(struct tx_port_stats_ext));\n+\t}\n+\tif (bp->flags & BNXT_FLAG_EXT_RX_PORT_STATS) {\n+\t\treq.rx_stat_host_addr =\n+\t\t\trte_cpu_to_le_64(bp->hw_rx_port_stats_map);\n+\t\treq.rx_stat_size =\n+\t\t\trte_cpu_to_le_16(sizeof(struct rx_port_stats_ext));\n+\t}\n+\trc = bnxt_hwrm_send_message(bp, &req, sizeof(req));\n+\n+\tif (rc) {\n+\t\tbp->fw_rx_port_stats_ext_size = 0;\n+\t\tbp->fw_tx_port_stats_ext_size = 0;\n+\t} else {\n+\t\tbp->fw_rx_port_stats_ext_size =\n+\t\t\trte_le_to_cpu_16(resp->rx_stat_size);\n+\t\tbp->fw_tx_port_stats_ext_size =\n+\t\t\trte_le_to_cpu_16(resp->tx_stat_size);\n+\t}\n+\n+\tHWRM_CHECK_RESULT();\n+\tHWRM_UNLOCK();\n+\n+\treturn rc;\n+}\ndiff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h\nindex 379aac6e1..ec9b3e007 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.h\n+++ b/drivers/net/bnxt/bnxt_hwrm.h\n@@ -32,6 +32,10 @@ struct bnxt_cp_ring_info;\n #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESV_STRATEGY_MINIMAL_STATIC \\\n \tHWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC\n \n+#define HWRM_SPEC_CODE_1_8_4\t\t0x10804\n+#define HWRM_SPEC_CODE_1_9_0\t\t0x10900\n+#define HWRM_SPEC_CODE_1_9_2\t\t0x10902\n+\n int bnxt_hwrm_cfa_l2_clear_rx_mask(struct bnxt *bp,\n \t\t\t\t   struct bnxt_vnic_info *vnic);\n int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt *bp, struct bnxt_vnic_info *vnic,\n@@ -174,4 +178,5 @@ int bnxt_vnic_rss_configure(struct bnxt *bp,\n int bnxt_hwrm_set_ring_coal(struct bnxt *bp,\n \t\t\tstruct bnxt_coal *coal, uint16_t ring_id);\n int bnxt_hwrm_check_vf_rings(struct bnxt *bp);\n+int bnxt_hwrm_ext_port_qstats(struct bnxt *bp);\n #endif\ndiff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c\nindex f7e6ce4b2..c16bf99da 100644\n--- a/drivers/net/bnxt/bnxt_stats.c\n+++ b/drivers/net/bnxt/bnxt_stats.c\n@@ -180,6 +180,150 @@ static const struct bnxt_xstats_name_off bnxt_func_stats_strings[] = {\n \t\t\t\trx_agg_aborts)},\n };\n \n+static const struct bnxt_xstats_name_off bnxt_rx_ext_stats_strings[] = {\n+\t{\"link_down_events\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\tlink_down_events)},\n+\t{\"continuous_pause_events\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\tcontinuous_pause_events)},\n+\t{\"resume_pause_events\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\tresume_pause_events)},\n+\t{\"continuous_roce_pause_events\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\tcontinuous_roce_pause_events)},\n+\t{\"resume_roce_pause_events\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\tresume_roce_pause_events)},\n+\t{\"rx_bytes_cos0\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\trx_bytes_cos0)},\n+\t{\"rx_bytes_cos1\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\trx_bytes_cos1)},\n+\t{\"rx_bytes_cos2\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\trx_bytes_cos2)},\n+\t{\"rx_bytes_cos3\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\trx_bytes_cos3)},\n+\t{\"rx_bytes_cos4\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\trx_bytes_cos4)},\n+\t{\"rx_bytes_cos5\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\trx_bytes_cos5)},\n+\t{\"rx_bytes_cos6\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\trx_bytes_cos6)},\n+\t{\"rx_bytes_cos7\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\trx_bytes_cos7)},\n+\t{\"rx_packets_cos0\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\trx_packets_cos0)},\n+\t{\"rx_packets_cos1\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\trx_packets_cos1)},\n+\t{\"rx_packets_cos2\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\trx_packets_cos2)},\n+\t{\"rx_packets_cos3\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\trx_packets_cos3)},\n+\t{\"rx_packets_cos4\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\trx_packets_cos4)},\n+\t{\"rx_packets_cos5\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\trx_packets_cos5)},\n+\t{\"rx_packets_cos6\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\trx_packets_cos6)},\n+\t{\"rx_packets_cos7\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\trx_packets_cos7)},\n+\t{\"pfc_pri0_rx_duration_us\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\tpfc_pri0_rx_duration_us)},\n+\t{\"pfc_pri0_rx_transitions\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\tpfc_pri0_rx_transitions)},\n+\t{\"pfc_pri1_rx_duration_us\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\tpfc_pri1_rx_duration_us)},\n+\t{\"pfc_pri1_rx_transitions\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\tpfc_pri1_rx_transitions)},\n+\t{\"pfc_pri2_rx_duration_us\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\tpfc_pri2_rx_duration_us)},\n+\t{\"pfc_pri2_rx_transitions\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\tpfc_pri2_rx_transitions)},\n+\t{\"pfc_pri3_rx_duration_us\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\tpfc_pri3_rx_duration_us)},\n+\t{\"pfc_pri3_rx_transitions\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\tpfc_pri3_rx_transitions)},\n+\t{\"pfc_pri4_rx_duration_us\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\tpfc_pri4_rx_duration_us)},\n+\t{\"pfc_pri4_rx_transitions\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\tpfc_pri4_rx_transitions)},\n+\t{\"pfc_pri5_rx_duration_us\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\tpfc_pri5_rx_duration_us)},\n+\t{\"pfc_pri5_rx_transitions\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\tpfc_pri5_rx_transitions)},\n+\t{\"pfc_pri6_rx_duration_us\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\tpfc_pri6_rx_duration_us)},\n+\t{\"pfc_pri6_rx_transitions\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\tpfc_pri6_rx_transitions)},\n+\t{\"pfc_pri7_rx_duration_us\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\tpfc_pri7_rx_duration_us)},\n+\t{\"pfc_pri7_rx_transitions\", offsetof(struct rx_port_stats_ext,\n+\t\t\t\tpfc_pri7_rx_transitions)},\n+};\n+\n+static const struct bnxt_xstats_name_off bnxt_tx_ext_stats_strings[] = {\n+\t{\"tx_bytes_cos0\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\ttx_bytes_cos0)},\n+\t{\"tx_bytes_cos1\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\ttx_bytes_cos1)},\n+\t{\"tx_bytes_cos2\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\ttx_bytes_cos2)},\n+\t{\"tx_bytes_cos3\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\ttx_bytes_cos3)},\n+\t{\"tx_bytes_cos4\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\ttx_bytes_cos4)},\n+\t{\"tx_bytes_cos5\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\ttx_bytes_cos5)},\n+\t{\"tx_bytes_cos6\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\ttx_bytes_cos6)},\n+\t{\"tx_bytes_cos7\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\ttx_bytes_cos7)},\n+\t{\"tx_packets_cos0\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\ttx_packets_cos0)},\n+\t{\"tx_packets_cos1\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\ttx_packets_cos1)},\n+\t{\"tx_packets_cos2\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\ttx_packets_cos2)},\n+\t{\"tx_packets_cos3\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\ttx_packets_cos3)},\n+\t{\"tx_packets_cos4\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\ttx_packets_cos4)},\n+\t{\"tx_packets_cos5\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\ttx_packets_cos5)},\n+\t{\"tx_packets_cos6\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\ttx_packets_cos6)},\n+\t{\"tx_packets_cos7\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\ttx_packets_cos7)},\n+\t{\"pfc_pri0_tx_duration_us\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\tpfc_pri0_tx_duration_us)},\n+\t{\"pfc_pri0_tx_transitions\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\tpfc_pri0_tx_transitions)},\n+\t{\"pfc_pri1_tx_duration_us\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\tpfc_pri1_tx_duration_us)},\n+\t{\"pfc_pri1_tx_transitions\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\tpfc_pri1_tx_transitions)},\n+\t{\"pfc_pri2_tx_duration_us\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\tpfc_pri2_tx_duration_us)},\n+\t{\"pfc_pri2_tx_transitions\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\tpfc_pri2_tx_transitions)},\n+\t{\"pfc_pri3_tx_duration_us\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\tpfc_pri3_tx_duration_us)},\n+\t{\"pfc_pri3_tx_transitions\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\tpfc_pri3_tx_transitions)},\n+\t{\"pfc_pri4_tx_duration_us\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\tpfc_pri4_tx_duration_us)},\n+\t{\"pfc_pri4_tx_transitions\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\tpfc_pri4_tx_transitions)},\n+\t{\"pfc_pri5_tx_duration_us\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\tpfc_pri5_tx_duration_us)},\n+\t{\"pfc_pri5_tx_transitions\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\tpfc_pri5_tx_transitions)},\n+\t{\"pfc_pri6_tx_duration_us\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\tpfc_pri6_tx_duration_us)},\n+\t{\"pfc_pri6_tx_transitions\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\tpfc_pri6_tx_transitions)},\n+\t{\"pfc_pri7_tx_duration_us\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\tpfc_pri7_tx_duration_us)},\n+\t{\"pfc_pri7_tx_transitions\", offsetof(struct tx_port_stats_ext,\n+\t\t\t\tpfc_pri7_tx_transitions)},\n+};\n+\n /*\n  * Statistics functions\n  */\n@@ -265,12 +409,22 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,\n \n \tunsigned int count, i;\n \tuint64_t tx_drop_pkts;\n+\tunsigned int rx_port_stats_ext_cnt;\n+\tunsigned int tx_port_stats_ext_cnt;\n+\tunsigned int stat_size = sizeof(uint64_t);\n+\tunsigned int stat_count;\n \n \tbnxt_hwrm_port_qstats(bp);\n \tbnxt_hwrm_func_qstats_tx_drop(bp, 0xffff, &tx_drop_pkts);\n+\tbnxt_hwrm_ext_port_qstats(bp);\n+\trx_port_stats_ext_cnt = bp->fw_rx_port_stats_ext_size / stat_size;\n+\ttx_port_stats_ext_cnt = bp->fw_tx_port_stats_ext_size / stat_size;\n \n \tcount = RTE_DIM(bnxt_rx_stats_strings) +\n-\t\tRTE_DIM(bnxt_tx_stats_strings) + 1; /* For tx_drop_pkts */\n+\t\tRTE_DIM(bnxt_tx_stats_strings) + 1/* For tx_drop_pkts */ +\n+\t\tRTE_DIM(bnxt_rx_ext_stats_strings) +\n+\t\tRTE_DIM(bnxt_tx_ext_stats_strings);\n+\tstat_count = count;\n \n \tif (n < count)\n \t\treturn count;\n@@ -299,7 +453,27 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,\n \txstats[count].value = rte_le_to_cpu_64(tx_drop_pkts);\n \tcount++;\n \n-\treturn count;\n+\tfor (i = 0; i < tx_port_stats_ext_cnt; i++) {\n+\t\tuint64_t *tx_stats_ext = (uint64_t *)bp->hw_tx_port_stats_ext;\n+\n+\t\txstats[count].value = rte_le_to_cpu_64\n+\t\t\t\t\t(*(uint64_t *)((char *)tx_stats_ext +\n+\t\t\t\t\t bnxt_tx_ext_stats_strings[i].offset));\n+\n+\t\tcount++;\n+\t}\n+\n+\tfor (i = 0; i < rx_port_stats_ext_cnt; i++) {\n+\t\tuint64_t *rx_stats_ext = (uint64_t *)bp->hw_rx_port_stats_ext;\n+\n+\t\txstats[count].value = rte_le_to_cpu_64\n+\t\t\t\t\t(*(uint64_t *)((char *)rx_stats_ext +\n+\t\t\t\t\t bnxt_rx_ext_stats_strings[i].offset));\n+\n+\t\tcount++;\n+\t}\n+\n+\treturn stat_count;\n }\n \n int bnxt_dev_xstats_get_names_op(__rte_unused struct rte_eth_dev *eth_dev,\n@@ -308,7 +482,9 @@ int bnxt_dev_xstats_get_names_op(__rte_unused struct rte_eth_dev *eth_dev,\n {\n \t/* Account for the Tx drop pkts aka the Anti spoof counter */\n \tconst unsigned int stat_cnt = RTE_DIM(bnxt_rx_stats_strings) +\n-\t\t\t\tRTE_DIM(bnxt_tx_stats_strings) + 1;\n+\t\t\t\tRTE_DIM(bnxt_tx_stats_strings) + 1 +\n+\t\t\t\tRTE_DIM(bnxt_rx_ext_stats_strings) +\n+\t\t\t\tRTE_DIM(bnxt_tx_ext_stats_strings);\n \tunsigned int i, count;\n \n \tif (xstats_names != NULL) {\n@@ -335,6 +511,25 @@ int bnxt_dev_xstats_get_names_op(__rte_unused struct rte_eth_dev *eth_dev,\n \t\t\t\t\"%s\",\n \t\t\t\tbnxt_func_stats_strings[4].name);\n \t\tcount++;\n+\n+\t\tfor (i = 0; i < RTE_DIM(bnxt_rx_ext_stats_strings); i++) {\n+\t\t\tsnprintf(xstats_names[count].name,\n+\t\t\t\t sizeof(xstats_names[count].name),\n+\t\t\t\t \"%s\",\n+\t\t\t\t bnxt_rx_ext_stats_strings[i].name);\n+\n+\t\t\tcount++;\n+\t\t}\n+\n+\t\tfor (i = 0; i < RTE_DIM(bnxt_tx_ext_stats_strings); i++) {\n+\t\t\tsnprintf(xstats_names[count].name,\n+\t\t\t\t sizeof(xstats_names[count].name),\n+\t\t\t\t \"%s\",\n+\t\t\t\t bnxt_tx_ext_stats_strings[i].name);\n+\n+\t\t\tcount++;\n+\t\t}\n+\n \t}\n \treturn stat_cnt;\n }\n@@ -359,7 +554,9 @@ int bnxt_dev_xstats_get_by_id_op(struct rte_eth_dev *dev, const uint64_t *ids,\n {\n \t/* Account for the Tx drop pkts aka the Anti spoof counter */\n \tconst unsigned int stat_cnt = RTE_DIM(bnxt_rx_stats_strings) +\n-\t\t\t\tRTE_DIM(bnxt_tx_stats_strings) + 1;\n+\t\t\t\tRTE_DIM(bnxt_tx_stats_strings) + 1 +\n+\t\t\t\tRTE_DIM(bnxt_rx_ext_stats_strings) +\n+\t\t\t\tRTE_DIM(bnxt_tx_ext_stats_strings);\n \tstruct rte_eth_xstat xstats[stat_cnt];\n \tuint64_t values_copy[stat_cnt];\n \tuint16_t i;\n@@ -384,7 +581,9 @@ int bnxt_dev_xstats_get_names_by_id_op(struct rte_eth_dev *dev,\n {\n \t/* Account for the Tx drop pkts aka the Anti spoof counter */\n \tconst unsigned int stat_cnt = RTE_DIM(bnxt_rx_stats_strings) +\n-\t\t\t\tRTE_DIM(bnxt_tx_stats_strings) + 1;\n+\t\t\t\tRTE_DIM(bnxt_tx_stats_strings) + 1 +\n+\t\t\t\tRTE_DIM(bnxt_rx_ext_stats_strings) +\n+\t\t\t\tRTE_DIM(bnxt_tx_ext_stats_strings);\n \tstruct rte_eth_xstat_name xstats_names_copy[stat_cnt];\n \tuint16_t i;\n \n",
    "prefixes": [
        "5/7"
    ]
}