Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/74760/?format=api
http://patches.dpdk.org/api/patches/74760/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200724124503.96282-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": "<20200724124503.96282-2-harry.van.haaren@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200724124503.96282-2-harry.van.haaren@intel.com", "date": "2020-07-24T12:45:03", "name": "[v4,2/2] test/service: fix race condition on stopping lcore", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "987fbfde61da6f85b0742ffe1c5c34114a537f27", "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/20200724124503.96282-2-harry.van.haaren@intel.com/mbox/", "series": [ { "id": 11286, "url": "http://patches.dpdk.org/api/series/11286/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11286", "date": "2020-07-24T12:45:02", "name": "[v4,1/2] service: add API to retrieve service core active", "version": 4, "mbox": "http://patches.dpdk.org/series/11286/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/74760/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/74760/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 833F1A0526;\n\tFri, 24 Jul 2020 14:44:08 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 97C1F1C02E;\n\tFri, 24 Jul 2020 14:44:05 +0200 (CEST)", "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by dpdk.org (Postfix) with ESMTP id 336971C029\n for <dev@dpdk.org>; Fri, 24 Jul 2020 14:44:02 +0200 (CEST)", "from orsmga004.jf.intel.com ([10.7.209.38])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 24 Jul 2020 05:44:01 -0700", "from silpixa00399779.ir.intel.com (HELO\n silpixa00399779.ger.corp.intel.com) ([10.237.222.209])\n by orsmga004.jf.intel.com with ESMTP; 24 Jul 2020 05:43:59 -0700" ], "IronPort-SDR": [ "\n ChmIKzSAiTG+29CBRKGDN1QUK90gXm5R6YAMebUWwF3TF6oDwtz89u3ExuZKgqYQuRoykvctCj\n G2J3G9oRKF+g==", "\n w4HNvU10XVGsXG8VXDa7yddFUXe2wVZbeKm4omk9inEK/6UuNpG9GY8zeOCPUGGsVAhq9KVgHC\n IYu9hJHH8zRQ==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9691\"; a=\"138198811\"", "E=Sophos;i=\"5.75,390,1589266800\"; d=\"scan'208\";a=\"138198811\"", "E=Sophos;i=\"5.75,390,1589266800\"; d=\"scan'208\";a=\"433073225\"" ], "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, phil.yang@arm.com,\n Harry van Haaren <harry.van.haaren@intel.com>", "Date": "Fri, 24 Jul 2020 13:45:03 +0100", "Message-Id": "<20200724124503.96282-2-harry.van.haaren@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20200724124503.96282-1-harry.van.haaren@intel.com>", "References": "<20200722103701.7244-1-harry.van.haaren@intel.com>\n <20200724124503.96282-1-harry.van.haaren@intel.com>", "Subject": "[dpdk-dev] [PATCH v4 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\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 | 20 +++++++++++++++++++-\n 1 file changed, 19 insertions(+), 1 deletion(-)", "diff": "diff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.c\nindex ef1d8fcb9..8bc1d9913 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,22 @@ 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+\tfor (int 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": [ "v4", "2/2" ] }{ "id": 74760, "url": "