get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 77630,
    "url": "http://patches.dpdk.org/api/patches/77630/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200914143732.87907-1-harry.van.haaren@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": "<20200914143732.87907-1-harry.van.haaren@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200914143732.87907-1-harry.van.haaren@intel.com",
    "date": "2020-09-14T14:37:31",
    "name": "[v2,1/2] service: add component useful work attribute",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "1bc3adc55c3a9760f871959b1bfcd11f6984c9e8",
    "submitter": {
        "id": 317,
        "url": "http://patches.dpdk.org/api/people/317/?format=api",
        "name": "Van Haaren, Harry",
        "email": "harry.van.haaren@intel.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200914143732.87907-1-harry.van.haaren@intel.com/mbox/",
    "series": [
        {
            "id": 12201,
            "url": "http://patches.dpdk.org/api/series/12201/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12201",
            "date": "2020-09-14T14:37:31",
            "name": "[v2,1/2] service: add component useful work attribute",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/12201/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/77630/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/77630/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 613F7A04C7;\n\tMon, 14 Sep 2020 16:36:22 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 46DAF1C0DB;\n\tMon, 14 Sep 2020 16:36:22 +0200 (CEST)",
            "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n by dpdk.org (Postfix) with ESMTP id 5C32F1C0D2\n for <dev@dpdk.org>; Mon, 14 Sep 2020 16:36:20 +0200 (CEST)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 14 Sep 2020 07:36:16 -0700",
            "from silpixa00399779.ir.intel.com (HELO\n silpixa00399779.ger.corp.intel.com) ([10.237.222.209])\n by orsmga003.jf.intel.com with ESMTP; 14 Sep 2020 07:36:14 -0700"
        ],
        "IronPort-SDR": [
            "\n 4yHoS9YDsnyAkeRvioiYW8tWGWfX7YBfjfA+wU2REgt/sw3QfgvxHDk10rxJ8qnvpHL7yHq7Ct\n pQN0eDQVZ6PQ==",
            "\n DToorJzHwCE9VJAwWu+kIohHVCq0KrWJVicvQfmbIvGygKe9WK5rN1R0Kxf3Wx3qP1ooGE8PAG\n lat2fy23Es+w=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9744\"; a=\"223269464\"",
            "E=Sophos;i=\"5.76,426,1592895600\"; d=\"scan'208\";a=\"223269464\"",
            "E=Sophos;i=\"5.76,426,1592895600\"; d=\"scan'208\";a=\"301770375\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Harry van Haaren <harry.van.haaren@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "david.marchand@dpdk.org,\n\tHarry van Haaren <harry.van.haaren@intel.com>",
        "Date": "Mon, 14 Sep 2020 15:37:31 +0100",
        "Message-Id": "<20200914143732.87907-1-harry.van.haaren@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20200907162149.31454-1-harry.van.haaren@intel.com>",
        "References": "<20200907162149.31454-1-harry.van.haaren@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 1/2] service: add component useful work\n\tattribute",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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 commit adds a new attribute which allows the service to indicate\nif the previous iteration of work was \"useful\". Useful work here implies\nforward progress was made.\n\nExposing this information via an attribute to the application allows\ntracking of CPU cycles as being useful or not-useful, and a CPU load\nestimate can be deduced from that information.\n\nSigned-off-by: Harry van Haaren <harry.van.haaren@intel.com>\n\n---\n\nv2:\n- Add experimental tag to new function.\n\n---\n lib/librte_eal/common/rte_service.c           | 19 +++++++++++++++++++\n lib/librte_eal/include/rte_service.h          |  5 +++++\n .../include/rte_service_component.h           | 13 +++++++++++++\n lib/librte_eal/rte_eal_version.map            |  3 +++\n 4 files changed, 40 insertions(+)",
    "diff": "diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c\nindex 6a0e0ff65d..f9792a138b 100644\n--- a/lib/librte_eal/common/rte_service.c\n+++ b/lib/librte_eal/common/rte_service.c\n@@ -58,6 +58,7 @@ struct rte_service_spec_impl {\n \tuint32_t num_mapped_cores;\n \tuint64_t calls;\n \tuint64_t cycles_spent;\n+\tuint8_t useful_work_last_iter;\n } __rte_cache_aligned;\n \n /* the internal values of a service core */\n@@ -293,6 +294,21 @@ rte_service_component_unregister(uint32_t id)\n \treturn 0;\n }\n \n+int32_t\n+rte_service_component_attr_set(uint32_t id, uint32_t attr, uint64_t value)\n+{\n+\tstruct rte_service_spec_impl *s;\n+\tSERVICE_VALID_GET_OR_ERR_RET(id, s, -EINVAL);\n+\n+\tswitch (attr) {\n+\tcase RTE_SERVICE_ATTR_USEFUL_WORK_LAST_ITER:\n+\t\ts->useful_work_last_iter = value;\n+\t\treturn 0;\n+\tdefault:\n+\t\treturn -EINVAL;\n+\t};\n+}\n+\n int32_t\n rte_service_component_runstate_set(uint32_t id, uint32_t runstate)\n {\n@@ -778,6 +794,9 @@ rte_service_attr_get(uint32_t id, uint32_t attr_id, uint64_t *attr_value)\n \t\treturn -EINVAL;\n \n \tswitch (attr_id) {\n+\tcase RTE_SERVICE_ATTR_USEFUL_WORK_LAST_ITER:\n+\t\t*attr_value = s->useful_work_last_iter;\n+\t\treturn 0;\n \tcase RTE_SERVICE_ATTR_CYCLES:\n \t\t*attr_value = s->cycles_spent;\n \t\treturn 0;\ndiff --git a/lib/librte_eal/include/rte_service.h b/lib/librte_eal/include/rte_service.h\nindex e2d0a6dd32..e9836a1a68 100644\n--- a/lib/librte_eal/include/rte_service.h\n+++ b/lib/librte_eal/include/rte_service.h\n@@ -370,6 +370,11 @@ int32_t rte_service_dump(FILE *f, uint32_t id);\n  */\n #define RTE_SERVICE_ATTR_CALL_COUNT 1\n \n+/**\n+ * Returns if the last iteration of the service resulted in useful work done.\n+ */\n+#define RTE_SERVICE_ATTR_USEFUL_WORK_LAST_ITER 2\n+\n /**\n  * Get an attribute from a service.\n  *\ndiff --git a/lib/librte_eal/include/rte_service_component.h b/lib/librte_eal/include/rte_service_component.h\nindex 9e66ee7e29..534f41f531 100644\n--- a/lib/librte_eal/include/rte_service_component.h\n+++ b/lib/librte_eal/include/rte_service_component.h\n@@ -87,6 +87,19 @@ int32_t rte_service_component_register(const struct rte_service_spec *spec,\n  */\n int32_t rte_service_component_unregister(uint32_t id);\n \n+/**\n+ * Set an attribute for this service.\n+ *\n+ * Note this API is to be called by the service implementation, to make the\n+ * statistic available via the usual attr_get() service APIs.\n+ *\n+ * @retval 0 Success\n+ * @retval -EINVAL Invalid service id or attribute provided\n+ */\n+__rte_experimental\n+int32_t rte_service_component_attr_set(uint32_t id, uint32_t attr,\n+\t\tuint64_t value);\n+\n /**\n  * Private function to allow EAL to initialized default mappings.\n  *\ndiff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map\nindex 0b18e2ef85..bb5e19ae9e 100644\n--- a/lib/librte_eal/rte_eal_version.map\n+++ b/lib/librte_eal/rte_eal_version.map\n@@ -397,6 +397,9 @@ EXPERIMENTAL {\n \trte_mp_disable;\n \trte_thread_register;\n \trte_thread_unregister;\n+\n+\t# added in 20.11\n+\trte_service_component_attr_set;\n };\n \n INTERNAL {\n",
    "prefixes": [
        "v2",
        "1/2"
    ]
}