get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 123243,
    "url": "https://patches.dpdk.org/api/patches/123243/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230207101650.2402452-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": "<20230207101650.2402452-7-mingxia.liu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230207101650.2402452-7-mingxia.liu@intel.com",
    "date": "2023-02-07T10:16:50",
    "name": "[v6,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/20230207101650.2402452-7-mingxia.liu@intel.com/mbox/",
    "series": [
        {
            "id": 26847,
            "url": "https://patches.dpdk.org/api/series/26847/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=26847",
            "date": "2023-02-07T10:16:44",
            "name": "add idpf pmd enhancement features",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/26847/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/123243/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/123243/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 531EA41C2D;\n\tTue,  7 Feb 2023 12:14:42 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 866D8410F6;\n\tTue,  7 Feb 2023 12:14:30 +0100 (CET)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n by mails.dpdk.org (Postfix) with ESMTP id 7BA5A42D32\n for <dev@dpdk.org>; Tue,  7 Feb 2023 12:14:28 +0100 (CET)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 07 Feb 2023 03:14:28 -0800",
            "from dpdk-mingxial-01.sh.intel.com ([10.67.119.167])\n by fmsmga001.fm.intel.com with ESMTP; 07 Feb 2023 03:14:26 -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=1675768468; x=1707304468;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=5SpgYB3FmHaN8tZnXwxErbDxeI6/hbr+hGCN+xz2meE=;\n b=eOTU3O0imzG4hPMMljvsUyO/MNK2hQ1xcwhx58gtiqFXKqoCdRj3GMMS\n y+qMHNG2xtJJQlA836u6+oFLqx2tqKtLNhHAldB/GsYE2qAh2xmGA+xbT\n pOHaC1PLK9mWDDdOsyo1q/AsM8+QQ7vg5zqHvDNGMvzPQdyvKq4Lp5SfR\n uesZg/u29LCIYqsugp3kvAVs438Y+poAuibShVE5EpCfb298DQvmf8Cj3\n 4xJa3NCdIaCVRxZKemY2tD6bLOjFd5kOybS29LKy9P2A1nMK3G5aJgg+2\n eikQN2nubmwqLUCh38TEfZq/LLgJxxGp1IcXD/w1N4qzIBJulTsZBmpWp A==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10613\"; a=\"415699081\"",
            "E=Sophos;i=\"5.97,278,1669104000\"; d=\"scan'208\";a=\"415699081\"",
            "E=McAfee;i=\"6500,9779,10613\"; a=\"809486983\"",
            "E=Sophos;i=\"5.97,278,1669104000\"; d=\"scan'208\";a=\"809486983\""
        ],
        "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 v6 6/6] common/idpf: add xstats ops",
        "Date": "Tue,  7 Feb 2023 10:16:50 +0000",
        "Message-Id": "<20230207101650.2402452-7-mingxia.liu@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230207101650.2402452-1-mingxia.liu@intel.com>",
        "References": "<20230207100859.2401709-2-mingxia.liu@intel.com>\n <20230207101650.2402452-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 751c0d8717..38cbbf369d 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": [
        "v6",
        "6/6"
    ]
}