get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 94452,
    "url": "https://patches.dpdk.org/api/patches/94452/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210618103741.26526-44-ndabilpuram@marvell.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20210618103741.26526-44-ndabilpuram@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210618103741.26526-44-ndabilpuram@marvell.com",
    "date": "2021-06-18T10:37:22",
    "name": "[v3,43/62] net/cnxk: add port/queue stats",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "8279dac33e9d9bfe14ab32845aeccc7eb63a96cd",
    "submitter": {
        "id": 1202,
        "url": "https://patches.dpdk.org/api/people/1202/?format=api",
        "name": "Nithin Dabilpuram",
        "email": "ndabilpuram@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "https://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210618103741.26526-44-ndabilpuram@marvell.com/mbox/",
    "series": [
        {
            "id": 17394,
            "url": "https://patches.dpdk.org/api/series/17394/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=17394",
            "date": "2021-06-18T10:36:39",
            "name": "Marvell CNXK Ethdev Driver",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/17394/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/94452/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/94452/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id B25C5A0C46;\n\tFri, 18 Jun 2021 12:44:22 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D825B4118A;\n\tFri, 18 Jun 2021 12:41:06 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 7CC37410FD\n for <dev@dpdk.org>; Fri, 18 Jun 2021 12:41:04 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id\n 15IAZv9X004568 for <dev@dpdk.org>; Fri, 18 Jun 2021 03:41:04 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com with ESMTP id 397udry7k9-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Fri, 18 Jun 2021 03:41:03 -0700",
            "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.18;\n Fri, 18 Jun 2021 03:41:01 -0700",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend\n Transport; Fri, 18 Jun 2021 03:41:01 -0700",
            "from hyd1588t430.marvell.com (unknown [10.29.52.204])\n by maili.marvell.com (Postfix) with ESMTP id 508D75B69FB;\n Fri, 18 Jun 2021 03:40:47 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-type; s=pfpt0220; bh=QjlDBA7eT1+LtYD2JnKBZHCBhZXrFJo9VXj1+vrqkJw=;\n b=Cm8O1lLlSjPaPc2zuEhkOgTjfFfxN41SOBzKAG0IiuVW8s6oTiqkHFwPw/EYQAB3rjLT\n pVfoX0UeAft5K9phsAyBVmoD0Yy7miaB60tLVnYoClNQQ7jhCWpz0dVr6LwU2z1ocHQU\n cElGG9Pj4RzFtgyZXhz2hXopUr5CbBU/4+NP25cz0FeOcH2TlgSfrtEvXr1df/xTOXmw\n YsF/ETD3yppOdGU+ZbZj2hUTO//1pUavXrRKhjbiIvI9gzoS3/rgBBHDsbxkRs872bCt\n VNgUu6NzEj2n9M+y/UqArjOdUMPwP/90V1p1ottC2f1h080KQJ2OaA2vaXWmxVfXZm8N 9A==",
        "From": "Nithin Dabilpuram <ndabilpuram@marvell.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<jerinj@marvell.com>, <skori@marvell.com>, <skoteshwar@marvell.com>,\n <pbhagavatula@marvell.com>, <kirankumark@marvell.com>,\n <psatheesh@marvell.com>, <asekhar@marvell.com>, <hkalra@marvell.com>",
        "Date": "Fri, 18 Jun 2021 16:07:22 +0530",
        "Message-ID": "<20210618103741.26526-44-ndabilpuram@marvell.com>",
        "X-Mailer": "git-send-email 2.8.4",
        "In-Reply-To": "<20210618103741.26526-1-ndabilpuram@marvell.com>",
        "References": "<20210306153404.10781-1-ndabilpuram@marvell.com>\n <20210618103741.26526-1-ndabilpuram@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "PN3xdwxNvzxpNy38Vr5Sd_Gi2S0kS18C",
        "X-Proofpoint-GUID": "PN3xdwxNvzxpNy38Vr5Sd_Gi2S0kS18C",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790\n definitions=2021-06-18_04:2021-06-18,\n 2021-06-18 signatures=0",
        "Subject": "[dpdk-dev] [PATCH v3 43/62] net/cnxk: add port/queue stats",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Satha Rao <skoteshwar@marvell.com>\n\nThis patch implements regular port statistics and queue mapping set\napi to get queue statistics\n\nSigned-off-by: Satha Rao <skoteshwar@marvell.com>\n---\n doc/guides/nics/cnxk.rst              |  1 +\n doc/guides/nics/features/cnxk.ini     |  2 +\n doc/guides/nics/features/cnxk_vec.ini |  2 +\n doc/guides/nics/features/cnxk_vf.ini  |  2 +\n drivers/net/cnxk/cnxk_ethdev.c        |  3 ++\n drivers/net/cnxk/cnxk_ethdev.h        |  8 ++++\n drivers/net/cnxk/cnxk_stats.c         | 85 +++++++++++++++++++++++++++++++++++\n drivers/net/cnxk/meson.build          |  3 +-\n 8 files changed, 105 insertions(+), 1 deletion(-)\n create mode 100644 drivers/net/cnxk/cnxk_stats.c",
    "diff": "diff --git a/doc/guides/nics/cnxk.rst b/doc/guides/nics/cnxk.rst\nindex 6678486..e875e55 100644\n--- a/doc/guides/nics/cnxk.rst\n+++ b/doc/guides/nics/cnxk.rst\n@@ -25,6 +25,7 @@ Features of the CNXK Ethdev PMD are:\n - Receiver Side Scaling (RSS)\n - MAC filtering\n - Inner and Outer Checksum offload\n+- Port hardware statistics\n - Link state information\n - Link flow control\n - MTU update\ndiff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini\nindex e5669f5..40952a9 100644\n--- a/doc/guides/nics/features/cnxk.ini\n+++ b/doc/guides/nics/features/cnxk.ini\n@@ -32,6 +32,8 @@ L4 checksum offload  = Y\n Inner L3 checksum    = Y\n Inner L4 checksum    = Y\n Packet type parsing  = Y\n+Basic stats          = Y\n+Stats per queue      = Y\n Module EEPROM dump   = Y\n Linux                = Y\n ARMv8                = Y\ndiff --git a/doc/guides/nics/features/cnxk_vec.ini b/doc/guides/nics/features/cnxk_vec.ini\nindex dff0c9b..32035bb 100644\n--- a/doc/guides/nics/features/cnxk_vec.ini\n+++ b/doc/guides/nics/features/cnxk_vec.ini\n@@ -30,6 +30,8 @@ L4 checksum offload  = Y\n Inner L3 checksum    = Y\n Inner L4 checksum    = Y\n Packet type parsing  = Y\n+Basic stats          = Y\n+Stats per queue      = Y\n Module EEPROM dump   = Y\n Linux                = Y\n ARMv8                = Y\ndiff --git a/doc/guides/nics/features/cnxk_vf.ini b/doc/guides/nics/features/cnxk_vf.ini\nindex b950d2f..8060a68 100644\n--- a/doc/guides/nics/features/cnxk_vf.ini\n+++ b/doc/guides/nics/features/cnxk_vf.ini\n@@ -27,6 +27,8 @@ L4 checksum offload  = Y\n Inner L3 checksum    = Y\n Inner L4 checksum    = Y\n Packet type parsing  = Y\n+Basic stats          = Y\n+Stats per queue      = Y\n Module EEPROM dump   = Y\n Linux                = Y\n ARMv8                = Y\ndiff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c\nindex 627ac32..ecc7f13 100644\n--- a/drivers/net/cnxk/cnxk_ethdev.c\n+++ b/drivers/net/cnxk/cnxk_ethdev.c\n@@ -1184,6 +1184,9 @@ struct eth_dev_ops cnxk_eth_dev_ops = {\n \t.rx_queue_intr_enable = cnxk_nix_rx_queue_intr_enable,\n \t.rx_queue_intr_disable = cnxk_nix_rx_queue_intr_disable,\n \t.pool_ops_supported = cnxk_nix_pool_ops_supported,\n+\t.queue_stats_mapping_set = cnxk_nix_queue_stats_mapping,\n+\t.stats_get = cnxk_nix_stats_get,\n+\t.stats_reset = cnxk_nix_stats_reset,\n };\n \n static int\ndiff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h\nindex e6dac95..860cfe1 100644\n--- a/drivers/net/cnxk/cnxk_ethdev.h\n+++ b/drivers/net/cnxk/cnxk_ethdev.h\n@@ -191,6 +191,10 @@ struct cnxk_eth_dev {\n \n \t/* LSO Tunnel format indices */\n \tuint64_t lso_tun_fmt;\n+\n+\t/* Per queue statistics counters */\n+\tuint32_t txq_stat_map[RTE_ETHDEV_QUEUE_STAT_CNTRS];\n+\tuint32_t rxq_stat_map[RTE_ETHDEV_QUEUE_STAT_CNTRS];\n };\n \n struct cnxk_eth_rxq_sp {\n@@ -286,6 +290,10 @@ void cnxk_nix_toggle_flag_link_cfg(struct cnxk_eth_dev *dev, bool set);\n void cnxk_eth_dev_link_status_cb(struct roc_nix *nix,\n \t\t\t\t struct roc_nix_link_info *link);\n int cnxk_nix_link_update(struct rte_eth_dev *eth_dev, int wait_to_complete);\n+int cnxk_nix_queue_stats_mapping(struct rte_eth_dev *dev, uint16_t queue_id,\n+\t\t\t\t uint8_t stat_idx, uint8_t is_rx);\n+int cnxk_nix_stats_reset(struct rte_eth_dev *dev);\n+int cnxk_nix_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats);\n \n /* Lookup configuration */\n const uint32_t *cnxk_nix_supported_ptypes_get(struct rte_eth_dev *eth_dev);\ndiff --git a/drivers/net/cnxk/cnxk_stats.c b/drivers/net/cnxk/cnxk_stats.c\nnew file mode 100644\nindex 0000000..24bff0b\n--- /dev/null\n+++ b/drivers/net/cnxk/cnxk_stats.c\n@@ -0,0 +1,85 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2021 Marvell.\n+ */\n+\n+#include \"cnxk_ethdev.h\"\n+\n+int\n+cnxk_nix_stats_get(struct rte_eth_dev *eth_dev, struct rte_eth_stats *stats)\n+{\n+\tstruct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);\n+\tstruct roc_nix *nix = &dev->nix;\n+\tstruct roc_nix_stats nix_stats;\n+\tint rc = 0, i;\n+\n+\trc = roc_nix_stats_get(nix, &nix_stats);\n+\tif (rc)\n+\t\tgoto exit;\n+\n+\tstats->opackets = nix_stats.tx_ucast;\n+\tstats->opackets += nix_stats.tx_mcast;\n+\tstats->opackets += nix_stats.tx_bcast;\n+\tstats->oerrors = nix_stats.tx_drop;\n+\tstats->obytes = nix_stats.tx_octs;\n+\n+\tstats->ipackets = nix_stats.rx_ucast;\n+\tstats->ipackets += nix_stats.rx_mcast;\n+\tstats->ipackets += nix_stats.rx_bcast;\n+\tstats->imissed = nix_stats.rx_drop;\n+\tstats->ibytes = nix_stats.rx_octs;\n+\tstats->ierrors = nix_stats.rx_err;\n+\n+\tfor (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS; i++) {\n+\t\tstruct roc_nix_stats_queue qstats;\n+\t\tuint16_t qidx;\n+\n+\t\tif (dev->txq_stat_map[i] & (1U << 31)) {\n+\t\t\tqidx = dev->txq_stat_map[i] & 0xFFFF;\n+\t\t\trc = roc_nix_stats_queue_get(nix, qidx, 0, &qstats);\n+\t\t\tif (rc)\n+\t\t\t\tgoto exit;\n+\t\t\tstats->q_opackets[i] = qstats.tx_pkts;\n+\t\t\tstats->q_obytes[i] = qstats.tx_octs;\n+\t\t\tstats->q_errors[i] = qstats.tx_drop_pkts;\n+\t\t}\n+\n+\t\tif (dev->rxq_stat_map[i] & (1U << 31)) {\n+\t\t\tqidx = dev->rxq_stat_map[i] & 0xFFFF;\n+\t\t\trc = roc_nix_stats_queue_get(nix, qidx, 1, &qstats);\n+\t\t\tif (rc)\n+\t\t\t\tgoto exit;\n+\t\t\tstats->q_ipackets[i] = qstats.rx_pkts;\n+\t\t\tstats->q_ibytes[i] = qstats.rx_octs;\n+\t\t\tstats->q_errors[i] += qstats.rx_drop_pkts;\n+\t\t}\n+\t}\n+exit:\n+\treturn rc;\n+}\n+\n+int\n+cnxk_nix_stats_reset(struct rte_eth_dev *eth_dev)\n+{\n+\tstruct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);\n+\n+\treturn roc_nix_stats_reset(&dev->nix);\n+}\n+\n+int\n+cnxk_nix_queue_stats_mapping(struct rte_eth_dev *eth_dev, uint16_t queue_id,\n+\t\t\t     uint8_t stat_idx, uint8_t is_rx)\n+{\n+\tstruct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);\n+\n+\tif (is_rx) {\n+\t\tif (queue_id >= dev->nb_rxq)\n+\t\t\treturn -EINVAL;\n+\t\tdev->rxq_stat_map[stat_idx] = ((1U << 31) | queue_id);\n+\t} else {\n+\t\tif (queue_id >= dev->nb_txq)\n+\t\t\treturn -EINVAL;\n+\t\tdev->txq_stat_map[stat_idx] = ((1U << 31) | queue_id);\n+\t}\n+\n+\treturn 0;\n+}\ndiff --git a/drivers/net/cnxk/meson.build b/drivers/net/cnxk/meson.build\nindex 8f32dc7..7d711a2 100644\n--- a/drivers/net/cnxk/meson.build\n+++ b/drivers/net/cnxk/meson.build\n@@ -12,7 +12,8 @@ sources = files('cnxk_ethdev.c',\n \t\t'cnxk_ethdev_ops.c',\n \t\t'cnxk_ethdev_devargs.c',\n \t\t'cnxk_link.c',\n-\t\t'cnxk_lookup.c')\n+\t\t'cnxk_lookup.c',\n+\t\t'cnxk_stats.c')\n \n # CN9K\n sources += files('cn9k_ethdev.c',\n",
    "prefixes": [
        "v3",
        "43/62"
    ]
}