Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/50864/?format=api
https://patches.dpdk.org/api/patches/50864/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190306150342.2894-5-gage.eads@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": "<20190306150342.2894-5-gage.eads@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20190306150342.2894-5-gage.eads@intel.com", "date": "2019-03-06T15:03:40", "name": "[v6,4/6] test_ring: add lock-free ring autotest", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "1f65cb9627c7ba77d9cd15bf2d6ba2320d889ff4", "submitter": { "id": 586, "url": "https://patches.dpdk.org/api/people/586/?format=api", "name": "Eads, Gage", "email": "gage.eads@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/20190306150342.2894-5-gage.eads@intel.com/mbox/", "series": [ { "id": 3642, "url": "https://patches.dpdk.org/api/series/3642/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=3642", "date": "2019-03-06T15:03:37", "name": "Add lock-free ring and mempool handler", "version": 6, "mbox": "https://patches.dpdk.org/series/3642/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/50864/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/50864/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 C33117CDA;\n\tWed, 6 Mar 2019 16:04:17 +0100 (CET)", "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby dpdk.org (Postfix) with ESMTP id AAFB85F20\n\tfor <dev@dpdk.org>; Wed, 6 Mar 2019 16:04:10 +0100 (CET)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t06 Mar 2019 07:04:09 -0800", "from txasoft-yocto.an.intel.com ([10.123.72.192])\n\tby orsmga002.jf.intel.com with ESMTP; 06 Mar 2019 07:04:08 -0800" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.58,448,1544515200\"; d=\"scan'208\";a=\"139634893\"", "From": "Gage Eads <gage.eads@intel.com>", "To": "dev@dpdk.org", "Cc": "olivier.matz@6wind.com, arybchenko@solarflare.com,\n\tbruce.richardson@intel.com, konstantin.ananyev@intel.com,\n\tstephen@networkplumber.org, jerinj@marvell.com, mczekaj@marvell.com, \n\tnd@arm.com, Ola.Liljedahl@arm.com", "Date": "Wed, 6 Mar 2019 09:03:40 -0600", "Message-Id": "<20190306150342.2894-5-gage.eads@intel.com>", "X-Mailer": "git-send-email 2.13.6", "In-Reply-To": "<20190306150342.2894-1-gage.eads@intel.com>", "References": "<20190305174019.9693-1-gage.eads@intel.com>\n\t<20190306150342.2894-1-gage.eads@intel.com>", "Subject": "[dpdk-dev] [PATCH v6 4/6] test_ring: add lock-free ring autotest", "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "ring_nb_autotest re-uses the ring_autotest code by wrapping its top-level\nfunction with one that takes a 'flags' argument.\n\nSigned-off-by: Gage Eads <gage.eads@intel.com>\n---\n app/test/test_ring.c | 61 ++++++++++++++++++++++++++++++++--------------------\n 1 file changed, 38 insertions(+), 23 deletions(-)", "diff": "diff --git a/app/test/test_ring.c b/app/test/test_ring.c\nindex aaf1e70ad..400b1bffd 100644\n--- a/app/test/test_ring.c\n+++ b/app/test/test_ring.c\n@@ -1,5 +1,5 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2010-2014 Intel Corporation\n+ * Copyright(c) 2010-2019 Intel Corporation\n */\n \n #include <string.h>\n@@ -601,18 +601,20 @@ test_ring_burst_basic(struct rte_ring *r)\n * it will always fail to create ring with a wrong ring size number in this function\n */\n static int\n-test_ring_creation_with_wrong_size(void)\n+test_ring_creation_with_wrong_size(unsigned int flags)\n {\n \tstruct rte_ring * rp = NULL;\n \n \t/* Test if ring size is not power of 2 */\n-\trp = rte_ring_create(\"test_bad_ring_size\", RING_SIZE + 1, SOCKET_ID_ANY, 0);\n+\trp = rte_ring_create(\"test_bad_ring_size\", RING_SIZE + 1,\n+\t\t\t SOCKET_ID_ANY, flags);\n \tif (NULL != rp) {\n \t\treturn -1;\n \t}\n \n \t/* Test if ring size is exceeding the limit */\n-\trp = rte_ring_create(\"test_bad_ring_size\", (RTE_RING_SZ_MASK + 1), SOCKET_ID_ANY, 0);\n+\trp = rte_ring_create(\"test_bad_ring_size\", (RTE_RING_SZ_MASK + 1),\n+\t\t\t SOCKET_ID_ANY, flags);\n \tif (NULL != rp) {\n \t\treturn -1;\n \t}\n@@ -623,11 +625,11 @@ test_ring_creation_with_wrong_size(void)\n * it tests if it would always fail to create ring with an used ring name\n */\n static int\n-test_ring_creation_with_an_used_name(void)\n+test_ring_creation_with_an_used_name(unsigned int flags)\n {\n \tstruct rte_ring * rp;\n \n-\trp = rte_ring_create(\"test\", RING_SIZE, SOCKET_ID_ANY, 0);\n+\trp = rte_ring_create(\"test\", RING_SIZE, SOCKET_ID_ANY, flags);\n \tif (NULL != rp)\n \t\treturn -1;\n \n@@ -639,10 +641,10 @@ test_ring_creation_with_an_used_name(void)\n * function to fail correctly\n */\n static int\n-test_create_count_odd(void)\n+test_create_count_odd(unsigned int flags)\n {\n \tstruct rte_ring *r = rte_ring_create(\"test_ring_count\",\n-\t\t\t4097, SOCKET_ID_ANY, 0 );\n+\t\t\t4097, SOCKET_ID_ANY, flags);\n \tif(r != NULL){\n \t\treturn -1;\n \t}\n@@ -665,7 +667,7 @@ test_lookup_null(void)\n * it tests some more basic ring operations\n */\n static int\n-test_ring_basic_ex(void)\n+test_ring_basic_ex(unsigned int flags)\n {\n \tint ret = -1;\n \tunsigned i;\n@@ -679,7 +681,7 @@ test_ring_basic_ex(void)\n \t}\n \n \trp = rte_ring_create(\"test_ring_basic_ex\", RING_SIZE, SOCKET_ID_ANY,\n-\t\t\tRING_F_SP_ENQ | RING_F_SC_DEQ);\n+\t\t\tRING_F_SP_ENQ | RING_F_SC_DEQ | flags);\n \tif (rp == NULL) {\n \t\tprintf(\"test_ring_basic_ex fail to create ring\\n\");\n \t\tgoto fail_test;\n@@ -737,22 +739,22 @@ test_ring_basic_ex(void)\n }\n \n static int\n-test_ring_with_exact_size(void)\n+test_ring_with_exact_size(unsigned int flags)\n {\n \tstruct rte_ring *std_ring = NULL, *exact_sz_ring = NULL;\n-\tvoid *ptr_array[16];\n+\tvoid *ptr_array[1024];\n \tstatic const unsigned int ring_sz = RTE_DIM(ptr_array);\n \tunsigned int i;\n \tint ret = -1;\n \n \tstd_ring = rte_ring_create(\"std\", ring_sz, rte_socket_id(),\n-\t\t\tRING_F_SP_ENQ | RING_F_SC_DEQ);\n+\t\t\tRING_F_SP_ENQ | RING_F_SC_DEQ | flags);\n \tif (std_ring == NULL) {\n \t\tprintf(\"%s: error, can't create std ring\\n\", __func__);\n \t\tgoto end;\n \t}\n \texact_sz_ring = rte_ring_create(\"exact sz\", ring_sz, rte_socket_id(),\n-\t\t\tRING_F_SP_ENQ | RING_F_SC_DEQ | RING_F_EXACT_SZ);\n+\t\tRING_F_SP_ENQ | RING_F_SC_DEQ | RING_F_EXACT_SZ | flags);\n \tif (exact_sz_ring == NULL) {\n \t\tprintf(\"%s: error, can't create exact size ring\\n\", __func__);\n \t\tgoto end;\n@@ -770,7 +772,7 @@ test_ring_with_exact_size(void)\n \t}\n \t/*\n \t * check that the exact_sz_ring can hold one more element than the\n-\t * standard ring. (16 vs 15 elements)\n+\t * standard ring. (1024 vs 1023 elements)\n \t */\n \tfor (i = 0; i < ring_sz - 1; i++) {\n \t\trte_ring_enqueue(std_ring, NULL);\n@@ -808,17 +810,17 @@ test_ring_with_exact_size(void)\n }\n \n static int\n-test_ring(void)\n+__test_ring(unsigned int flags)\n {\n \tstruct rte_ring *r = NULL;\n \n \t/* some more basic operations */\n-\tif (test_ring_basic_ex() < 0)\n+\tif (test_ring_basic_ex(flags) < 0)\n \t\tgoto test_fail;\n \n \trte_atomic32_init(&synchro);\n \n-\tr = rte_ring_create(\"test\", RING_SIZE, SOCKET_ID_ANY, 0);\n+\tr = rte_ring_create(\"test\", RING_SIZE, SOCKET_ID_ANY, flags);\n \tif (r == NULL)\n \t\tgoto test_fail;\n \n@@ -837,27 +839,27 @@ test_ring(void)\n \t\tgoto test_fail;\n \n \t/* basic operations */\n-\tif ( test_create_count_odd() < 0){\n+\tif (test_create_count_odd(flags) < 0) {\n \t\tprintf(\"Test failed to detect odd count\\n\");\n \t\tgoto test_fail;\n \t} else\n \t\tprintf(\"Test detected odd count\\n\");\n \n-\tif ( test_lookup_null() < 0){\n+\tif (test_lookup_null() < 0) {\n \t\tprintf(\"Test failed to detect NULL ring lookup\\n\");\n \t\tgoto test_fail;\n \t} else\n \t\tprintf(\"Test detected NULL ring lookup\\n\");\n \n \t/* test of creating ring with wrong size */\n-\tif (test_ring_creation_with_wrong_size() < 0)\n+\tif (test_ring_creation_with_wrong_size(flags) < 0)\n \t\tgoto test_fail;\n \n \t/* test of creation ring with an used name */\n-\tif (test_ring_creation_with_an_used_name() < 0)\n+\tif (test_ring_creation_with_an_used_name(flags) < 0)\n \t\tgoto test_fail;\n \n-\tif (test_ring_with_exact_size() < 0)\n+\tif (test_ring_with_exact_size(flags) < 0)\n \t\tgoto test_fail;\n \n \t/* dump the ring status */\n@@ -873,4 +875,17 @@ test_ring(void)\n \treturn -1;\n }\n \n+static int\n+test_ring(void)\n+{\n+\treturn __test_ring(0);\n+}\n+\n+static int\n+test_lf_ring(void)\n+{\n+\treturn __test_ring(RING_F_LF);\n+}\n+\n REGISTER_TEST_COMMAND(ring_autotest, test_ring);\n+REGISTER_TEST_COMMAND(ring_lf_autotest, test_lf_ring);\n", "prefixes": [ "v6", "4/6" ] }{ "id": 50864, "url": "