get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 31735,
    "url": "http://patches.dpdk.org/api/patches/31735/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1511890808-6072-5-git-send-email-erik.g.carrillo@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": "<1511890808-6072-5-git-send-email-erik.g.carrillo@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1511890808-6072-5-git-send-email-erik.g.carrillo@intel.com",
    "date": "2017-11-28T17:40:08",
    "name": "[dpdk-dev,RFC,v4,4/4] test: add event timer adapter auto-test",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "da7067573bafaeb375cc36a67bc6f4f15dd2360c",
    "submitter": {
        "id": 762,
        "url": "http://patches.dpdk.org/api/people/762/?format=api",
        "name": "Carrillo, Erik G",
        "email": "erik.g.carrillo@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1511890808-6072-5-git-send-email-erik.g.carrillo@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/31735/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/31735/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 701D52BE9;\n\tTue, 28 Nov 2017 18:41:38 +0100 (CET)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id 5703F28EE\n\tfor <dev@dpdk.org>; Tue, 28 Nov 2017 18:41:37 +0100 (CET)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t28 Nov 2017 09:41:36 -0800",
            "from txasoft-yocto.an.intel.com (HELO txasoft-yocto.an.intel.com.)\n\t([10.123.72.111])\n\tby orsmga002.jf.intel.com with ESMTP; 28 Nov 2017 09:41:35 -0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.44,468,1505804400\"; d=\"scan'208\";a=\"12993252\"",
        "From": "Erik Gabriel Carrillo <erik.g.carrillo@intel.com>",
        "To": "pbhagavatula@caviumnetworks.com",
        "Cc": "dev@dpdk.org, jerin.jacob@caviumnetworks.com, nipun.gupta@nxp.com,\n\themant.agrawal@nxp.com, nikhil.rao@intel.com",
        "Date": "Tue, 28 Nov 2017 11:40:08 -0600",
        "Message-Id": "<1511890808-6072-5-git-send-email-erik.g.carrillo@intel.com>",
        "X-Mailer": "git-send-email 1.7.10",
        "In-Reply-To": "<1511890808-6072-1-git-send-email-erik.g.carrillo@intel.com>",
        "References": "<1511217333-142455-1-git-send-email-erik.g.carrillo@intel.com>\n\t<1511890808-6072-1-git-send-email-erik.g.carrillo@intel.com>",
        "Subject": "[dpdk-dev] [RFC PATCH v4 4/4] test: add event timer adapter\n\tauto-test",
        "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 enough test infrastructure to exercise the\nallocation/deallocation routines of the event timer adapter library\nminimally.\n\nSigned-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>\n---\n test/test/Makefile                   |   1 +\n test/test/test_event_timer_adapter.c | 249 +++++++++++++++++++++++++++++++++++\n 2 files changed, 250 insertions(+)\n create mode 100644 test/test/test_event_timer_adapter.c",
    "diff": "diff --git a/test/test/Makefile b/test/test/Makefile\nindex bb54c98..9448aef 100644\n--- a/test/test/Makefile\n+++ b/test/test/Makefile\n@@ -210,6 +210,7 @@ ifeq ($(CONFIG_RTE_LIBRTE_EVENTDEV),y)\n SRCS-y += test_eventdev.c\n SRCS-y += test_event_ring.c\n SRCS-y += test_event_eth_rx_adapter.c\n+SRCS-y += test_event_timer_adapter.c\n SRCS-$(CONFIG_RTE_LIBRTE_PMD_SW_EVENTDEV) += test_eventdev_sw.c\n SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += test_eventdev_octeontx.c\n endif\ndiff --git a/test/test/test_event_timer_adapter.c b/test/test/test_event_timer_adapter.c\nnew file mode 100644\nindex 0000000..d0ea066\n--- /dev/null\n+++ b/test/test/test_event_timer_adapter.c\n@@ -0,0 +1,249 @@\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+#include <string.h>\n+\n+#include <rte_eventdev.h>\n+#include <rte_dev.h>\n+#include <rte_bus_vdev.h>\n+#include <rte_event_timer_adapter.h>\n+#include <rte_mempool.h>\n+#include <rte_errno.h>\n+#include <rte_service_component.h>\n+\n+#include \"test.h\"\n+\n+/* Example from RFC */\n+#define NB_TEST_EVENT_TIMERS 40000\n+\n+static int evdev;\n+//struct rte_event_timer_adapter *g_adapter;\n+struct rte_event_timer *g_evtimer;\n+struct rte_mempool *g_event_timer_pool;\n+\n+static inline void\n+devconf_set_default_sane_values(struct rte_event_dev_config *dev_conf,\n+\t\t\tstruct rte_event_dev_info *info)\n+{\n+\tmemset(dev_conf, 0, sizeof(struct rte_event_dev_config));\n+\tdev_conf->dequeue_timeout_ns = info->min_dequeue_timeout_ns;\n+\t/* Leave a port for the adapter to allocate */\n+\tdev_conf->nb_event_ports = info->max_event_ports - 1;\n+\tdev_conf->nb_event_queues = info->max_event_queues;\n+\tdev_conf->nb_event_queue_flows = info->max_event_queue_flows;\n+\tdev_conf->nb_event_port_dequeue_depth =\n+\t\t\tinfo->max_event_port_dequeue_depth;\n+\tdev_conf->nb_event_port_enqueue_depth =\n+\t\t\tinfo->max_event_port_enqueue_depth;\n+\tdev_conf->nb_event_port_enqueue_depth =\n+\t\t\tinfo->max_event_port_enqueue_depth;\n+\tdev_conf->nb_events_limit =\n+\t\t\tinfo->max_num_events;\n+}\n+\n+static int\n+configure_event_dev(void)\n+{\n+\tstruct rte_event_dev_config devconf;\n+\tint ret;\n+\tconst char *eventdev_name = \"event_sw0\";\n+\tstruct rte_event_dev_info info;\n+\tint i;\n+\n+\tevdev = rte_event_dev_get_dev_id(eventdev_name);\n+\tif (evdev < 0) {\n+\t\tif (rte_vdev_init(eventdev_name, NULL) < 0) {\n+\t\t\tprintf(\"Error creating eventdev\\n\");\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\t\tevdev = rte_event_dev_get_dev_id(eventdev_name);\n+\t\tif (evdev < 0) {\n+\t\t\tprintf(\"Error finding newly created eventdev\\n\");\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\t}\n+\n+\tret = rte_event_dev_info_get(evdev, &info);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to get event dev info\");\n+\n+\tdevconf_set_default_sane_values(&devconf, &info);\n+\n+\tret = rte_event_dev_configure(evdev, &devconf);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to configure eventdev\");\n+\n+\t/* Map the event_sw0 service to a service core */\n+\tret = rte_service_start_with_defaults();\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to start sw_evdev service\");\n+\n+\t/* Set up event queues */\n+\tuint32_t queue_count;\n+\tTEST_ASSERT_SUCCESS(rte_event_dev_attr_get(evdev,\n+\t\t\t    RTE_EVENT_DEV_ATTR_QUEUE_COUNT, &queue_count),\n+\t\t\t    \"Queue count get failed\");\n+\n+\tfor (i = 0; i < (int)queue_count; i++) {\n+\t\tret = rte_event_queue_setup(evdev, i, NULL);\n+\t\tTEST_ASSERT_SUCCESS(ret, \"Failed to setup queue=%d\", i);\n+\t}\n+\n+\t/* Set up event ports */\n+\tuint32_t port_count;\n+\tTEST_ASSERT_SUCCESS(rte_event_dev_attr_get(evdev,\n+\t\t\t    RTE_EVENT_DEV_ATTR_PORT_COUNT,\n+\t\t\t    &port_count), \"Port count get failed\");\n+\n+\tfor (i = 0; i < (int)port_count; i++) {\n+\t\tret = rte_event_port_setup(evdev, i, NULL);\n+\t\tTEST_ASSERT_SUCCESS(ret, \"Failed to setup port=%d\", i);\n+\t\t/* Link each queues to all ports */\n+\t\tret = rte_event_port_link(evdev, i, NULL, NULL, 0);\n+\t\tTEST_ASSERT(ret >= 0, \"Failed to link all queues port=%d\", i);\n+\t}\n+\n+\t/* Start the event device */\n+\tret = rte_event_dev_start(evdev);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to start device\");\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n+testsuite_setup(void)\n+{\n+\tint ret;\n+\n+\t/* Setup and start event device. */\n+\tret = configure_event_dev();\n+\tif (ret) {\n+\t\tprintf(\"Failed to configure event dev\\n\");\n+\t\treturn TEST_FAILED;\n+\t}\n+\n+\t/* Create a mempool of event timers. */\n+\tg_event_timer_pool = rte_mempool_create(\"event_timer_mempool\",\n+\t\t\t\t\t\tNB_TEST_EVENT_TIMERS,\n+\t\t\t\t\t\tsizeof(struct rte_event_timer),\n+\t\t\t\t\t\t0,\n+\t\t\t\t\t\t0,\n+\t\t\t\t\t\tNULL,\n+\t\t\t\t\t\tNULL,\n+\t\t\t\t\t\tNULL,\n+\t\t\t\t\t\tNULL,\n+\t\t\t\t\t\trte_socket_id(),\n+\t\t\t\t\t\t0);\n+\tif (g_event_timer_pool == NULL) {\n+\t\t/* Failed to create event timer mempool. */\n+\t\tprintf(\"Failed to configure event timer mempool: %s\\n\",\n+\t\t       rte_strerror(rte_errno));\n+\t\treturn TEST_FAILED;\n+\t}\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+static void\n+testsuite_teardown(void)\n+{\n+\t/* TODO: tear down adapter and evdev */\n+\n+\trte_mempool_free(g_event_timer_pool);\n+}\n+\n+#define NSECPERSEC 1E9  // No of ns for 1 sec\n+\n+static int\n+adapter_create_free(void)\n+{\n+\tint ret;\n+\tint adapter_id = 0;\n+\tstruct rte_event_timer_adapter *adapter;\n+\n+\tstruct rte_event_timer_adapter_conf conf = {\n+\t\t.event_dev_id = evdev,\n+\t\t.timer_adapter_id = adapter_id,\n+\t\t.clk_src = RTE_EVENT_TIMER_ADAPTER_CPU_CLK,\n+\t\t.timer_tick_ns = NSECPERSEC / 10,  // 100 milliseconds\n+\t\t.max_tmo_ns = 180 * NSECPERSEC,  // 2 minutes\n+\t\t.nb_timers = NB_TEST_EVENT_TIMERS,\n+\t\t.flags = 0,\n+\t};\n+\n+\tadapter = rte_event_timer_adapter_create(&conf);\n+\tif (adapter == NULL) {\n+\t\tprintf(\"Failed to create adapter\\n\");\n+\t\treturn TEST_FAILED;\n+\t}\n+\n+\t/* Move to separate tests later; just verify plugin connections for\n+\t * now\n+\t */\n+\n+\tstruct rte_event_timer_adapter_info adapter_info;\n+\tret = rte_event_timer_adapter_get_info(adapter, &adapter_info);\n+\tif (ret < 0)\n+\t\treturn TEST_FAILED;\n+\n+\tret = rte_event_timer_adapter_start(adapter);\n+\tif (ret < 0)\n+\t\treturn TEST_FAILED;\n+\n+\tret = rte_event_timer_adapter_stop(adapter);\n+\tif (ret < 0)\n+\t\treturn TEST_FAILED;\n+\n+\tret = rte_event_timer_adapter_free(adapter);\n+\tif (ret) {\n+\t\tprintf(\"Failed to free adapter\\n\");\n+\t\treturn TEST_FAILED;\n+\t}\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+static struct unit_test_suite adapter_tests  = {\n+\t.suite_name = \"event timer adapter test suite\",\n+\t.setup = testsuite_setup,\n+\t.teardown = testsuite_teardown,\n+\t.unit_test_cases = {\n+\t\tTEST_CASE(adapter_create_free),\n+\t\tTEST_CASES_END() /**< NULL terminate unit test array */\n+\t}\n+};\n+\n+static int\n+test_event_timer_adapter_common(void)\n+{\n+\treturn unit_test_suite_runner(&adapter_tests);\n+}\n+\n+REGISTER_TEST_COMMAND(event_timer_adapter_autotest,\n+\t\t      test_event_timer_adapter_common);\n",
    "prefixes": [
        "dpdk-dev",
        "RFC",
        "v4",
        "4/4"
    ]
}