get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 101739,
    "url": "https://patches.dpdk.org/api/patches/101739/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20211015170911.478394-2-miao.li@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": "<20211015170911.478394-2-miao.li@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211015170911.478394-2-miao.li@intel.com",
    "date": "2021-10-15T17:09:07",
    "name": "[v6,1/5] net/virtio: implement rte_power_monitor API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8e69197f550a2f6119869e32946db4599717b40f",
    "submitter": {
        "id": 2220,
        "url": "https://patches.dpdk.org/api/people/2220/?format=api",
        "name": "Li, Miao",
        "email": "miao.li@intel.com"
    },
    "delegate": {
        "id": 2642,
        "url": "https://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20211015170911.478394-2-miao.li@intel.com/mbox/",
    "series": [
        {
            "id": 19684,
            "url": "https://patches.dpdk.org/api/series/19684/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=19684",
            "date": "2021-10-15T17:09:06",
            "name": "Implement rte_power_monitor API in virtio/vhost PMD",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/19684/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/101739/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/101739/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 C0CE5A0C4B;\n\tFri, 15 Oct 2021 11:07:53 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A6570410F1;\n\tFri, 15 Oct 2021 11:07:53 +0200 (CEST)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n by mails.dpdk.org (Postfix) with ESMTP id B193A40041\n for <dev@dpdk.org>; Fri, 15 Oct 2021 11:07:52 +0200 (CEST)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 15 Oct 2021 02:07:51 -0700",
            "from limiao-icelake.sh.intel.com ([10.67.115.199])\n by orsmga005.jf.intel.com with ESMTP; 15 Oct 2021 02:07:32 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10137\"; a=\"314077386\"",
            "E=Sophos;i=\"5.85,375,1624345200\"; d=\"scan'208\";a=\"314077386\"",
            "E=Sophos;i=\"5.85,375,1624345200\"; d=\"scan'208\";a=\"660460367\""
        ],
        "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, 15 Oct 2021 17:09:07 +0000",
        "Message-Id": "<20211015170911.478394-2-miao.li@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20211015170911.478394-1-miao.li@intel.com>",
        "References": "<20211015151223.425847-1-miao.li@intel.com>\n <20211015170911.478394-1-miao.li@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v6 1/5] net/virtio: implement rte_power_monitor\n 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 virtio 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\nvirtio_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>\nReviewed-by: Chenbo Xia <chenbo.xia@intel.com>\n---\n doc/guides/rel_notes/release_21_11.rst |  4 ++\n drivers/net/virtio/virtio_ethdev.c     | 56 ++++++++++++++++++++++++++\n 2 files changed, 60 insertions(+)",
    "diff": "diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst\nindex 4c56cdfeaa..27dc896703 100644\n--- a/doc/guides/rel_notes/release_21_11.rst\n+++ b/doc/guides/rel_notes/release_21_11.rst\n@@ -72,6 +72,10 @@ New Features\n   Added macros ETH_RSS_IPV4_CHKSUM and ETH_RSS_L4_CHKSUM, now IPv4 and\n   TCP/UDP/SCTP header checksum field can be used as input set for RSS.\n \n+* **Updated virtio PMD.**\n+\n+  Implement rte_power_monitor API in virtio PMD.\n+\n * **Updated af_packet ethdev driver.**\n \n   * Default VLAN strip behavior was changed. VLAN tag won't be stripped\ndiff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c\nindex 6aa36b3f39..1227f3f1f4 100644\n--- a/drivers/net/virtio/virtio_ethdev.c\n+++ b/drivers/net/virtio/virtio_ethdev.c\n@@ -74,6 +74,8 @@ static int virtio_mac_addr_set(struct rte_eth_dev *dev,\n \t\t\t\tstruct rte_ether_addr *mac_addr);\n \n static int virtio_intr_disable(struct rte_eth_dev *dev);\n+static int virtio_get_monitor_addr(void *rx_queue,\n+\t\t\t\tstruct rte_power_monitor_cond *pmc);\n \n static int virtio_dev_queue_stats_mapping_set(\n \tstruct rte_eth_dev *eth_dev,\n@@ -982,6 +984,7 @@ static const struct eth_dev_ops virtio_eth_dev_ops = {\n \t.mac_addr_add            = virtio_mac_addr_add,\n \t.mac_addr_remove         = virtio_mac_addr_remove,\n \t.mac_addr_set            = virtio_mac_addr_set,\n+\t.get_monitor_addr        = virtio_get_monitor_addr,\n };\n \n /*\n@@ -1313,6 +1316,59 @@ virtio_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr)\n \treturn 0;\n }\n \n+#define CLB_VAL_IDX 0\n+#define CLB_MSK_IDX 1\n+#define CLB_MATCH_IDX 2\n+static int\n+virtio_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+\tconst uint64_t c = opaque[CLB_MATCH_IDX];\n+\n+\tif (c)\n+\t\treturn (value & m) == v ? -1 : 0;\n+\telse\n+\t\treturn (value & m) == v ? 0 : -1;\n+}\n+\n+static int\n+virtio_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc)\n+{\n+\tstruct virtnet_rx *rxvq = rx_queue;\n+\tstruct virtqueue *vq = virtnet_rxq_to_vq(rxvq);\n+\tstruct virtio_hw *hw;\n+\n+\tif (vq == NULL)\n+\t\treturn -EINVAL;\n+\n+\thw = vq->hw;\n+\tif (virtio_with_packed_queue(hw)) {\n+\t\tstruct vring_packed_desc *desc;\n+\t\tdesc = vq->vq_packed.ring.desc;\n+\t\tpmc->addr = &desc[vq->vq_used_cons_idx].flags;\n+\t\tif (vq->vq_packed.used_wrap_counter)\n+\t\t\tpmc->opaque[CLB_VAL_IDX] =\n+\t\t\t\t\t\tVRING_PACKED_DESC_F_AVAIL_USED;\n+\t\telse\n+\t\t\tpmc->opaque[CLB_VAL_IDX] = 0;\n+\t\tpmc->opaque[CLB_MSK_IDX] = VRING_PACKED_DESC_F_AVAIL_USED;\n+\t\tpmc->opaque[CLB_MATCH_IDX] = 1;\n+\t\tpmc->size = sizeof(desc[vq->vq_used_cons_idx].flags);\n+\t} else {\n+\t\tpmc->addr = &vq->vq_split.ring.used->idx;\n+\t\tpmc->opaque[CLB_VAL_IDX] = vq->vq_used_cons_idx\n+\t\t\t\t\t& (vq->vq_nentries - 1);\n+\t\tpmc->opaque[CLB_MSK_IDX] = vq->vq_nentries - 1;\n+\t\tpmc->opaque[CLB_MATCH_IDX] = 0;\n+\t\tpmc->size = sizeof(vq->vq_split.ring.used->idx);\n+\t}\n+\tpmc->fn = virtio_monitor_callback;\n+\n+\treturn 0;\n+}\n+\n static int\n virtio_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)\n {\n",
    "prefixes": [
        "v6",
        "1/5"
    ]
}