get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 107990,
    "url": "https://patches.dpdk.org/api/patches/107990/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220222160634.24489-15-mk@semihalf.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": "<20220222160634.24489-15-mk@semihalf.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220222160634.24489-15-mk@semihalf.com",
    "date": "2022-02-22T16:06:27",
    "name": "[14/21] net/ena: add API for probing xstat names by ID",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "08e0f89979108b59f5d5a4204ce55ab151bbc1ba",
    "submitter": {
        "id": 786,
        "url": "https://patches.dpdk.org/api/people/786/?format=api",
        "name": "Michal Krawczyk",
        "email": "mk@semihalf.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20220222160634.24489-15-mk@semihalf.com/mbox/",
    "series": [
        {
            "id": 21796,
            "url": "https://patches.dpdk.org/api/series/21796/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=21796",
            "date": "2022-02-22T16:06:13",
            "name": "net/ena: v2.6.0 driver update",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/21796/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/107990/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/107990/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 57236A0352;\n\tTue, 22 Feb 2022 17:08:31 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id ED543411E6;\n\tTue, 22 Feb 2022 17:07:13 +0100 (CET)",
            "from mail-ej1-f54.google.com (mail-ej1-f54.google.com\n [209.85.218.54]) by mails.dpdk.org (Postfix) with ESMTP id 92D3F411AE\n for <dev@dpdk.org>; Tue, 22 Feb 2022 17:07:10 +0100 (CET)",
            "by mail-ej1-f54.google.com with SMTP id qx21so44284723ejb.13\n for <dev@dpdk.org>; Tue, 22 Feb 2022 08:07:10 -0800 (PST)",
            "from DESKTOP-U5LNN3J.localdomain (89-79-181-52.dynamic.chello.pl.\n [89.79.181.52])\n by smtp.gmail.com with ESMTPSA id x6sm10013477edv.109.2022.02.22.08.07.08\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 22 Feb 2022 08:07:09 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=semihalf-com.20210112.gappssmtp.com; s=20210112;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding;\n bh=HexrzqMhOSZQMQXdYhbCJ6UgcGMV1Vcs7Dsbc7kZMJQ=;\n b=TzfRPlzju06SMg+lH3C8lmRVOTSpypPjlfjVZX4kkxczzUVjOcNFHyl6qEnnITyyX8\n svXdJR2azav8ImEJPtzP8Hk2ZdzvRh5QDiZRfJD0oZz4KJrYYJar9/ST0QzXEZZon9lb\n sBVQ0sk14uarjFJJk8p0Av80Vmc1+kyt7Hn2Z0TbEv9ZTrZZ/c3K5X1hTEuMipRM0780\n vlJWY4Wi4zEqg2RQ9gd5QdTxFazhhzFEZmcnyf5hp1LPJuknRrkI7os3SEeY5I/duLOH\n nyLfXnerwFHIh7cOoWyM9GFwNRg+wszvGivtrIzSP6cHVJNOu5RuQEnmii0Tl7juO6rd\n NRug==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version:content-transfer-encoding;\n bh=HexrzqMhOSZQMQXdYhbCJ6UgcGMV1Vcs7Dsbc7kZMJQ=;\n b=e7AWMWdvRM/JV2BRQLHGF/hhWYYJIgwzUvSCbXHIKeyYg+1Yu6K6V5TC9D1fYhdT1X\n ZT1wmmtOkwZG1euWPoxeqd8lq7irFhXhm6bIn2sSuZwfQcR+j3T7SGMc/wfcj5uCNHej\n WamC9slcEeHcJIIQpiW/CxBEiIzO7th9usiTqQQyGw/Ym4GWVpvTmVSaXQ1WB4cLK2R9\n T1Q1lauQEsxmi7JYCz+8ueSMOJFmmqXu+Anu8bFOSqdmaInCwSQU48Pf5Ngc4HiW0QPJ\n YbkyYGjAiKYwWCWlCTWgf+yDPJzW2WQ2Ad6CE6ojID9e08xqYAePTTI0rMEkvajmPS/f\n DBFA==",
        "X-Gm-Message-State": "AOAM532VHOWaeJu6zuXVPXD4QdmE+yimcACwdl1JYhd6Xnk/yDjN/KmT\n HHXCQ5OOm8K6S3Rpbl09+31hUNEpjqUvzQ==",
        "X-Google-Smtp-Source": "\n ABdhPJxFdvrIdl5AFVhbRmtbrXJX6dW5y3YnLnvERrXq+JH6EtMB7M4vQnj8VLO83VQ+LT8v+DUUmg==",
        "X-Received": "by 2002:a17:907:2bf6:b0:6b9:725e:4e1f with SMTP id\n gv54-20020a1709072bf600b006b9725e4e1fmr19899566ejc.527.1645546029993;\n Tue, 22 Feb 2022 08:07:09 -0800 (PST)",
        "From": "Michal Krawczyk <mk@semihalf.com>",
        "To": "dev@dpdk.org",
        "Cc": "shaibran@amazon.com, upstream@semihalf.com,\n Michal Krawczyk <mk@semihalf.com>, Dawid Gorecki <dgr@semihalf.com>",
        "Subject": "[PATCH 14/21] net/ena: add API for probing xstat names by ID",
        "Date": "Tue, 22 Feb 2022 17:06:27 +0100",
        "Message-Id": "<20220222160634.24489-15-mk@semihalf.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220222160634.24489-1-mk@semihalf.com>",
        "References": "<20220222160634.24489-1-mk@semihalf.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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"
    },
    "content": "ENA was only supporting retrieval of all the xstats name and wasn't\nimplementing the eth_xstats_get_names_by_id API.\n\nAs this API may be more efficient than retrieving all the names, it\ntries to avoid excessive string copying.\n\nSigned-off-by: Michal Krawczyk <mk@semihalf.com>\nReviewed-by: Dawid Gorecki <dgr@semihalf.com>\nReviewed-by: Shai Brandes <shaibran@amazon.com>\n---\n doc/guides/rel_notes/release_22_03.rst |   1 +\n drivers/net/ena/ena_ethdev.c           | 130 ++++++++++++++++++++-----\n 2 files changed, 108 insertions(+), 23 deletions(-)",
    "diff": "diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst\nindex 91324dae18..1b87b9c174 100644\n--- a/doc/guides/rel_notes/release_22_03.rst\n+++ b/doc/guides/rel_notes/release_22_03.rst\n@@ -115,6 +115,7 @@ New Features\n   * Added optimized memcpy support for the ARM platforms.\n   * Added ENA admin queue support for the MP applications.\n   * Added free Tx mbuf on demand feature support.\n+  * Added ``rte_eth_xstats_get_names_by_id`` API support.\n \n * **Updated Cisco enic driver.**\n \ndiff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c\nindex eecdd447dd..0766f613b0 100644\n--- a/drivers/net/ena/ena_ethdev.c\n+++ b/drivers/net/ena/ena_ethdev.c\n@@ -230,6 +230,10 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev);\n static int ena_xstats_get_names(struct rte_eth_dev *dev,\n \t\t\t\tstruct rte_eth_xstat_name *xstats_names,\n \t\t\t\tunsigned int n);\n+static int ena_xstats_get_names_by_id(struct rte_eth_dev *dev,\n+\t\t\t\t      const uint64_t *ids,\n+\t\t\t\t      struct rte_eth_xstat_name *xstats_names,\n+\t\t\t\t      unsigned int size);\n static int ena_xstats_get(struct rte_eth_dev *dev,\n \t\t\t  struct rte_eth_xstat *stats,\n \t\t\t  unsigned int n);\n@@ -254,29 +258,30 @@ static int ena_mp_primary_handle(const struct rte_mp_msg *mp_msg,\n \t\t\t\t const void *peer);\n \n static const struct eth_dev_ops ena_dev_ops = {\n-\t.dev_configure        = ena_dev_configure,\n-\t.dev_infos_get        = ena_infos_get,\n-\t.rx_queue_setup       = ena_rx_queue_setup,\n-\t.tx_queue_setup       = ena_tx_queue_setup,\n-\t.dev_start            = ena_start,\n-\t.dev_stop             = ena_stop,\n-\t.link_update          = ena_link_update,\n-\t.stats_get            = ena_stats_get,\n-\t.xstats_get_names     = ena_xstats_get_names,\n-\t.xstats_get\t      = ena_xstats_get,\n-\t.xstats_get_by_id     = ena_xstats_get_by_id,\n-\t.mtu_set              = ena_mtu_set,\n-\t.rx_queue_release     = ena_rx_queue_release,\n-\t.tx_queue_release     = ena_tx_queue_release,\n-\t.dev_close            = ena_close,\n-\t.dev_reset            = ena_dev_reset,\n-\t.reta_update          = ena_rss_reta_update,\n-\t.reta_query           = ena_rss_reta_query,\n-\t.rx_queue_intr_enable = ena_rx_queue_intr_enable,\n-\t.rx_queue_intr_disable = ena_rx_queue_intr_disable,\n-\t.rss_hash_update      = ena_rss_hash_update,\n-\t.rss_hash_conf_get    = ena_rss_hash_conf_get,\n-\t.tx_done_cleanup      = ena_tx_cleanup,\n+\t.dev_configure          = ena_dev_configure,\n+\t.dev_infos_get          = ena_infos_get,\n+\t.rx_queue_setup         = ena_rx_queue_setup,\n+\t.tx_queue_setup         = ena_tx_queue_setup,\n+\t.dev_start              = ena_start,\n+\t.dev_stop               = ena_stop,\n+\t.link_update            = ena_link_update,\n+\t.stats_get              = ena_stats_get,\n+\t.xstats_get_names       = ena_xstats_get_names,\n+\t.xstats_get_names_by_id = ena_xstats_get_names_by_id,\n+\t.xstats_get             = ena_xstats_get,\n+\t.xstats_get_by_id       = ena_xstats_get_by_id,\n+\t.mtu_set                = ena_mtu_set,\n+\t.rx_queue_release       = ena_rx_queue_release,\n+\t.tx_queue_release       = ena_tx_queue_release,\n+\t.dev_close              = ena_close,\n+\t.dev_reset              = ena_dev_reset,\n+\t.reta_update            = ena_rss_reta_update,\n+\t.reta_query             = ena_rss_reta_query,\n+\t.rx_queue_intr_enable   = ena_rx_queue_intr_enable,\n+\t.rx_queue_intr_disable  = ena_rx_queue_intr_disable,\n+\t.rss_hash_update        = ena_rss_hash_update,\n+\t.rss_hash_conf_get      = ena_rss_hash_conf_get,\n+\t.tx_done_cleanup        = ena_tx_cleanup,\n };\n \n /*********************************************************************\n@@ -3165,6 +3170,85 @@ static int ena_xstats_get_names(struct rte_eth_dev *dev,\n \treturn xstats_count;\n }\n \n+/**\n+ * DPDK callback to retrieve names of extended device statistics for the given\n+ * ids.\n+ *\n+ * @param dev\n+ *   Pointer to Ethernet device structure.\n+ * @param[out] xstats_names\n+ *   Buffer to insert names into.\n+ * @param ids\n+ *   IDs array for which the names should be retrieved.\n+ * @param size\n+ *   Number of ids.\n+ *\n+ * @return\n+ *   Positive value: number of xstats names. Negative value: error code.\n+ */\n+static int ena_xstats_get_names_by_id(struct rte_eth_dev *dev,\n+\t\t\t\t      const uint64_t *ids,\n+\t\t\t\t      struct rte_eth_xstat_name *xstats_names,\n+\t\t\t\t      unsigned int size)\n+{\n+\tuint64_t xstats_count = ena_xstats_calc_num(dev->data);\n+\tuint64_t id, qid;\n+\tunsigned int i;\n+\n+\tif (xstats_names == NULL)\n+\t\treturn xstats_count;\n+\n+\tfor (i = 0; i < size; ++i) {\n+\t\tid = ids[i];\n+\t\tif (id > xstats_count) {\n+\t\t\tPMD_DRV_LOG(ERR,\n+\t\t\t\t\"ID value out of range: id=%\" PRIu64 \", xstats_num=%\" PRIu64 \"\\n\",\n+\t\t\t\t id, xstats_count);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t\tif (id < ENA_STATS_ARRAY_GLOBAL) {\n+\t\t\tstrcpy(xstats_names[i].name,\n+\t\t\t       ena_stats_global_strings[id].name);\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\tid -= ENA_STATS_ARRAY_GLOBAL;\n+\t\tif (id < ENA_STATS_ARRAY_ENI) {\n+\t\t\tstrcpy(xstats_names[i].name,\n+\t\t\t       ena_stats_eni_strings[id].name);\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\tid -= ENA_STATS_ARRAY_ENI;\n+\t\tif (id < ENA_STATS_ARRAY_RX) {\n+\t\t\tqid = id / dev->data->nb_rx_queues;\n+\t\t\tid %= dev->data->nb_rx_queues;\n+\t\t\tsnprintf(xstats_names[i].name,\n+\t\t\t\t sizeof(xstats_names[i].name),\n+\t\t\t\t \"rx_q%\" PRIu64 \"d_%s\",\n+\t\t\t\t qid, ena_stats_rx_strings[id].name);\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\tid -= ENA_STATS_ARRAY_RX;\n+\t\t/* Although this condition is not needed, it was added for\n+\t\t * compatibility if new xstat structure would be ever added.\n+\t\t */\n+\t\tif (id < ENA_STATS_ARRAY_TX) {\n+\t\t\tqid = id / dev->data->nb_tx_queues;\n+\t\t\tid %= dev->data->nb_tx_queues;\n+\t\t\tsnprintf(xstats_names[i].name,\n+\t\t\t\t sizeof(xstats_names[i].name),\n+\t\t\t\t \"tx_q%\" PRIu64 \"_%s\",\n+\t\t\t\t qid, ena_stats_tx_strings[id].name);\n+\t\t\tcontinue;\n+\t\t}\n+\t}\n+\n+\treturn i;\n+}\n+\n /**\n  * DPDK callback to get extended device statistics.\n  *\n",
    "prefixes": [
        "14/21"
    ]
}