get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 30733,
    "url": "http://patches.dpdk.org/api/patches/30733/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1508779012-56186-3-git-send-email-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": "<1508779012-56186-3-git-send-email-harry.van.haaren@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1508779012-56186-3-git-send-email-harry.van.haaren@intel.com",
    "date": "2017-10-23T17:16:52",
    "name": "[dpdk-dev,2/2] service: add runtime service core check disable",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "91bfa2a42f3731232365e5434913b9d4cf2857e3",
    "submitter": {
        "id": 317,
        "url": "http://patches.dpdk.org/api/people/317/?format=api",
        "name": "Van Haaren, Harry",
        "email": "harry.van.haaren@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1508779012-56186-3-git-send-email-harry.van.haaren@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/30733/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/30733/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 3B3E01B69F;\n\tMon, 23 Oct 2017 19:16:45 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id A89DD1B68B\n\tfor <dev@dpdk.org>; Mon, 23 Oct 2017 19:16:38 +0200 (CEST)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t23 Oct 2017 10:16:37 -0700",
            "from silpixa00398672.ir.intel.com ([10.237.223.128])\n\tby FMSMGA003.fm.intel.com with ESMTP; 23 Oct 2017 10:16:36 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.43,424,1503385200\"; d=\"scan'208\";a=\"912830319\"",
        "From": "Harry van Haaren <harry.van.haaren@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "pbhagavatula@caviumnetworks.com,\n\tHarry van Haaren <harry.van.haaren@intel.com>",
        "Date": "Mon, 23 Oct 2017 18:16:52 +0100",
        "Message-Id": "<1508779012-56186-3-git-send-email-harry.van.haaren@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1508779012-56186-1-git-send-email-harry.van.haaren@intel.com>",
        "References": "<1508779012-56186-1-git-send-email-harry.van.haaren@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 2/2] service: add runtime service core check\n\tdisable",
        "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 function to disable the runtime mapped\nservice-cores check. This allows an application to take responsibility\nof running unmapped services.\n\nThis feature is useful in cases like unit tests, where the application\ncode (or unit test in this case) requires accurate control over when\nthe service function is called to ensure correct behaviour, and when\nan application has an advanced use-case and wishes to manage services\nmanually.\n\nSigned-off-by: Harry van Haaren <harry.van.haaren@intel.com>\n---\n lib/librte_eal/bsdapp/eal/rte_eal_version.map   |  1 +\n lib/librte_eal/common/include/rte_service.h     | 23 ++++++++++++++++++++++-\n lib/librte_eal/common/rte_service.c             | 22 ++++++++++++++++++++--\n lib/librte_eal/linuxapp/eal/rte_eal_version.map |  1 +\n 4 files changed, 44 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map\nindex ee8dc98..80817a5 100644\n--- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map\n+++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map\n@@ -232,6 +232,7 @@ EXPERIMENTAL {\n \trte_service_run_iter_on_app_lcore;\n \trte_service_runstate_get;\n \trte_service_runstate_set;\n+\trte_service_set_runstate_mapped_check;\n \trte_service_set_stats_enable;\n \trte_service_start_with_defaults;\n \ndiff --git a/lib/librte_eal/common/include/rte_service.h b/lib/librte_eal/common/include/rte_service.h\nindex 63d3170..75faafe 100644\n--- a/lib/librte_eal/common/include/rte_service.h\n+++ b/lib/librte_eal/common/include/rte_service.h\n@@ -199,7 +199,12 @@ int32_t rte_service_runstate_set(uint32_t id, uint32_t runstate);\n  * @b EXPERIMENTAL: this API may change without prior notice\n  *\n  * Get the runstate for the service with *id*. See *rte_service_runstate_set*\n- * for details of runstates.\n+ * for details of runstates. A service can call this function to ensure that\n+ * the application has indicated that it will receive CPU cycles. Either a\n+ * service-core is mapped (default case), or the application has explicitly\n+ * disabled the check that a service-cores is mapped to the service and takes\n+ * responsibility to run the service manually using the available function\n+ * *rte_service_run_iter_on_app_lcore* to do so.\n  *\n  * @retval 1 Service is running\n  * @retval 0 Service is stopped\n@@ -211,6 +216,22 @@ int32_t rte_service_runstate_get(uint32_t id);\n  * @warning\n  * @b EXPERIMENTAL: this API may change without prior notice\n  *\n+ * Enable or disable the check for a service-core being mapped to the service.\n+ * An application can disable the check when takes the responsibility to run a\n+ * service itself using *rte_service_run_iter_on_app_lcore*.\n+ *\n+ * @param id The id of the service to set the check on\n+ * @param enabled When zero, the check is disabled. Non-zero enables the check.\n+ *\n+ * @retval 0 Success\n+ * @retval -EINVAL Invalid service ID\n+ */\n+int32_t rte_service_set_runstate_mapped_check(uint32_t id, int32_t enabled);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n  * This function runs a service callback from a non-service lcore context.\n  * The *id* of the service to be run is passed in, and the service-callback\n  * is executed on the calling lcore immediately if possible. If the service is\ndiff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c\nindex 4e27f75..f17bf4b 100644\n--- a/lib/librte_eal/common/rte_service.c\n+++ b/lib/librte_eal/common/rte_service.c\n@@ -54,6 +54,7 @@\n \n #define SERVICE_F_REGISTERED    (1 << 0)\n #define SERVICE_F_STATS_ENABLED (1 << 1)\n+#define SERVICE_F_START_CHECK   (1 << 2)\n \n /* runstates for services and lcores, denoting if they are active or not */\n #define RUNSTATE_STOPPED 0\n@@ -180,6 +181,19 @@ int32_t rte_service_set_stats_enable(uint32_t id, int32_t enabled)\n \treturn 0;\n }\n \n+int32_t rte_service_set_runstate_mapped_check(uint32_t id, int32_t enabled)\n+{\n+\tstruct rte_service_spec_impl *s;\n+\tSERVICE_VALID_GET_OR_ERR_RET(id, s, 0);\n+\n+\tif (enabled)\n+\t\ts->internal_flags |= SERVICE_F_START_CHECK;\n+\telse\n+\t\ts->internal_flags &= ~(SERVICE_F_START_CHECK);\n+\n+\treturn 0;\n+}\n+\n uint32_t\n rte_service_get_count(void)\n {\n@@ -241,7 +255,7 @@ rte_service_component_register(const struct rte_service_spec *spec,\n \n \tstruct rte_service_spec_impl *s = &rte_services[free_slot];\n \ts->spec = *spec;\n-\ts->internal_flags |= SERVICE_F_REGISTERED;\n+\ts->internal_flags |= SERVICE_F_REGISTERED | SERVICE_F_START_CHECK;\n \n \trte_smp_wmb();\n \trte_service_count++;\n@@ -309,9 +323,13 @@ rte_service_runstate_get(uint32_t id)\n \tstruct rte_service_spec_impl *s;\n \tSERVICE_VALID_GET_OR_ERR_RET(id, s, -EINVAL);\n \trte_smp_rmb();\n+\n+\tint check_disabled = !(s->internal_flags & SERVICE_F_START_CHECK);\n+\tint lcore_mapped = (s->num_mapped_cores > 0);\n+\n \treturn (s->app_runstate == RUNSTATE_RUNNING) &&\n \t\t(s->comp_runstate == RUNSTATE_RUNNING) &&\n-\t\t(s->num_mapped_cores > 0);\n+\t\t(check_disabled | lcore_mapped);\n }\n \n static inline void\ndiff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map\nindex c4d2c27..afe66b3 100644\n--- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map\n+++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map\n@@ -236,6 +236,7 @@ EXPERIMENTAL {\n \trte_service_run_iter_on_app_lcore;\n \trte_service_runstate_get;\n \trte_service_runstate_set;\n+\trte_service_set_runstate_mapped_check;\n \trte_service_set_stats_enable;\n \trte_service_start_with_defaults;\n \n",
    "prefixes": [
        "dpdk-dev",
        "2/2"
    ]
}