Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/74504/?format=api
https://patches.dpdk.org/api/patches/74504/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200720143829.46280-2-harry.van.haaren@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": "<20200720143829.46280-2-harry.van.haaren@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200720143829.46280-2-harry.van.haaren@intel.com", "date": "2020-07-20T14:38:29", "name": "[v2,2/2] test/service: fix race condition on stopping lcore", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "600e61971d235bae3a2dbafff72532b2827e7b09", "submitter": { "id": 317, "url": "https://patches.dpdk.org/api/people/317/?format=api", "name": "Van Haaren, Harry", "email": "harry.van.haaren@intel.com" }, "delegate": { "id": 24651, "url": "https://patches.dpdk.org/api/users/24651/?format=api", "username": "dmarchand", "first_name": "David", "last_name": "Marchand", "email": "david.marchand@redhat.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200720143829.46280-2-harry.van.haaren@intel.com/mbox/", "series": [ { "id": 11175, "url": "https://patches.dpdk.org/api/series/11175/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11175", "date": "2020-07-20T14:38:28", "name": "[v2,1/2] service: add API to retrieve service core active", "version": 2, "mbox": "https://patches.dpdk.org/series/11175/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/74504/comments/", "check": "warning", "checks": "https://patches.dpdk.org/api/patches/74504/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 07B24A0527;\n\tMon, 20 Jul 2020 16:37:42 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id A53C21BFC6;\n\tMon, 20 Jul 2020 16:37:36 +0200 (CEST)", "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n by dpdk.org (Postfix) with ESMTP id 8DDC71BFC5\n for <dev@dpdk.org>; Mon, 20 Jul 2020 16:37:34 +0200 (CEST)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 20 Jul 2020 07:37:33 -0700", "from silpixa00399779.ir.intel.com (HELO\n silpixa00399779.ger.corp.intel.com) ([10.237.222.209])\n by FMSMGA003.fm.intel.com with ESMTP; 20 Jul 2020 07:37:31 -0700" ], "IronPort-SDR": [ "\n Rgppq7zTk2UZ2WIzckpSlCG4768yi/ff78jtWAQ0DTV5sS/wUM8Srvkk43TXfo6xIh+ICBq/Gi\n xfjp7qQx4n2A==", "\n G3Dj0SP+Bfl2xkvVMV8jlz5QivJcbWPf48mkWjFg8Q+2CA7MgMzOmnZygvnNWHOKrssqz5Ughc\n zWJOc5lEgKJw==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9687\"; a=\"214598026\"", "E=Sophos;i=\"5.75,375,1589266800\"; d=\"scan'208\";a=\"214598026\"", "E=Sophos;i=\"5.75,375,1589266800\"; d=\"scan'208\";a=\"326075407\"" ], "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, igor.romanov@oktetlabs.ru,\n honnappa.nagarahalli@arm.com, ferruh.yigit@intel.com, nd@arm.com,\n aconole@redhat.com, l.wojciechow@partner.samsung.com,\n Harry van Haaren <harry.van.haaren@intel.com>", "Date": "Mon, 20 Jul 2020 15:38:29 +0100", "Message-Id": "<20200720143829.46280-2-harry.van.haaren@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20200720143829.46280-1-harry.van.haaren@intel.com>", "References": "<20200720120938.34660-1-harry.van.haaren@intel.com>\n <20200720143829.46280-1-harry.van.haaren@intel.com>", "Subject": "[dpdk-dev] [PATCH v2 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>\n\n---\n\nThanks for discussion on v1, this v2 fixup for the CI\nincluding previous feedback on ML.\n---\n app/test/test_service_cores.c | 22 +++++++++++++++++++++-\n 1 file changed, 21 insertions(+), 1 deletion(-)", "diff": "diff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.c\nindex ef1d8fcb9..a45762915 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_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,24 @@ 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_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+\tint i = 0;\n+\twhile (rte_service_lcore_active(slcore_id) == 1) {\n+\t\trte_delay_ms(1);\n+\t\ti++;\n+\t\tif (i > 100)\n+\t\t\tbreak;\n+\t}\n+\tTEST_ASSERT_EQUAL(0, rte_service_lcore_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": [ "v2", "2/2" ] }{ "id": 74504, "url": "