get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 123230,
    "url": "https://patches.dpdk.org/api/patches/123230/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230207095701.2400179-7-mingxia.liu@intel.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": "<20230207095701.2400179-7-mingxia.liu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230207095701.2400179-7-mingxia.liu@intel.com",
    "date": "2023-02-07T09:57:01",
    "name": "[v4,6/6] common/idpf: add xstats ops",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d4522e290bee56b3d136ce70f1b5262238de1046",
    "submitter": {
        "id": 2514,
        "url": "https://patches.dpdk.org/api/people/2514/?format=api",
        "name": "Liu, Mingxia",
        "email": "mingxia.liu@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "https://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20230207095701.2400179-7-mingxia.liu@intel.com/mbox/",
    "series": [
        {
            "id": 26845,
            "url": "https://patches.dpdk.org/api/series/26845/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=26845",
            "date": "2023-02-07T09:56:55",
            "name": "add idpf pmd enhancement features",
            "version": 4,
            "mbox": "https://patches.dpdk.org/series/26845/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/123230/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/123230/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 848DD41C2D;\n\tTue,  7 Feb 2023 11:54:44 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 04DA942D67;\n\tTue,  7 Feb 2023 11:54:18 +0100 (CET)",
            "from mga06.intel.com (mga06b.intel.com [134.134.136.31])\n by mails.dpdk.org (Postfix) with ESMTP id 1662B42D53\n for <dev@dpdk.org>; Tue,  7 Feb 2023 11:54:14 +0100 (CET)",
            "from fmsmga008.fm.intel.com ([10.253.24.58])\n by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 07 Feb 2023 02:54:14 -0800",
            "from dpdk-mingxial-01.sh.intel.com ([10.67.119.167])\n by fmsmga008.fm.intel.com with ESMTP; 07 Feb 2023 02:54:13 -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=1675767255; x=1707303255;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=SOdOzO2xfcIaFh0APjGnFXEOVqZ8HAZAd5CeIOOrMIw=;\n b=cAZgWhbCz7Th/Btt+royMmH+I+gR4z4nLJm6AX1+etlenAei4X/CLyof\n uENWlf7XZtj3jYajqbgKHVxAGwIycO+s/HYvZk2jjB8JMWSwTlyWB6Hx6\n l8bfWymPsClcAn6SuFTbT9uXyJkTxOVyD5wmxAKjx4bweFVl/cGAAyP+U\n +sFiZoyGVgALhPqnNkQsXXu8SGvljXvpa76vy2MBFbOifu4Y4R4iJp2o1\n 9bB7+0OLCR6v4Dmbsb49OiO9t5dK8oVex1TGTzvzSRhX8gnYYb2GYYPwv\n NS3MZhNDzrz6jsbPoq/wFyEHDRvVa5BfW9nqSYm482Zl7crbSW+6tXKHY A==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10613\"; a=\"391873467\"",
            "E=Sophos;i=\"5.97,278,1669104000\"; d=\"scan'208\";a=\"391873467\"",
            "E=McAfee;i=\"6500,9779,10613\"; a=\"730388599\"",
            "E=Sophos;i=\"5.97,278,1669104000\"; d=\"scan'208\";a=\"730388599\""
        ],
        "X-ExtLoop1": "1",
        "From": "Mingxia Liu <mingxia.liu@intel.com>",
        "To": "dev@dpdk.org, qi.z.zhang@intel.com, jingjing.wu@intel.com,\n beilei.xing@intel.com",
        "Cc": "Mingxia Liu <mingxia.liu@intel.com>",
        "Subject": "[PATCH v4 6/6] common/idpf: add xstats ops",
        "Date": "Tue,  7 Feb 2023 09:57:01 +0000",
        "Message-Id": "<20230207095701.2400179-7-mingxia.liu@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230207095701.2400179-1-mingxia.liu@intel.com>",
        "References": "<20230118071440.902155-1-mingxia.liu@intel.com>\n <20230207095701.2400179-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/idpf/idpf_ethdev.c | 80 ++++++++++++++++++++++++++++++++++\n 1 file changed, 80 insertions(+)",
    "diff": "diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c\nindex c3a9e95388..3f6230f5b6 100644\n--- a/drivers/net/idpf/idpf_ethdev.c\n+++ b/drivers/net/idpf/idpf_ethdev.c\n@@ -80,6 +80,30 @@ static const uint64_t idpf_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_idpf_xstats_name_off {\n+\tchar name[RTE_ETH_XSTATS_NAME_SIZE];\n+\tunsigned int offset;\n+};\n+\n+static const struct rte_idpf_xstats_name_off rte_idpf_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 IDPF_NB_XSTATS (sizeof(rte_idpf_stats_strings) / \\\n+\t\tsizeof(rte_idpf_stats_strings[0]))\n+\n static int\n idpf_dev_link_update(struct rte_eth_dev *dev,\n \t\t     __rte_unused int wait_to_complete)\n@@ -313,6 +337,59 @@ idpf_dev_stats_reset(struct rte_eth_dev *dev)\n \treturn 0;\n }\n \n+static int idpf_dev_xstats_reset(struct rte_eth_dev *dev)\n+{\n+\tidpf_dev_stats_reset(dev);\n+\treturn 0;\n+}\n+\n+static int idpf_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 < IDPF_NB_XSTATS)\n+\t\treturn IDPF_NB_XSTATS;\n+\n+\tif (!xstats)\n+\t\treturn 0;\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 < IDPF_NB_XSTATS; i++) {\n+\t\txstats[i].id = i;\n+\t\txstats[i].value = *(uint64_t *)(((char *)pstats) +\n+\t\t\trte_idpf_stats_strings[i].offset);\n+\t}\n+\treturn IDPF_NB_XSTATS;\n+}\n+\n+static int idpf_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 < IDPF_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_idpf_stats_strings[i].name);\n+\t\t}\n+\treturn IDPF_NB_XSTATS;\n+}\n+\n static int idpf_config_rss_hf(struct idpf_vport *vport, uint64_t rss_hf)\n {\n \tuint64_t hena = 0;\n@@ -1122,6 +1199,9 @@ static const struct eth_dev_ops idpf_eth_dev_ops = {\n \t.reta_query\t\t\t= idpf_rss_reta_query,\n \t.rss_hash_update\t\t= idpf_rss_hash_update,\n \t.rss_hash_conf_get\t\t= idpf_rss_hash_conf_get,\n+\t.xstats_get\t\t\t= idpf_dev_xstats_get,\n+\t.xstats_get_names\t\t= idpf_dev_xstats_get_names,\n+\t.xstats_reset\t\t\t= idpf_dev_xstats_reset,\n };\n \n static uint16_t\n",
    "prefixes": [
        "v4",
        "6/6"
    ]
}