get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 95608,
    "url": "http://patches.dpdk.org/api/patches/95608/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/464587e35e60aa914cc0f0cab6481a09570b3d87.1625845967.git.anatoly.burakov@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": "<464587e35e60aa914cc0f0cab6481a09570b3d87.1625845967.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/464587e35e60aa914cc0f0cab6481a09570b3d87.1625845967.git.anatoly.burakov@intel.com",
    "date": "2021-07-09T15:53:22",
    "name": "[v9,2/8] net/af_xdp: add power monitor support",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "10f9c23f8c71686dd6fd23aad5bfeaed7f36b0cc",
    "submitter": {
        "id": 4,
        "url": "http://patches.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "email": "anatoly.burakov@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/464587e35e60aa914cc0f0cab6481a09570b3d87.1625845967.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 17742,
            "url": "http://patches.dpdk.org/api/series/17742/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=17742",
            "date": "2021-07-09T15:53:22",
            "name": "Enhancements for PMD power management",
            "version": 9,
            "mbox": "http://patches.dpdk.org/series/17742/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/95608/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/95608/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 86E75A0548;\n\tFri,  9 Jul 2021 17:53:55 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 558FE410F9;\n\tFri,  9 Jul 2021 17:53:55 +0200 (CEST)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n by mails.dpdk.org (Postfix) with ESMTP id 4D8D54014D\n for <dev@dpdk.org>; Fri,  9 Jul 2021 17:53:52 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 09 Jul 2021 08:53:35 -0700",
            "from silpixa00399498.ir.intel.com (HELO\n silpixa00399498.ger.corp.intel.com) ([10.237.223.53])\n by fmsmga001.fm.intel.com with ESMTP; 09 Jul 2021 08:53:34 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10039\"; a=\"270836220\"",
            "E=Sophos;i=\"5.84,226,1620716400\"; d=\"scan'208\";a=\"270836220\"",
            "E=Sophos;i=\"5.84,226,1620716400\"; d=\"scan'208\";a=\"566031015\""
        ],
        "X-ExtLoop1": "1",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org, Ciara Loftus <ciara.loftus@intel.com>,\n Qi Zhang <qi.z.zhang@intel.com>",
        "Cc": "david.hunt@intel.com,\n\tkonstantin.ananyev@intel.com",
        "Date": "Fri,  9 Jul 2021 15:53:22 +0000",
        "Message-Id": "\n <464587e35e60aa914cc0f0cab6481a09570b3d87.1625845967.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<cover.1625845967.git.anatoly.burakov@intel.com>",
        "References": "<cover.1625753585.git.anatoly.burakov@intel.com>\n <cover.1625845967.git.anatoly.burakov@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v9 2/8] net/af_xdp: add power monitor support",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Implement support for .get_monitor_addr in AF_XDP driver.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n\nNotes:\n    v8:\n    - Fix checkpatch issue\n    \n    v2:\n    - Rewrite using the callback mechanism\n\n drivers/net/af_xdp/rte_eth_af_xdp.c | 34 +++++++++++++++++++++++++++++\n 1 file changed, 34 insertions(+)",
    "diff": "diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c\nindex eb5660a3dc..989051dd6d 100644\n--- a/drivers/net/af_xdp/rte_eth_af_xdp.c\n+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c\n@@ -37,6 +37,7 @@\n #include <rte_malloc.h>\n #include <rte_ring.h>\n #include <rte_spinlock.h>\n+#include <rte_power_intrinsics.h>\n \n #include \"compat.h\"\n \n@@ -788,6 +789,38 @@ eth_dev_configure(struct rte_eth_dev *dev)\n \treturn 0;\n }\n \n+#define CLB_VAL_IDX 0\n+static int\n+eth_monitor_callback(const uint64_t value,\n+\t\tconst uint64_t opaque[RTE_POWER_MONITOR_OPAQUE_SZ])\n+{\n+\tconst uint64_t v = opaque[CLB_VAL_IDX];\n+\tconst uint64_t m = (uint32_t)~0;\n+\n+\t/* if the value has changed, abort entering power optimized state */\n+\treturn (value & m) == v ? 0 : -1;\n+}\n+\n+static int\n+eth_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc)\n+{\n+\tstruct pkt_rx_queue *rxq = rx_queue;\n+\tunsigned int *prod = rxq->rx.producer;\n+\tconst uint32_t cur_val = rxq->rx.cached_prod; /* use cached value */\n+\n+\t/* watch for changes in producer ring */\n+\tpmc->addr = (void *)prod;\n+\n+\t/* store current value */\n+\tpmc->opaque[CLB_VAL_IDX] = cur_val;\n+\tpmc->fn = eth_monitor_callback;\n+\n+\t/* AF_XDP producer ring index is 32-bit */\n+\tpmc->size = sizeof(uint32_t);\n+\n+\treturn 0;\n+}\n+\n static int\n eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)\n {\n@@ -1448,6 +1481,7 @@ static const struct eth_dev_ops ops = {\n \t.link_update = eth_link_update,\n \t.stats_get = eth_stats_get,\n \t.stats_reset = eth_stats_reset,\n+\t.get_monitor_addr = eth_get_monitor_addr\n };\n \n /** parse busy_budget argument */\n",
    "prefixes": [
        "v9",
        "2/8"
    ]
}