Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/77614/?format=api
http://patches.dpdk.org/api/patches/77614/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200914143118.84791-2-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": "<20200914143118.84791-2-harry.van.haaren@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200914143118.84791-2-harry.van.haaren@intel.com", "date": "2020-09-14T14:31:18", "name": "[v6,2/2] test/service: fix race condition on stopping lcore", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "af8813dc6ec71b1eadff9a1837901f3f162dab83", "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": 24651, "url": "http://patches.dpdk.org/api/users/24651/?format=api", "username": "dmarchand", "first_name": "David", "last_name": "Marchand", "email": "david.marchand@redhat.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200914143118.84791-2-harry.van.haaren@intel.com/mbox/", "series": [ { "id": 12198, "url": "http://patches.dpdk.org/api/series/12198/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12198", "date": "2020-09-14T14:31:18", "name": "[v6,1/2] service: add API to retrieve service core active", "version": 6, "mbox": "http://patches.dpdk.org/series/12198/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/77614/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/77614/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 39377A04C7;\n\tMon, 14 Sep 2020 16:30:04 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id EA24B1C0C2;\n\tMon, 14 Sep 2020 16:30:03 +0200 (CEST)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by dpdk.org (Postfix) with ESMTP id 398EA1C0C0\n for <dev@dpdk.org>; Mon, 14 Sep 2020 16:30:02 +0200 (CEST)", "from orsmga003.jf.intel.com ([10.7.209.27])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 14 Sep 2020 07:30:01 -0700", "from silpixa00399779.ir.intel.com (HELO\n silpixa00399779.ger.corp.intel.com) ([10.237.222.209])\n by orsmga003.jf.intel.com with ESMTP; 14 Sep 2020 07:30:00 -0700" ], "IronPort-SDR": [ "\n zrYEH7dp+rEL1w3ABkTeln6SM4Mt4QhqNYD0fJ8nvgjb2m5yc1/nyM8Ro4e6Cx/phD9/7B+JOQ\n J6ekjyLefa1A==", "\n syKrQqSS9stbCGTxMhnCuaCOhzRMdhPggHx1aMU6j1eRaYtLRgHBxwKQDvPvbJkEhmQl6kM8d8\n FNT1pz/TMGOQ==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9744\"; a=\"160017184\"", "E=Sophos;i=\"5.76,426,1592895600\"; d=\"scan'208\";a=\"160017184\"", "E=Sophos;i=\"5.76,426,1592895600\"; d=\"scan'208\";a=\"301768517\"" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "From": "Harry van Haaren <harry.van.haaren@intel.com>", "To": "dev@dpdk.org", "Cc": "david.marchand@redhat.com,\n\tHarry van Haaren <harry.van.haaren@intel.com>", "Date": "Mon, 14 Sep 2020 15:31:18 +0100", "Message-Id": "<20200914143118.84791-2-harry.van.haaren@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20200914143118.84791-1-harry.van.haaren@intel.com>", "References": "<20200724134506.11959-1-harry.van.haaren@intel.com>\n <20200914143118.84791-1-harry.van.haaren@intel.com>", "Subject": "[dpdk-dev] [PATCH v6 2/2] test/service: fix race condition on\n\tstopping lcore", "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "This commit fixes a potential race condition in the tests\nwhere the lcore running a service would increment a counter\nthat was already reset by the test-suite thread. The resulting\nrace-condition incremented value could cause CI failures, as\nindicated by DPDK's CI.\n\nThis patch fixes the race-condition by making use of the\nadded rte_service_lcore_active() API, which indicates when\na service-core is no longer in the service-core polling loop.\n\nThe unit test makes use of the above function to detect when\nall statistics increments are done in the service-core thread,\nand then the unit test continues finalizing and checking state.\n\nFixes: f28f3594ded2 (\"service: add attribute API\")\n\nReported-by: David Marchand <david.marchand@redhat.com>\nSigned-off-by: Harry van Haaren <harry.van.haaren@intel.com>\nReviewed-by: Phil Yang <phil.yang@arm.com>\nReviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>\n\n---\n\nv6:\n- Fix CI issue on C99 style loop initializer (David)\n\nv4:\n- Update test to new _may_be_ style API (Honnappa)\n- Add reviewed by from ML\n\nv3:\n- Refactor while() to for() to simplify (Harry)\n- Use SERVICE_DELAY instead of magic const 1 (Phil)\n- Add Phil's reviewed by tag from ML\n\nv2:\nThanks for discussion on v1, this v2 fixup for the CI\nincluding previous feedback on ML.\n---\n app/test/test_service_cores.c | 21 ++++++++++++++++++++-\n 1 file changed, 20 insertions(+), 1 deletion(-)", "diff": "diff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.c\nindex ef1d8fcb9b..5d92bea8af 100644\n--- a/app/test/test_service_cores.c\n+++ b/app/test/test_service_cores.c\n@@ -362,6 +362,9 @@ service_lcore_attr_get(void)\n \t\t\t\"Service core add did not return zero\");\n \tTEST_ASSERT_EQUAL(0, rte_service_map_lcore_set(id, slcore_id, 1),\n \t\t\t\"Enabling valid service and core failed\");\n+\t/* Ensure service is not active before starting */\n+\tTEST_ASSERT_EQUAL(0, rte_service_lcore_may_be_active(slcore_id),\n+\t\t\t\"Not-active service core reported as active\");\n \tTEST_ASSERT_EQUAL(0, rte_service_lcore_start(slcore_id),\n \t\t\t\"Starting service core failed\");\n \n@@ -382,7 +385,23 @@ service_lcore_attr_get(void)\n \t\t\tlcore_attr_id, &lcore_attr_value),\n \t\t\t\"Invalid lcore attr didn't return -EINVAL\");\n \n-\trte_service_lcore_stop(slcore_id);\n+\t/* Ensure service is active */\n+\tTEST_ASSERT_EQUAL(1, rte_service_lcore_may_be_active(slcore_id),\n+\t\t\t\"Active service core reported as not-active\");\n+\n+\tTEST_ASSERT_EQUAL(0, rte_service_map_lcore_set(id, slcore_id, 0),\n+\t\t\t\"Disabling valid service and core failed\");\n+\tTEST_ASSERT_EQUAL(0, rte_service_lcore_stop(slcore_id),\n+\t\t\t\"Failed to stop service lcore\");\n+\n+\t/* Wait until service lcore not active, or for 100x SERVICE_DELAY */\n+\tint i;\n+\tfor (i = 0; rte_service_lcore_may_be_active(slcore_id) == 1 &&\n+\t\t\ti < 100; i++)\n+\t\trte_delay_ms(SERVICE_DELAY);\n+\n+\tTEST_ASSERT_EQUAL(0, rte_service_lcore_may_be_active(slcore_id),\n+\t\t\t \"Service lcore not stopped after waiting.\");\n \n \tTEST_ASSERT_EQUAL(0, rte_service_lcore_attr_reset_all(slcore_id),\n \t\t\t \"Valid lcore_attr_reset_all() didn't return success\");\n", "prefixes": [ "v6", "2/2" ] }{ "id": 77614, "url": "