Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/33112/?format=api
http://patches.dpdk.org/api/patches/33112/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1515427119-55860-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": "<1515427119-55860-2-git-send-email-harry.van.haaren@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1515427119-55860-2-git-send-email-harry.van.haaren@intel.com", "date": "2018-01-08T15:58:39", "name": "[dpdk-dev,v2,2/2] service: fix service core launch", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "5a525f74da636ed22da2aac64462a25aecb31079", "submitter": { "id": 317, "url": "http://patches.dpdk.org/api/people/317/?format=api", "name": "Van Haaren, Harry", "email": "harry.van.haaren@intel.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1515427119-55860-2-git-send-email-harry.van.haaren@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/33112/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/33112/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 9BDEB1B1CC;\n\tMon, 8 Jan 2018 16:58:50 +0100 (CET)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 2991A3250\n\tfor <dev@dpdk.org>; Mon, 8 Jan 2018 16:58:49 +0100 (CET)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t08 Jan 2018 07:58:48 -0800", "from silpixa00398672.ir.intel.com ([10.237.223.128])\n\tby orsmga002.jf.intel.com with ESMTP; 08 Jan 2018 07:58:47 -0800" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.46,330,1511856000\"; d=\"scan'208\";a=\"25424230\"", "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, 8 Jan 2018 15:58:39 +0000", "Message-Id": "<1515427119-55860-2-git-send-email-harry.van.haaren@intel.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1515427119-55860-1-git-send-email-harry.van.haaren@intel.com>", "References": "<1513768907-112647-1-git-send-email-harry.van.haaren@intel.com>\n\t<1515427119-55860-1-git-send-email-harry.van.haaren@intel.com>", "Subject": "[dpdk-dev] [PATCH v2 2/2] service: fix service core launch", "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://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": "<https://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 fixes a potential bug, which was not consistently\nshowing up in the unit tests. The issue was that the service-\nlcore being started was not in a \"WAIT\" state, and hence EAL\nwould return -EBUSY instead of launching the lcore.\n\nIn order to ensure a core is in a launch-ready state, the application\nmust call rte_eal_wait_lcore, to ensure that the core has completed\nits previous task, and that EAL is ready to re-launch it.\n\nThe call to rte_eal_wait_lcore() is explicitly not in the\nservice core function, to make it visible to the application.\nRequiring an explicit function call ensures the developer sees\nthat a lcore could block in the rte_eal_wait_lcore() function\nif the core hasn't returned from its previous function.\n\nFrom a usability perspective, hiding the wait_lcore() inside\nservice cores would cause confusion.\n\nThis patch adds rte_eal_wait_lcore() calls to the unit tests,\nto ensure that the lcores for testing functionality are ready\nto run the test.\n\nFixes: 21698354c832 (\"service: introduce service cores concept\")\n+CC stable@dpdk.org\n\nSigned-off-by: Harry van Haaren <harry.van.haaren@intel.com>\n\n---\n\nv2:\n- Increased delay time, as certain systems could fail intermittently\n due to the thread not being spawned before delay was over (Pavan)\n- Added rte_eal_wait_lcore() on service cores to ensure cores are\n ready state before re-running test with new parameters (Pavan)\n\n@Stable maintainers; this is an EXPERIMENTAL tagged API, so\nI'm not sure what the expectation is in terms of backporting.\n---\n lib/librte_eal/common/include/rte_service.h | 4 +++-\n test/test/test_service_cores.c | 10 +++++++++-\n 2 files changed, 12 insertions(+), 2 deletions(-)", "diff": "diff --git a/lib/librte_eal/common/include/rte_service.h b/lib/librte_eal/common/include/rte_service.h\nindex 5a76383..95def4c 100644\n--- a/lib/librte_eal/common/include/rte_service.h\n+++ b/lib/librte_eal/common/include/rte_service.h\n@@ -246,7 +246,9 @@ int32_t rte_service_run_iter_on_app_lcore(uint32_t id,\n * Start a service core.\n *\n * Starting a core makes the core begin polling. Any services assigned to it\n- * will be run as fast as possible.\n+ * will be run as fast as possible. The application must ensure that the lcore\n+ * is in a launchable state: e.g. call *rte_eal_lcore_wait* on the lcore_id\n+ * before calling this function.\n *\n * @retval 0 Success\n * @retval -EINVAL Failed to start core. The *lcore_id* passed in is not\ndiff --git a/test/test/test_service_cores.c b/test/test/test_service_cores.c\nindex 7d09f5c..2972a80 100644\n--- a/test/test/test_service_cores.c\n+++ b/test/test/test_service_cores.c\n@@ -320,6 +320,7 @@ service_lcore_en_dis_able(void)\n \n \t/* call remote_launch to verify that app can launch ex-service lcore */\n \tservice_remote_launch_flag = 0;\n+\trte_eal_wait_lcore(slcore_id);\n \tint ret = rte_eal_remote_launch(service_remote_launch_func, NULL,\n \t\t\t\t\tslcore_id);\n \tTEST_ASSERT_EQUAL(0, ret, \"Ex-service core remote launch failed.\");\n@@ -334,7 +335,7 @@ static int\n service_lcore_running_check(void)\n {\n \tuint64_t tick = service_tick;\n-\trte_delay_ms(SERVICE_DELAY * 10);\n+\trte_delay_ms(SERVICE_DELAY * 100);\n \t/* if (tick != service_tick) we know the lcore as polled the service */\n \treturn tick != service_tick;\n }\n@@ -477,6 +478,10 @@ service_threaded_test(int mt_safe)\n \tif (!mt_safe)\n \t\ttest_params[1] = 1;\n \n+\t/* wait for lcores before start() */\n+\trte_eal_wait_lcore(slcore_1);\n+\trte_eal_wait_lcore(slcore_2);\n+\n \trte_service_lcore_start(slcore_1);\n \trte_service_lcore_start(slcore_2);\n \n@@ -490,6 +495,8 @@ service_threaded_test(int mt_safe)\n \tTEST_ASSERT_EQUAL(0, rte_service_runstate_set(sid, 0),\n \t\t\t\"Failed to stop MT Safe service\");\n \n+\trte_eal_wait_lcore(slcore_1);\n+\trte_eal_wait_lcore(slcore_2);\n \tunregister_all();\n \n \t/* return the value of the callback pass_test variable to caller */\n@@ -583,6 +590,7 @@ service_app_lcore_poll_impl(const int mt_safe)\n \trte_service_runstate_set(id, 1);\n \n \tuint32_t app_core2 = rte_get_next_lcore(slcore_id, 1, 1);\n+\trte_eal_wait_lcore(app_core2);\n \tint app_core2_ret = rte_eal_remote_launch(service_run_on_app_core_func,\n \t\t\t\t\t\t &id, app_core2);\n \n", "prefixes": [ "dpdk-dev", "v2", "2/2" ] }{ "id": 33112, "url": "