get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 24072,
    "url": "http://patches.dpdk.org/api/patches/24072/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1493810961-139469-2-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": "<1493810961-139469-2-git-send-email-harry.van.haaren@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1493810961-139469-2-git-send-email-harry.van.haaren@intel.com",
    "date": "2017-05-03T11:29:21",
    "name": "[dpdk-dev,RFC] service core concept header implementation",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d3a2d620aa547127612ed96bae5aeb2fbc7636b8",
    "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/1493810961-139469-2-git-send-email-harry.van.haaren@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/24072/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/24072/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 4FFFC68F7;\n\tWed,  3 May 2017 13:29:20 +0200 (CEST)",
            "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n\tby dpdk.org (Postfix) with ESMTP id DFFFC68C1\n\tfor <dev@dpdk.org>; Wed,  3 May 2017 13:29:17 +0200 (CEST)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga105.jf.intel.com with ESMTP; 03 May 2017 04:29:17 -0700",
            "from silpixa00398672.ir.intel.com ([10.237.223.128])\n\tby FMSMGA003.fm.intel.com with ESMTP; 03 May 2017 04:29:15 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.38,283,1491289200\"; d=\"scan'208\";a=\"852388213\"",
        "From": "Harry van Haaren <harry.van.haaren@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Harry van Haaren <harry.van.haaren@intel.com>, bruce.richardson@intel.com,\n\themant.agrawal@nxp.com, nipun.gupta@nxp.com, narender.vangati@intel.com, \n\tjerin.jacob@caviumnetworks.com, gage.eads@intel.com",
        "Date": "Wed,  3 May 2017 12:29:21 +0100",
        "Message-Id": "<1493810961-139469-2-git-send-email-harry.van.haaren@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1493810961-139469-1-git-send-email-harry.van.haaren@intel.com>",
        "References": "<1493810961-139469-1-git-send-email-harry.van.haaren@intel.com>",
        "Subject": "[dpdk-dev] [RFC] service core concept header implementation",
        "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 patch adds a service header to DPDK EAL. This header is\nan RFC for a mechanism to allow DPDK components request a\ncallback function to be invoked.\n\nThe application can set the number of service cores, and\na coremask for each particular services. The implementation\nof this functionality in rte_services.c (not completed) would\nuse atomics to ensure that a service can only be polled by a\nsingle lcore at a time.\n\nSigned-off-by: Harry van Haaren <harry.van.haaren@intel.com>\n---\n lib/librte_eal/common/include/rte_service.h | 211 ++++++++++++++++++++++++++++\n 1 file changed, 211 insertions(+)\n create mode 100644 lib/librte_eal/common/include/rte_service.h",
    "diff": "diff --git a/lib/librte_eal/common/include/rte_service.h b/lib/librte_eal/common/include/rte_service.h\nnew file mode 100644\nindex 0000000..cfa26f3\n--- /dev/null\n+++ b/lib/librte_eal/common/include/rte_service.h\n@@ -0,0 +1,211 @@\n+/*\n+ *   BSD LICENSE\n+ *\n+ *   Copyright(c) 2017 Intel Corporation. All rights reserved.\n+ *\n+ *   Redistribution and use in source and binary forms, with or without\n+ *   modification, are permitted provided that the following conditions\n+ *   are met:\n+ *\n+ *     * Redistributions of source code must retain the above copyright\n+ *       notice, this list of conditions and the following disclaimer.\n+ *     * Redistributions in binary form must reproduce the above copyright\n+ *       notice, this list of conditions and the following disclaimer in\n+ *       the documentation and/or other materials provided with the\n+ *       distribution.\n+ *     * Neither the name of Intel Corporation nor the names of its\n+ *       contributors may be used to endorse or promote products derived\n+ *       from this software without specific prior written permission.\n+ *\n+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#ifndef _RTE_SERVICE_H_\n+#define _RTE_SERVICE_H_\n+\n+/**\n+ * @file\n+ *\n+ * Service functions\n+ *\n+ * The service functionality provided by this header allows a DPDK component\n+ * to indicate that it requires a function call in order for it to perform\n+ * its processing.\n+ *\n+ * An example usage of this functionality would be a component that registers\n+ * a service to perform a particular packet processing duty: for example the\n+ * eventdev software PMD. At startup the application requests all services\n+ * that have been registered, and the app decides how many cores will run the\n+ * required services. The EAL removes these number of cores from the available\n+ * runtime cores, and dedicates them to performing service-core workloads. The\n+ * application has access to the remaining lcores as normal.\n+ *\n+ * An example of the service core infrastructure with an application\n+ * configuring a single service (the eventdev sw PMD), and dedicating one core\n+ * exclusively to run the service would interact with the API as follows:\n+ *\n+ * 1. Eventdev SW PMD calls *rte_eal_service_register*, indicating that it\n+ *    requires an lcore to call a function in order to operate. EAL registers\n+ *    this service, but performs no other actions yet.\n+ *\n+ * 2. Application calls *rte_eal_service_get*, allowing EAL to provide it\n+ *    with an array of *rte_service_config* structures. These structures\n+ *    provide the application with the name of the service, along with\n+ *    metadata provided by the service when it was registered.\n+ *\n+ * 3. The application logic iterates over the services that require running,\n+ *    and decides to run the eventdev sw PMD service using one lcore.\n+ *\n+ * 4. The application calls *rte_eal_service_use_lcore* multiple times, once\n+ *    for each lcore that should be used as a service core. These cores are\n+ *    removed from the application usage, and EAL will refuse to launch\n+ *    user-specified functions on these cores.\n+ *\n+ * 5. The application calls *rte_eal_service_set_coremask* to set the coremask\n+ *    for the service. Note that EAL is already aware of ALL lcores that will\n+ *    be used for service-core purposes (see step 4 above) which allows EAL to\n+ *    error-check the coremask here, and ensure at least one core is going to\n+ *    be running the service.\n+ *\n+ * 6. The application now calls remote_launch() as usual, and the application\n+ *    can perform its processing as required without manually handling the\n+ *    partitioning of lcore resources for DPDK functionality.\n+ */\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+#include <stdint.h>\n+\n+#define RTE_SERVICE_NAMESIZE 32\n+\n+/**\n+ * Signature of callback back function to run a service.\n+ */\n+typedef void (*rte_eal_service_func)(void *args);\n+\n+struct rte_service_config {\n+\t/* name of the service */\n+\tchar name[RTE_SERVICE_NAMESIZE];\n+\t/* cores that run this service */\n+\tuint64_t coremask;\n+\t/* when set, multiple lcores can run this service simultaneously without\n+\t * the need for software atomics to ensure that two cores do not\n+\t * attempt to run the service at the same time.\n+\t */\n+\tuint8_t multithread_capable;\n+};\n+\n+/** @internal - this will not be visible to application, defined in a seperate\n+ * rte_eal_service_impl.h header. The application does not need to be exposed\n+ * to the actual function pointers - so hide them. */\n+struct rte_service {\n+\t/* callback to be called to run the service */\n+\trte_eal_service_func cb;\n+\t/* args to the callback function */\n+\tvoid *cb_args;\n+\t/* configuration of the service */\n+\tstruct rte_service_config config;\n+};\n+\n+/**\n+ * @internal - Only DPDK internal components request \"service\" cores.\n+ *\n+ * Registers a service in EAL.\n+ *\n+ * Registered services' configurations are exposed to an application using\n+ * *rte_eal_service_get_all*. These services have names which can be understood\n+ * by the application, and the application logic can decide how to allocate\n+ * cores to run the various services.\n+ *\n+ * This function is expected to be called by a DPDK component to indicate that\n+ * it require a CPU to run a specific function in order for it to perform its\n+ * processing. An example of such a component is the eventdev software PMD.\n+ *\n+ * The config struct should be filled in as appropriate by the PMD. For example\n+ * the name field should include some level of detail (e.g. \"ethdev_p1_rx_q3\"\n+ * might mean RX from an ethdev from port 1, on queue 3).\n+ *\n+ * @param service\n+ *   The service structure to be registered with EAL.\n+ *\n+ * @return\n+ *   On success, zero\n+ *   On failure, a negative error\n+ */\n+int rte_eal_service_register(const struct rte_service *service);\n+\n+/**\n+ * Get the count of services registered in the EAL.\n+ *\n+ * @return the number of services registered with EAL.\n+ */\n+uint32_t rte_eal_service_get_count();\n+\n+/**\n+ * Writes all registered services to the application supplied array.\n+ *\n+ * This function can be used by the application to understand if and what\n+ * services require running. Each service provides a config struct exposing\n+ * attributes of the service, which can be used by the application to decide on\n+ * its strategy of running services on cores.\n+ *\n+ * @param service_config\n+ *   An array of service config structures to be filled in\n+ *\n+ * @param n\n+ *   The size of the service config array\n+ *\n+ * @return 0 on successful providing all service configs\n+ *         -ENOSPC if array passed in is too small\n+ */\n+int rte_eal_service_get_all(const struct rte_service_config *service_config,\n+\t\t\t    uint32_t n);\n+\n+/**\n+ * Use *lcore_id* as a service core.\n+ *\n+ * EAL will internally remove *lcore_id* from the application accessible\n+ * core list. As a result, the application will never have its code run on\n+ * the service core, making the service cores totally transparent to an app.\n+ *\n+ * This function should be called before *rte_eal_service_set_coremask* so that\n+ * when setting the core mask the value can be error checked to ensure that EAL\n+ * has an lcore backing the coremask specified.\n+ */\n+int rte_eal_service_use_lcore(uint16_t lcore_id);\n+\n+/**\n+ * Set a coremask for a service.\n+ *\n+ * A configuration for a service indicates which cores run the service, and\n+ * what other parameters are required to correclty handle the underlying device.\n+ *\n+ * Examples of advanced usage might be a HW device that supports multiple lcores\n+ * transmitting packets on the same queue - the hardware provides a mechanism\n+ * for multithreaded enqueue. In this case, the atomic_\n+ *\n+ * @return 0 Success\n+ *         -ENODEV   Device with *name* does not exist\n+ *         -ENOTSUP  Configuration is un-supported\n+ */\n+int rte_eal_service_set_coremask(const char *name, uint64_t coremask);\n+\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+\n+#endif /* _RTE_SERVICE_H_ */\n",
    "prefixes": [
        "dpdk-dev",
        "RFC"
    ]
}