get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 124659,
    "url": "http://patches.dpdk.org/api/patches/124659/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230302103527.931071-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": "<20230302103527.931071-22-mingxia.liu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230302103527.931071-22-mingxia.liu@intel.com",
    "date": "2023-03-02T10:35:27",
    "name": "[v8,21/21] net/cpfl: add xstats ops",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8969fee336cb6b16643d55f8b470192a0e6413a6",
    "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/20230302103527.931071-22-mingxia.liu@intel.com/mbox/",
    "series": [
        {
            "id": 27215,
            "url": "http://patches.dpdk.org/api/series/27215/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27215",
            "date": "2023-03-02T10:35:06",
            "name": "add support for cpfl PMD in DPDK",
            "version": 8,
            "mbox": "http://patches.dpdk.org/series/27215/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/124659/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/124659/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 DAFBF41DB0;\n\tThu,  2 Mar 2023 03:23:24 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id ED26042DAD;\n\tThu,  2 Mar 2023 03:21:11 +0100 (CET)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n by mails.dpdk.org (Postfix) with ESMTP id DC6D842D3D\n for <dev@dpdk.org>; Thu,  2 Mar 2023 03:21:08 +0100 (CET)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 01 Mar 2023 18:21:08 -0800",
            "from dpdk-mingxial-ice.sh.intel.com ([10.67.110.191])\n by fmsmga002.fm.intel.com with ESMTP; 01 Mar 2023 18:21:07 -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=1677723669; x=1709259669;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=80cCRDQkzNs/4TgKVG1VXmX5mmKR1K/CF5+RU7tCryA=;\n b=KQpG1SQDhy5BhQ/vuV09TzeIFNUwCPNJLTaun1AlRXyZf81QMn+QAcaO\n eB1YlhJQ43D3P2HCW8agycdHG0idGgwPX4csCYAvVS4+JDVTKBqlTJXiZ\n r1/CeVpE33t5QupNHii02Hd3pjgaVPrxz/+4seMDIi6EKOmBqrJuBru/O\n ghLOaXKoWs/ObrO+VwkKsoRZhUDTXwizH4G10rZ3bQd24ZDa/bB3oRJrd\n TrZmu8kCdmNOl6ZtaELBnnQ6+JmCQ5oFau0FuE8MQFubvgL/WvyLtZoea\n X2AhfhYH1soCOzXigKumBg8bpbsANre/5BE93knW3VZDff7NFWmEB639I g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10636\"; a=\"315013620\"",
            "E=Sophos;i=\"5.98,226,1673942400\"; d=\"scan'208\";a=\"315013620\"",
            "E=McAfee;i=\"6500,9779,10636\"; a=\"784607686\"",
            "E=Sophos;i=\"5.98,226,1673942400\"; d=\"scan'208\";a=\"784607686\""
        ],
        "X-ExtLoop1": "1",
        "From": "Mingxia Liu <mingxia.liu@intel.com>",
        "To": "dev@dpdk.org,\n\tbeilei.xing@intel.com,\n\tyuying.zhang@intel.com",
        "Cc": "Mingxia Liu <mingxia.liu@intel.com>",
        "Subject": "[PATCH v8 21/21] net/cpfl: add xstats ops",
        "Date": "Thu,  2 Mar 2023 10:35:27 +0000",
        "Message-Id": "<20230302103527.931071-22-mingxia.liu@intel.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20230302103527.931071-1-mingxia.liu@intel.com>",
        "References": "<20230216003010.3439881-1-mingxia.liu@intel.com>\n <20230302103527.931071-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- dev_xstats_get\n- dev_xstats_get_names\n- dev_xstats_reset\n\nSigned-off-by: Mingxia Liu <mingxia.liu@intel.com>\n---\n drivers/net/cpfl/cpfl_ethdev.c | 78 ++++++++++++++++++++++++++++++++++\n 1 file changed, 78 insertions(+)",
    "diff": "diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c\nindex 87c591ae5c..0a971334c9 100644\n--- a/drivers/net/cpfl/cpfl_ethdev.c\n+++ b/drivers/net/cpfl/cpfl_ethdev.c\n@@ -97,6 +97,28 @@ 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\t\t\tRTE_DIM(rte_cpfl_stats_strings)\n \n static int\n cpfl_dev_link_update(struct rte_eth_dev *dev,\n@@ -312,6 +334,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 CPFL_NB_XSTATS;\n+\n+\tret = idpf_vc_stats_query(vport, &pstats);\n+\tif (ret) {\n+\t\tPMD_DRV_LOG(ERR, \"Get statistics failed\");\n+\t\treturn 0;\n+\t}\n+\n+\tidpf_vport_stats_update(&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;\n@@ -798,6 +873,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 int\n",
    "prefixes": [
        "v8",
        "21/21"
    ]
}