get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 117442,
    "url": "http://patches.dpdk.org/api/patches/117442/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20221006082813.579255-1-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": "<20221006082813.579255-1-harry.van.haaren@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20221006082813.579255-1-harry.van.haaren@intel.com",
    "date": "2022-10-06T08:28:13",
    "name": "[v2] test/service: fix spurious failures by extending timeout",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2e44b1de4e98d0e83c245b100a6d285e7c77ab64",
    "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/20221006082813.579255-1-harry.van.haaren@intel.com/mbox/",
    "series": [
        {
            "id": 25006,
            "url": "http://patches.dpdk.org/api/series/25006/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=25006",
            "date": "2022-10-06T08:28:13",
            "name": "[v2] test/service: fix spurious failures by extending timeout",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/25006/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/117442/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/117442/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 5D0CAA00C2;\n\tThu,  6 Oct 2022 10:28:29 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id EA5C742BB3;\n\tThu,  6 Oct 2022 10:28:28 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by mails.dpdk.org (Postfix) with ESMTP id B078142B88;\n Thu,  6 Oct 2022 10:28:27 +0200 (CEST)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 06 Oct 2022 01:28:23 -0700",
            "from silpixa00401454.ir.intel.com ([10.55.128.131])\n by orsmga004.jf.intel.com with ESMTP; 06 Oct 2022 01:28:20 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1665044908; x=1696580908;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=XxfKNUolZM5R7dn9JBjCaLCcSla61gR8QsQ5w3Y6Ijs=;\n b=anGkOvCcCMixkvv1PEIKTmw4jiBe53iUo/EY6b88rFmTX1o9Zua0+KsE\n zcqUwLym6C78BU665m39cQviqKrF2gXlloSuNSOXXnJQEpTx1dK+BkK7Y\n nFeoLji7XmaFQzVUy3g/vKvDUMT+YG/bm9U8bnbG/4OAC3wLYiIuCmnoU\n TA/E2boLbazJetksCiepMlYTg342qk9phIdW5CwjMD1AxocARrFCF+AMj\n Wt5qQlRl4f7aAk3fHwZITmurQyHO7UAWmH710uIiLhome8/gxSKYO6400\n 3khgWwc+VoaHHciJ0iZJsuBUyAGkA89+ugpmxYhuipAV3QN41Z6dOT5gS g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10491\"; a=\"303360433\"",
            "E=Sophos;i=\"5.95,163,1661842800\"; d=\"scan'208\";a=\"303360433\"",
            "E=McAfee;i=\"6500,9779,10491\"; a=\"750074270\"",
            "E=Sophos;i=\"5.95,163,1661842800\"; d=\"scan'208\";a=\"750074270\""
        ],
        "X-ExtLoop1": "1",
        "From": "Harry van Haaren <harry.van.haaren@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "david.marchand@redhat.com, dpdklab@iol.unh.edu, ci@dpdk.org,\n Honnappa.Nagarahalli@arm.com, mb@smartsharesystems.com,\n mattias.ronnblom@ericsson.com, thomas@monjalon.net,\n Harry van Haaren <harry.van.haaren@intel.com>",
        "Subject": "[PATCH v2] test/service: fix spurious failures by extending timeout",
        "Date": "Thu,  6 Oct 2022 08:28:13 +0000",
        "Message-Id": "<20221006082813.579255-1-harry.van.haaren@intel.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20221006081729.578475-1-harry.van.haaren@intel.com>",
        "References": "<20221006081729.578475-1-harry.van.haaren@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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"
    },
    "content": "This commit extends the timeout for service_may_be_active()\nfrom 100ms to 1000ms. Local testing on a idle and loaded system\n(compiling DPDK with all cores) always completes after 1 ms.\n\nThe wait time for a service-lcore to finish is also extended\nfrom 100ms to 1000ms.\n\nThe same timeout waiting code was duplicated in two tests, and\nis now refactored to a standalone function avoiding duplication.\n\nReported-by: David Marchand <david.marchand@redhat.com>\nSuggested-by: Mattias Ronnblom <mattias.ronnblom@ericsson.com>\nSigned-off-by: Harry van Haaren <harry.van.haaren@intel.com>\n\n---\n\nApologies for the quick respin noise; only the first diff-section\nis added, no changes to the rest of the patch.\n\nv2:\n- v1 addressed only testcase 15 issue, v2 also addresses test\n  case 5, which has an service-lcore wait code-path.\n\n---\n app/test/test_service_cores.c | 47 ++++++++++++++++-------------------\n 1 file changed, 22 insertions(+), 25 deletions(-)",
    "diff": "diff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.c\nindex 359b6dcd8b..4b147bd64c 100644\n--- a/app/test/test_service_cores.c\n+++ b/app/test/test_service_cores.c\n@@ -123,14 +123,14 @@ unregister_all(void)\n \treturn TEST_SUCCESS;\n }\n \n-/* Wait until service lcore not active, or for 100x SERVICE_DELAY */\n+/* Wait until service lcore not active, or for N times SERVICE_DELAY */\n static void\n wait_slcore_inactive(uint32_t slcore_id)\n {\n \tint i;\n \n \tfor (i = 0; rte_service_lcore_may_be_active(slcore_id) == 1 &&\n-\t\t\ti < 100; i++)\n+\t\t\ti < 1000; i++)\n \t\trte_delay_ms(SERVICE_DELAY);\n }\n \n@@ -921,12 +921,26 @@ service_lcore_start_stop(void)\n \treturn unregister_all();\n }\n \n+static int\n+service_ensure_stopped_with_timeout(uint32_t sid)\n+{\n+\t/* give the service time to stop running */\n+\tint32_t timeout_ms = 1000;\n+\tint i;\n+\tfor (i = 0; i < timeout_ms; i++) {\n+\t\tif (!rte_service_may_be_active(sid))\n+\t\t\tbreak;\n+\t\trte_delay_ms(SERVICE_DELAY);\n+\t}\n+\n+\treturn rte_service_may_be_active(sid);\n+}\n+\n /* stop a service and wait for it to become inactive */\n static int\n service_may_be_active(void)\n {\n \tconst uint32_t sid = 0;\n-\tint i;\n \n \t/* expected failure cases */\n \tTEST_ASSERT_EQUAL(-EINVAL, rte_service_may_be_active(10000),\n@@ -946,19 +960,11 @@ service_may_be_active(void)\n \tTEST_ASSERT_EQUAL(1, service_lcore_running_check(),\n \t\t\t\"Service core expected to poll service but it didn't\");\n \n-\t/* stop the service */\n+\t/* stop the service, and wait for not-active with timeout */\n \tTEST_ASSERT_EQUAL(0, rte_service_runstate_set(sid, 0),\n \t\t\t\"Error: Service stop returned non-zero\");\n-\n-\t/* give the service 100ms to stop running */\n-\tfor (i = 0; i < 100; i++) {\n-\t\tif (!rte_service_may_be_active(sid))\n-\t\t\tbreak;\n-\t\trte_delay_ms(SERVICE_DELAY);\n-\t}\n-\n-\tTEST_ASSERT_EQUAL(0, rte_service_may_be_active(sid),\n-\t\t\t  \"Error: Service not stopped after 100ms\");\n+\tTEST_ASSERT_EQUAL(0, service_ensure_stopped_with_timeout(sid),\n+\t\t\t  \"Error: Service not stopped after timeout period.\");\n \n \treturn unregister_all();\n }\n@@ -972,7 +978,6 @@ service_active_two_cores(void)\n \t\treturn TEST_SKIPPED;\n \n \tconst uint32_t sid = 0;\n-\tint i;\n \n \tuint32_t lcore = rte_get_next_lcore(/* start core */ -1,\n \t\t\t\t\t    /* skip main */ 1,\n@@ -1002,16 +1007,8 @@ service_active_two_cores(void)\n \t/* stop the service */\n \tTEST_ASSERT_EQUAL(0, rte_service_runstate_set(sid, 0),\n \t\t\t\"Error: Service stop returned non-zero\");\n-\n-\t/* give the service 100ms to stop running */\n-\tfor (i = 0; i < 100; i++) {\n-\t\tif (!rte_service_may_be_active(sid))\n-\t\t\tbreak;\n-\t\trte_delay_ms(SERVICE_DELAY);\n-\t}\n-\n-\tTEST_ASSERT_EQUAL(0, rte_service_may_be_active(sid),\n-\t\t\t  \"Error: Service not stopped after 100ms\");\n+\tTEST_ASSERT_EQUAL(0, service_ensure_stopped_with_timeout(sid),\n+\t\t\t  \"Error: Service not stopped after timeout period.\");\n \n \treturn unregister_all();\n }\n",
    "prefixes": [
        "v2"
    ]
}