get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 98542,
    "url": "http://patches.dpdk.org/api/patches/98542/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210910130548.127017-4-miao.li@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": "<20210910130548.127017-4-miao.li@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210910130548.127017-4-miao.li@intel.com",
    "date": "2021-09-10T13:05:46",
    "name": "[3/5] net/vhost: implement rte_power_monitor API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c8dc70cd1d174705ac72bd732ebc017deaa9c3c8",
    "submitter": {
        "id": 2220,
        "url": "http://patches.dpdk.org/api/people/2220/?format=api",
        "name": "Li, Miao",
        "email": "miao.li@intel.com"
    },
    "delegate": {
        "id": 2642,
        "url": "http://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210910130548.127017-4-miao.li@intel.com/mbox/",
    "series": [
        {
            "id": 18818,
            "url": "http://patches.dpdk.org/api/series/18818/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=18818",
            "date": "2021-09-10T13:05:43",
            "name": "CPU Enabling: Implement rte_power_monitor API in virtio/vhost PMD",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/18818/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/98542/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/98542/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 21A38A0547;\n\tFri, 10 Sep 2021 07:04:06 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5F64341121;\n\tFri, 10 Sep 2021 07:03:55 +0200 (CEST)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by mails.dpdk.org (Postfix) with ESMTP id 7668241104\n for <dev@dpdk.org>; Fri, 10 Sep 2021 07:03:54 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 09 Sep 2021 22:03:54 -0700",
            "from limiao-icelake.sh.intel.com ([10.67.115.199])\n by fmsmga002.fm.intel.com with ESMTP; 09 Sep 2021 22:03:52 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10102\"; a=\"208102011\"",
            "E=Sophos;i=\"5.85,282,1624345200\"; d=\"scan'208\";a=\"208102011\"",
            "E=Sophos;i=\"5.85,282,1624345200\"; d=\"scan'208\";a=\"549003929\""
        ],
        "X-ExtLoop1": "1",
        "From": "Miao Li <miao.li@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "chenbo.xia@intel.com,\n\tmaxime.coquelin@redhat.com,\n\tmiao.li@intel.com",
        "Date": "Fri, 10 Sep 2021 13:05:46 +0000",
        "Message-Id": "<20210910130548.127017-4-miao.li@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20210910130548.127017-1-miao.li@intel.com>",
        "References": "<20210910130548.127017-1-miao.li@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 3/5] net/vhost: implement rte_power_monitor API",
        "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": "This patch implements rte_power_monitor API in vhost PMD to reduce\npower consumption when no packet come in. According to current semantics\nof power monitor, this commit adds a callback function to decide whether\naborts the sleep by checking current value against the expected value and\nvhost_get_monitor_addr to provide address to monitor. When no packet come\nin, the value of address will not be changed and the running core will\nsleep. Once packets arrive, the value of address will be changed and the\nrunning core will wakeup.\n\nSigned-off-by: Miao Li <miao.li@intel.com>\n---\n drivers/net/vhost/rte_eth_vhost.c | 46 +++++++++++++++++++++++++++++++\n 1 file changed, 46 insertions(+)",
    "diff": "diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c\nindex a202931e9a..dd31761995 100644\n--- a/drivers/net/vhost/rte_eth_vhost.c\n+++ b/drivers/net/vhost/rte_eth_vhost.c\n@@ -1380,6 +1380,51 @@ eth_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)\n \treturn rte_vhost_rx_queue_count(vq->vid, vq->virtqueue_id);\n }\n \n+#define CLB_VAL_IDX 0\n+#define CLB_MSK_IDX 1\n+static int\n+vhost_packed_monitor_callback(const uint64_t value,\n+\t\tconst uint64_t opaque[RTE_POWER_MONITOR_OPAQUE_SZ])\n+{\n+\tconst uint64_t m = opaque[CLB_MSK_IDX];\n+\tconst uint64_t v = opaque[CLB_VAL_IDX];\n+\n+\treturn (value & m) == v ? -1 : 0;\n+}\n+\n+static int\n+vhost_split_monitor_callback(const uint64_t value,\n+\t\tconst uint64_t opaque[RTE_POWER_MONITOR_OPAQUE_SZ])\n+{\n+\tconst uint64_t m = opaque[CLB_MSK_IDX];\n+\tconst uint64_t v = opaque[CLB_VAL_IDX];\n+\n+\treturn (value & m) == v ? 0 : -1;\n+}\n+\n+static int\n+vhost_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc)\n+{\n+\tstruct vhost_queue *vq = rx_queue;\n+\tstruct rte_vhost_power_monitor_cond vhost_pmc;\n+\tint ret;\n+\tif (vq == NULL)\n+\t\treturn -EINVAL;\n+\tret = rte_vhost_get_monitor_addr(vq->vid, vq->virtqueue_id,\n+\t\t\t&vhost_pmc);\n+\tif (ret < 0)\n+\t\treturn -EINVAL;\n+\tpmc->addr = vhost_pmc.addr;\n+\tpmc->opaque[CLB_VAL_IDX] = vhost_pmc.val;\n+\tpmc->opaque[CLB_MSK_IDX] = vhost_pmc.mask;\n+\tif (vhost_pmc.flag & VHOST_POWER_MONITOR_RING_PACKED)\n+\t\tpmc->fn = vhost_packed_monitor_callback;\n+\telse\n+\t\tpmc->fn = vhost_split_monitor_callback;\n+\tpmc->size = sizeof(uint16_t);\n+\treturn 0;\n+}\n+\n static const struct eth_dev_ops ops = {\n \t.dev_start = eth_dev_start,\n \t.dev_stop = eth_dev_stop,\n@@ -1399,6 +1444,7 @@ static const struct eth_dev_ops ops = {\n \t.xstats_get_names = vhost_dev_xstats_get_names,\n \t.rx_queue_intr_enable = eth_rxq_intr_enable,\n \t.rx_queue_intr_disable = eth_rxq_intr_disable,\n+\t.get_monitor_addr        = vhost_get_monitor_addr,\n };\n \n static int\n",
    "prefixes": [
        "3/5"
    ]
}