get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 121333,
    "url": "http://patches.dpdk.org/api/patches/121333/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20221223015558.3143279-22-mingxia.liu@intel.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": "<20221223015558.3143279-22-mingxia.liu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20221223015558.3143279-22-mingxia.liu@intel.com",
    "date": "2022-12-23T01:55:58",
    "name": "[21/21] net/cpfl: add xstats ops",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9191c7f2cf64d052e41e1abd32a1f76f0ccc1934",
    "submitter": {
        "id": 2514,
        "url": "http://patches.dpdk.org/api/people/2514/?format=api",
        "name": "Liu, Mingxia",
        "email": "mingxia.liu@intel.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/20221223015558.3143279-22-mingxia.liu@intel.com/mbox/",
    "series": [
        {
            "id": 26253,
            "url": "http://patches.dpdk.org/api/series/26253/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=26253",
            "date": "2022-12-23T01:55:37",
            "name": "add support for cpfl PMD in DPDK",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/26253/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/121333/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/121333/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 DB27BA0093;\n\tFri, 23 Dec 2022 03:53:48 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 641D342D29;\n\tFri, 23 Dec 2022 03:52:25 +0100 (CET)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id 7EB3442D76\n for <dev@dpdk.org>; Fri, 23 Dec 2022 03:52:23 +0100 (CET)",
            "from orsmga006.jf.intel.com ([10.7.209.51])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 22 Dec 2022 18:52:23 -0800",
            "from dpdk-mingxial-01.sh.intel.com ([10.67.119.112])\n by orsmga006.jf.intel.com with ESMTP; 22 Dec 2022 18:52:21 -0800"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1671763943; x=1703299943;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=HxjkSJlt+LpFszNK0Co9VgnvlQEMNwn9pnC2DFfTCPU=;\n b=N35CzMvBqTPNtOOof1OGOH/xMDgE6GMpVesZgiwldC71C1q1vaFM9tA2\n 6PxGqEURxt+rVfkczNzCcok9NnEsb8VzXHvyH92qgXxCYco0D74SLI2Ka\n 5kt9kcRynsYCD9FhxPKTqgVFLmrkYLlVAD5sW9VhTONddeyWISh2Ea9BW\n /LGYFEFI2Make1aouilhbCnjcH9Os2Sfq3A5pAxq/rJv9yB8vpFfOIBQd\n ZNhVCTSGTML90sExnHN1RSWmmCKVbMrZWzwjXswKHwsYDYVWwL48Q7snE\n qccBJ5dxMFS0YIuI2K7cCPcSBYGbulAgP7bPylzxNI2icFieNHB2o9MAy g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10569\"; a=\"321467147\"",
            "E=Sophos;i=\"5.96,267,1665471600\"; d=\"scan'208\";a=\"321467147\"",
            "E=McAfee;i=\"6500,9779,10569\"; a=\"629707214\"",
            "E=Sophos;i=\"5.96,267,1665471600\"; d=\"scan'208\";a=\"629707214\""
        ],
        "X-ExtLoop1": "1",
        "From": "Mingxia Liu <mingxia.liu@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "jingjing.wu@intel.com, beilei.xing@intel.com, qi.z.zhang@intel.com,\n Mingxia Liu <mingxia.liu@intel.com>",
        "Subject": "[PATCH 21/21] net/cpfl: add xstats ops",
        "Date": "Fri, 23 Dec 2022 01:55:58 +0000",
        "Message-Id": "<20221223015558.3143279-22-mingxia.liu@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20221223015558.3143279-1-mingxia.liu@intel.com>",
        "References": "<20221223015558.3143279-1-mingxia.liu@intel.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": "Add support for these device ops:\n-idpf_dev_xstats_get\n-idpf_dev_xstats_get_names\n-idpf_dev_xstats_reset\n\nSigned-off-by: Mingxia Liu <mingxia.liu@intel.com>\n---\n drivers/net/cpfl/cpfl_ethdev.c | 80 ++++++++++++++++++++++++++++++++++\n 1 file changed, 80 insertions(+)",
    "diff": "diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c\nindex 07f616835c..bc2e6507d2 100644\n--- a/drivers/net/cpfl/cpfl_ethdev.c\n+++ b/drivers/net/cpfl/cpfl_ethdev.c\n@@ -80,6 +80,30 @@ static const uint64_t cpfl_ipv6_rss = RTE_ETH_RSS_NONFRAG_IPV6_UDP |\n \t\t\t  RTE_ETH_RSS_NONFRAG_IPV6_OTHER |\n \t\t\t  RTE_ETH_RSS_FRAG_IPV6;\n \n+struct rte_cpfl_xstats_name_off {\n+\tchar name[RTE_ETH_XSTATS_NAME_SIZE];\n+\tunsigned int offset;\n+};\n+\n+static const struct rte_cpfl_xstats_name_off rte_cpfl_stats_strings[] = {\n+\t{\"rx_bytes\", offsetof(struct virtchnl2_vport_stats, rx_bytes)},\n+\t{\"rx_unicast_packets\", offsetof(struct virtchnl2_vport_stats, rx_unicast)},\n+\t{\"rx_multicast_packets\", offsetof(struct virtchnl2_vport_stats, rx_multicast)},\n+\t{\"rx_broadcast_packets\", offsetof(struct virtchnl2_vport_stats, rx_broadcast)},\n+\t{\"rx_dropped_packets\", offsetof(struct virtchnl2_vport_stats, rx_discards)},\n+\t{\"rx_errors\", offsetof(struct virtchnl2_vport_stats, rx_errors)},\n+\t{\"rx_unknown_protocol_packets\", offsetof(struct virtchnl2_vport_stats,\n+\t\t\t\t\t\t rx_unknown_protocol)},\n+\t{\"tx_bytes\", offsetof(struct virtchnl2_vport_stats, tx_bytes)},\n+\t{\"tx_unicast_packets\", offsetof(struct virtchnl2_vport_stats, tx_unicast)},\n+\t{\"tx_multicast_packets\", offsetof(struct virtchnl2_vport_stats, tx_multicast)},\n+\t{\"tx_broadcast_packets\", offsetof(struct virtchnl2_vport_stats, tx_broadcast)},\n+\t{\"tx_dropped_packets\", offsetof(struct virtchnl2_vport_stats, tx_discards)},\n+\t{\"tx_error_packets\", offsetof(struct virtchnl2_vport_stats, tx_errors)}};\n+\n+#define CPFL_NB_XSTATS (sizeof(rte_cpfl_stats_strings) / \\\n+\t\tsizeof(rte_cpfl_stats_strings[0]))\n+\n static int\n cpfl_dev_link_update(struct rte_eth_dev *dev,\n \t\t     __rte_unused int wait_to_complete)\n@@ -304,6 +328,59 @@ cpfl_dev_stats_reset(struct rte_eth_dev *dev)\n \treturn 0;\n }\n \n+static int cpfl_dev_xstats_reset(struct rte_eth_dev *dev)\n+{\n+\tcpfl_dev_stats_reset(dev);\n+\treturn 0;\n+}\n+\n+static int cpfl_dev_xstats_get(struct rte_eth_dev *dev,\n+\t\t\t       struct rte_eth_xstat *xstats, unsigned int n)\n+{\n+\tstruct idpf_vport *vport =\n+\t\t(struct idpf_vport *)dev->data->dev_private;\n+\tstruct virtchnl2_vport_stats *pstats = NULL;\n+\tunsigned int i;\n+\tint ret;\n+\n+\tif (n < CPFL_NB_XSTATS)\n+\t\treturn CPFL_NB_XSTATS;\n+\n+\tif (!xstats)\n+\t\treturn 0;\n+\n+\tret = idpf_query_stats(vport, &pstats);\n+\tif (ret) {\n+\t\tPMD_DRV_LOG(ERR, \"Get statistics failed\");\n+\t\treturn 0;\n+\t}\n+\n+\tidpf_update_stats(&vport->eth_stats_offset, pstats);\n+\n+\t/* loop over xstats array and values from pstats */\n+\tfor (i = 0; i < CPFL_NB_XSTATS; i++) {\n+\t\txstats[i].id = i;\n+\t\txstats[i].value = *(uint64_t *)(((char *)pstats) +\n+\t\t\trte_cpfl_stats_strings[i].offset);\n+\t}\n+\treturn CPFL_NB_XSTATS;\n+}\n+\n+static int cpfl_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,\n+\t\t\t\t     struct rte_eth_xstat_name *xstats_names,\n+\t\t\t\t     __rte_unused unsigned int limit)\n+{\n+\tunsigned int i;\n+\n+\tif (xstats_names)\n+\t\tfor (i = 0; i < CPFL_NB_XSTATS; i++) {\n+\t\t\tsnprintf(xstats_names[i].name,\n+\t\t\t\t sizeof(xstats_names[i].name),\n+\t\t\t\t \"%s\", rte_cpfl_stats_strings[i].name);\n+\t\t}\n+\treturn CPFL_NB_XSTATS;\n+}\n+\n static int cpfl_config_rss_hf(struct idpf_vport *vport, uint64_t rss_hf)\n {\n \tuint64_t hena = 0, valid_rss_hf = 0;\n@@ -1149,6 +1226,9 @@ static const struct eth_dev_ops cpfl_eth_dev_ops = {\n \t.reta_query\t\t\t= cpfl_rss_reta_query,\n \t.rss_hash_update\t\t= cpfl_rss_hash_update,\n \t.rss_hash_conf_get\t\t= cpfl_rss_hash_conf_get,\n+\t.xstats_get\t\t\t= cpfl_dev_xstats_get,\n+\t.xstats_get_names\t\t= cpfl_dev_xstats_get_names,\n+\t.xstats_reset\t\t\t= cpfl_dev_xstats_reset,\n };\n \n static uint16_t\n",
    "prefixes": [
        "21/21"
    ]
}