Show a patch.

GET /api/patches/74614/
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 74614,
    "url": "https://patches.dpdk.org/api/patches/74614/",
    "web_url": "https://patches.dpdk.org/patch/74614/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<20200722103701.7244-2-harry.van.haaren@intel.com>",
    "date": "2020-07-22T10:37:01",
    "name": "[v3,2/2] test/service: fix race condition on stopping lcore",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2765addf14da62328501136aa9f0e93c23e5cfa3",
    "submitter": {
        "id": 317,
        "url": "https://patches.dpdk.org/api/people/317/",
        "name": "Van Haaren, Harry",
        "email": "harry.van.haaren@intel.com"
    },
    "delegate": {
        "id": 24651,
        "url": "https://patches.dpdk.org/api/users/24651/",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/patch/74614/mbox/",
    "series": [
        {
            "id": 11234,
            "url": "https://patches.dpdk.org/api/series/11234/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11234",
            "date": "2020-07-22T10:37:00",
            "name": "[v3,1/2] service: add API to retrieve service core active",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/11234/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/74614/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/74614/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9689\"; a=\"150282917\"",
            "E=Sophos;i=\"5.75,381,1589266800\"; d=\"scan'208\";a=\"150282917\"",
            "E=Sophos;i=\"5.75,381,1589266800\"; d=\"scan'208\";a=\"301910615\""
        ],
        "IronPort-SDR": [
            "\n BcD7calIFHJcPa9j5Lqz30tnOFoADVHvEmt/kmRYBhMgiHOhdLzsYV7TEPqKowxl9EIPdpSJZE\n UKz6Vc4qeFpg==",
            "\n LW3KG1kjv1b6BIjs6rZBR0IO4kVhRS2/saXVMyjW/ZvCA3xMY/tnBlurV3b5d00r49MvRvmaC0\n 1TeF5WLulm1g=="
        ],
        "X-Amp-File-Uploaded": "False",
        "Precedence": "list",
        "X-Mailman-Version": "2.1.15",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "X-BeenThere": "dev@dpdk.org",
        "References": "<20200720143829.46280-1-harry.van.haaren@intel.com>\n <20200722103701.7244-1-harry.van.haaren@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v3 2/2] test/service: fix race condition on\n\tstopping lcore",
        "Sender": "\"dev\" <dev-bounces@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 9302CA0526;\n\tWed, 22 Jul 2020 12:36:22 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 6BA111C010;\n\tWed, 22 Jul 2020 12:36:22 +0200 (CEST)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n by dpdk.org (Postfix) with ESMTP id A9F081C010\n for <dev@dpdk.org>; Wed, 22 Jul 2020 12:36:20 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 22 Jul 2020 03:36:16 -0700",
            "from silpixa00399779.ir.intel.com (HELO\n silpixa00399779.ger.corp.intel.com) ([10.237.222.209])\n by orsmga002.jf.intel.com with ESMTP; 22 Jul 2020 03:36:13 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "X-Mailer": "git-send-email 2.17.1",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "X-ExtLoop1": "1",
        "Date": "Wed, 22 Jul 2020 11:37:01 +0100",
        "To": "dev@dpdk.org",
        "From": "Harry van Haaren <harry.van.haaren@intel.com>",
        "In-Reply-To": "<20200722103701.7244-1-harry.van.haaren@intel.com>",
        "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>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Message-Id": "<20200722103701.7244-2-harry.van.haaren@intel.com>",
        "Return-Path": "<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>\n\n---\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..a6bc4487e 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,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_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; i < 100 && rte_service_lcore_active(slcore_id) == 1;\n+\t\t\ti++)\n+\t\trte_delay_ms(SERVICE_DELAY);\n+\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": [
        "v3",
        "2/2"
    ]
}