get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 29587,
    "url": "https://patches.dpdk.org/api/patches/29587/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1507114491-144338-4-git-send-email-harry.van.haaren@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": "<1507114491-144338-4-git-send-email-harry.van.haaren@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1507114491-144338-4-git-send-email-harry.van.haaren@intel.com",
    "date": "2017-10-04T10:54:51",
    "name": "[dpdk-dev,3/3] service: add attribute for number of invokations",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "2cf3c26ef376ac12bbc7b228cbd184800219f27b",
    "submitter": {
        "id": 317,
        "url": "https://patches.dpdk.org/api/people/317/?format=api",
        "name": "Van Haaren, Harry",
        "email": "harry.van.haaren@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1507114491-144338-4-git-send-email-harry.van.haaren@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/29587/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/29587/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 950471B646;\n\tWed,  4 Oct 2017 12:54:35 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 022001B629\n\tfor <dev@dpdk.org>; Wed,  4 Oct 2017 12:54:31 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t04 Oct 2017 03:54:31 -0700",
            "from silpixa00398672.ir.intel.com ([10.237.223.128])\n\tby fmsmga002.fm.intel.com with ESMTP; 04 Oct 2017 03:54:30 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos; i=\"5.42,477,1500966000\"; d=\"scan'208\";\n\ta=\"1226897101\"",
        "From": "Harry van Haaren <harry.van.haaren@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Harry van Haaren <harry.van.haaren@intel.com>",
        "Date": "Wed,  4 Oct 2017 11:54:51 +0100",
        "Message-Id": "<1507114491-144338-4-git-send-email-harry.van.haaren@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1507114491-144338-1-git-send-email-harry.van.haaren@intel.com>",
        "References": "<1507114491-144338-1-git-send-email-harry.van.haaren@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 3/3] service: add attribute for number of\n\tinvokations",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<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 to the service cores attributes\nAPI, which allows the application to retrieve the number of times\nthat a service-core called the service to perform its action.\n\nSigned-off-by: Harry van Haaren <harry.van.haaren@intel.com>\n---\n lib/librte_eal/common/include/rte_service.h |  5 +++++\n lib/librte_eal/common/rte_service.c         |  3 +++\n test/test/test_service_cores.c              | 16 ++++++++++++++++\n 3 files changed, 24 insertions(+)",
    "diff": "diff --git a/lib/librte_eal/common/include/rte_service.h b/lib/librte_eal/common/include/rte_service.h\nindex bf7b50b..4684985 100644\n--- a/lib/librte_eal/common/include/rte_service.h\n+++ b/lib/librte_eal/common/include/rte_service.h\n@@ -366,6 +366,11 @@ int32_t rte_service_dump(FILE *f, uint32_t id);\n #define RTE_SERVICE_ATTR_CYCLES 0\n \n /**\n+ * Returns the count of invokations of this service function\n+ */\n+#define RTE_SERVICE_ATTR_CALL_COUNT 1\n+\n+/**\n  * @warning\n  * @b EXPERIMENTAL: this API may change without prior notice\n  *\ndiff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c\nindex 3f274f4..fe0b8cf 100644\n--- a/lib/librte_eal/common/rte_service.c\n+++ b/lib/librte_eal/common/rte_service.c\n@@ -657,6 +657,9 @@ rte_service_attr_get(uint32_t id, uint32_t attr_id, uint32_t *attr_value)\n \tcase RTE_SERVICE_ATTR_CYCLES:\n \t\t*attr_value = s->cycles_spent;\n \t\treturn 0;\n+\tcase RTE_SERVICE_ATTR_CALL_COUNT:\n+\t\t*attr_value = s->calls;\n+\t\treturn 0;\n \tdefault:\n \t\treturn -EINVAL;\n \t}\ndiff --git a/test/test/test_service_cores.c b/test/test/test_service_cores.c\nindex dd3bf75..cabf5de 100644\n--- a/test/test/test_service_cores.c\n+++ b/test/test/test_service_cores.c\n@@ -306,6 +306,12 @@ service_attr_get(void)\n \t\t\t\"Valid attr_get() call didn't return success\");\n \tTEST_ASSERT_EQUAL(0, attr_value,\n \t\t\t\"attr_get() call didn't set correct cycles (zero)\");\n+\t/* check correct call count */\n+\tconst int attr_calls = RTE_SERVICE_ATTR_CALL_COUNT;\n+\tTEST_ASSERT_EQUAL(0, rte_service_attr_get(id, attr_calls, &attr_value),\n+\t\t\t\"Valid attr_get() call didn't return success\");\n+\tTEST_ASSERT_EQUAL(0, attr_value,\n+\t\t\t\"attr_get() call didn't get call count (zero)\");\n \n \t/* Call service to increment cycle count */\n \tTEST_ASSERT_EQUAL(0, rte_service_lcore_add(slcore_id),\n@@ -326,6 +332,11 @@ service_attr_get(void)\n \n \trte_service_lcore_stop(slcore_id);\n \n+\tTEST_ASSERT_EQUAL(0, rte_service_attr_get(id, attr_calls, &attr_value),\n+\t\t\t\"Valid attr_get() call didn't return success\");\n+\tTEST_ASSERT_EQUAL(1, (attr_value > 0),\n+\t\t\t\"attr_get() call didn't get call count (zero)\");\n+\n \tTEST_ASSERT_EQUAL(0, rte_service_attr_reset_all(id),\n \t\t\t\"Valid attr_reset_all() return success\");\n \n@@ -333,6 +344,11 @@ service_attr_get(void)\n \t\t\t\"Valid attr_get() call didn't return success\");\n \tTEST_ASSERT_EQUAL(0, attr_value,\n \t\t\t\"attr_get() call didn't set correct cycles (zero)\");\n+\t/* ensure call count > zero */\n+\tTEST_ASSERT_EQUAL(0, rte_service_attr_get(id, attr_calls, &attr_value),\n+\t\t\t\"Valid attr_get() call didn't return success\");\n+\tTEST_ASSERT_EQUAL(0, (attr_value > 0),\n+\t\t\t\"attr_get() call didn't get call count (zero)\");\n \n \treturn unregister_all();\n }\n",
    "prefixes": [
        "dpdk-dev",
        "3/3"
    ]
}