get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 94891,
    "url": "https://patches.dpdk.org/api/patches/94891/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/0cee35826f4c7a10cd867c463e0828e8c79282a6.1624884053.git.anatoly.burakov@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": "<0cee35826f4c7a10cd867c463e0828e8c79282a6.1624884053.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/0cee35826f4c7a10cd867c463e0828e8c79282a6.1624884053.git.anatoly.burakov@intel.com",
    "date": "2021-06-28T12:41:08",
    "name": "[v3,2/7] net/af_xdp: add power monitor support",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0fae63664450bfdf49f267604e0378367d7f1e48",
    "submitter": {
        "id": 4,
        "url": "https://patches.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "email": "anatoly.burakov@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/0cee35826f4c7a10cd867c463e0828e8c79282a6.1624884053.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 17501,
            "url": "https://patches.dpdk.org/api/series/17501/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=17501",
            "date": "2021-06-28T12:41:06",
            "name": "Enhancements for PMD power management",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/17501/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/94891/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/94891/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 50FD0A0C3F;\n\tMon, 28 Jun 2021 14:41:29 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 278B841137;\n\tMon, 28 Jun 2021 14:41:24 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by mails.dpdk.org (Postfix) with ESMTP id 0E9A041121\n for <dev@dpdk.org>; Mon, 28 Jun 2021 14:41:19 +0200 (CEST)",
            "from fmsmga005.fm.intel.com ([10.253.24.32])\n by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 28 Jun 2021 05:41:19 -0700",
            "from silpixa00399498.ir.intel.com (HELO\n silpixa00399498.ger.corp.intel.com) ([10.237.223.53])\n by fmsmga005.fm.intel.com with ESMTP; 28 Jun 2021 05:41:18 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10028\"; a=\"207761720\"",
            "E=Sophos;i=\"5.83,306,1616482800\"; d=\"scan'208\";a=\"207761720\"",
            "E=Sophos;i=\"5.83,306,1616482800\"; d=\"scan'208\";a=\"643319581\""
        ],
        "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",
        "Date": "Mon, 28 Jun 2021 12:41:08 +0000",
        "Message-Id": "\n <0cee35826f4c7a10cd867c463e0828e8c79282a6.1624884053.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<cover.1624884053.git.anatoly.burakov@intel.com>",
        "References": "<cover.1624629506.git.anatoly.burakov@intel.com>\n <cover.1624884053.git.anatoly.burakov@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v3 2/7] 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    v2:\n    - Rewrite using the callback mechanism\n\n drivers/net/af_xdp/rte_eth_af_xdp.c | 33 +++++++++++++++++++++++++++++\n 1 file changed, 33 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..8b9c89c3e8 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,37 @@ 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, const uint64_t opaque[4])\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 +1480,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": [
        "v3",
        "2/7"
    ]
}