get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 81174,
    "url": "http://patches.dpdk.org/api/patches/81174/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20201017030701.16134-6-l.wojciechow@partner.samsung.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": "<20201017030701.16134-6-l.wojciechow@partner.samsung.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201017030701.16134-6-l.wojciechow@partner.samsung.com",
    "date": "2020-10-17T03:06:49",
    "name": "[v8,05/17] test/distributor: fix shutdown of busy worker",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "1c35883ee5bc7c6677a52fd7badca00ee90ef5f3",
    "submitter": {
        "id": 1628,
        "url": "http://patches.dpdk.org/api/people/1628/?format=api",
        "name": "Lukasz Wojciechowski",
        "email": "l.wojciechow@partner.samsung.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/20201017030701.16134-6-l.wojciechow@partner.samsung.com/mbox/",
    "series": [
        {
            "id": 13072,
            "url": "http://patches.dpdk.org/api/series/13072/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=13072",
            "date": "2020-10-17T03:06:44",
            "name": "fix distributor synchronization issues",
            "version": 8,
            "mbox": "http://patches.dpdk.org/series/13072/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/81174/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/81174/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 0F586A04DB;\n\tSat, 17 Oct 2020 05:11:26 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 1C5EFE2F3;\n\tSat, 17 Oct 2020 05:08:11 +0200 (CEST)",
            "from mailout1.w1.samsung.com (mailout1.w1.samsung.com\n [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 5AD80E2B1\n for <dev@dpdk.org>; Sat, 17 Oct 2020 05:07:42 +0200 (CEST)",
            "from eucas1p2.samsung.com (unknown [182.198.249.207])\n by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id\n 20201017030722euoutp01bc8418e34a4525e56cee39956bc8fcb8~_qLvrzWvy1627716277euoutp01Y\n for <dev@dpdk.org>; Sat, 17 Oct 2020 03:07:22 +0000 (GMT)",
            "from eusmges2new.samsung.com (unknown [203.254.199.244]) by\n eucas1p2.samsung.com (KnoxPortal) with ESMTP id\n 20201017030713eucas1p2a2bfb6ab66a424ef7afa2882a619c88e~_qLnqGuKu1521315213eucas1p2X;\n Sat, 17 Oct 2020 03:07:13 +0000 (GMT)",
            "from eucas1p2.samsung.com ( [182.198.249.207]) by\n eusmges2new.samsung.com (EUCPMTA) with SMTP id 72.42.05997.1EF5A8F5; Sat, 17\n Oct 2020 04:07:13 +0100 (BST)",
            "from eusmtrp2.samsung.com (unknown [182.198.249.139]) by\n eucas1p1.samsung.com (KnoxPortal) with ESMTPA id\n 20201017030713eucas1p1173c2178e647be341db2da29078c8d5d~_qLnXDueq0898308983eucas1p15;\n Sat, 17 Oct 2020 03:07:13 +0000 (GMT)",
            "from eusmgms1.samsung.com (unknown [182.198.249.179]) by\n eusmtrp2.samsung.com (KnoxPortal) with ESMTP id\n 20201017030713eusmtrp23d5c410cb0a98dd956099e4fc4602e00~_qLnWj3FC2572125721eusmtrp2i;\n Sat, 17 Oct 2020 03:07:13 +0000 (GMT)",
            "from eusmtip1.samsung.com ( [203.254.199.221]) by\n eusmgms1.samsung.com (EUCPMTA) with SMTP id CA.99.06314.1EF5A8F5; Sat, 17\n Oct 2020 04:07:13 +0100 (BST)",
            "from localhost.localdomain (unknown [106.210.88.70]) by\n eusmtip1.samsung.com (KnoxPortal) with ESMTPA id\n 20201017030712eusmtip18de3ab114528a40c48b1b9cb261e179f~_qLmlZ-KT3124931249eusmtip16;\n Sat, 17 Oct 2020 03:07:12 +0000 (GMT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com\n 20201017030722euoutp01bc8418e34a4525e56cee39956bc8fcb8~_qLvrzWvy1627716277euoutp01Y",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com;\n s=mail20170921; t=1602904042;\n bh=LemR1YjnE+c23RXwEQzxMBn4x6DVQHDmQWboTCBU/MI=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=LKUFQ8ZGVdzFM4MpIj2knneOtKmS3hMaiyT8R3ThXYoA5AAxFKAQ17t+RwYiqLm6/\n WVHcy1V2nu0GlA4b5btnxT9h7jzgM//zde+n3qvdMW0dv4ngVOUgMw0Qam/b/huPC1\n hz3VxdsCYA69AXPkJjhSytLbz7XeGqwPs3RhAVPw=",
        "X-AuditID": "cbfec7f4-677ff7000000176d-bb-5f8a5fe1a42c",
        "From": "Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>",
        "To": "David Hunt <david.hunt@intel.com>, Bruce Richardson\n <bruce.richardson@intel.com>",
        "Cc": "dev@dpdk.org, l.wojciechow@partner.samsung.com, stable@dpdk.org",
        "Date": "Sat, 17 Oct 2020 05:06:49 +0200",
        "Message-Id": "<20201017030701.16134-6-l.wojciechow@partner.samsung.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20201017030701.16134-1-l.wojciechow@partner.samsung.com>",
        "X-Brightmail-Tracker": [
            "\n H4sIAAAAAAAAA+NgFrrPIsWRmVeSWpSXmKPExsWy7djP87oP47viDWa2GVjcWGVv0TfpI5PF\n u0/bmSye9axjtPjX8YfdgdXj14KlrB6L97xk8jj4bg9TAHMUl01Kak5mWWqRvl0CV8bTZ0dZ\n Cs5KVRxav4mxgXG7aBcjO4eEgInEdJsuRi4OIYEVjBK/th9j6WLkBHK+MEo87HGHsD8zSkyZ\n Vwdig5RPOX8BqmY5o8TJc7VwNfvmq4DYbAK2EkdmfmUFsUUEwiSam/cC1XNwMAs4Szz5ygYS\n FhZwl/h5ZSNYCYuAqsSR4wuZQWxeAVeJtStbWSFWyUus3nCAGaSVU8BNovG4K0T4OpvE1rPW\n IGEJAReJ7kO6EGFhiVfHt7BD2DIS/3fOZwL5SkJgG6PE1d8/GSGc/YwS13tXQFVZSxz+95sN\n 4jRNifW79CHCjhL3P85lgZjPJ3HjrSBImBnInLRtOjNEmFeio00IolpP4mnPVEaYtX/WPmGB\n sD0kZv5fwwQJ2KtAW183ME9glJ+FsGwBI+MqRvHU0uLc9NRio7zUcr3ixNzi0rx0veT83E2M\n wGg//e/4lx2Mu/4kHWIU4GBU4uHlWNoZL8SaWFZcmXuIUYKDWUmE1+ns6Tgh3pTEyqrUovz4\n otKc1OJDjNIcLErivMaLXsYKCaQnlqRmp6YWpBbBZJk4OKUaGIPmZV0VLXgSocJ26MN6lX3W\n 7if8Xt8NafiW+mPaAZuGGFUD65u655favDQ+O53xSeWlVzoyG5xt13y5Xj1vxo2CrQ7ZxZHM\n 588vFmVqYv3M1CV3M0sllXuW5Z5doV+Y46/anzcofJfUxGDGkWmdeX/q7l15ZyrTvLev+i15\n /Wx+b5nmJ6cbrEosxRmJhlrMRcWJAObys33yAgAA",
            "\n H4sIAAAAAAAAA+NgFjrOLMWRmVeSWpSXmKPExsVy+t/xu7oP47viDV6fl7G4screom/SRyaL\n d5+2M1k861nHaPGv4w+7A6vHrwVLWT0W73nJ5HHw3R6mAOYoPZui/NKSVIWM/OISW6VoQwsj\n PUNLCz0jE0s9Q2PzWCsjUyV9O5uU1JzMstQifbsEvYynz46yFJyVqji0fhNjA+N20S5GTg4J\n AROJKecvsHQxcnEICSxllJjx6hZ7FyMHUEJG4sMlAYgaYYk/17rYIGo+MkocmHmPESTBJmAr\n cWTmV1aQehGBMIkTK/1BwswC7hJbFk9lBrGFgeyfVzaygtgsAqoSR44vBIvzCrhKrF3Zygox\n X15i9YYDzCBjOAXcJBqPu0KsamSUODtrHcsERr4FjAyrGEVSS4tz03OLDfWKE3OLS/PS9ZLz\n czcxAgNx27Gfm3cwXtoYfIhRgINRiYd3w6LOeCHWxLLiytxDjBIczEoivE5nT8cJ8aYkVlal\n FuXHF5XmpBYfYjQFOmois5Rocj4wSvJK4g1NDc0tLA3Njc2NzSyUxHk7BA7GCAmkJ5akZqem\n FqQWwfQxcXBKNTDOXWe8ymniv6dbi52YlK2mb9m7MGVHeobLsuONja3LGBdcfrg6vH+vjF3i\n Y6FvJnqrd1R8/7Bv8425v53KUwpatfp0jQ8y7tkkv/T+909dhheX9tq/Kjw/84rEw/6N+w9/\n 0a3gehEobGO/ZYa8IQPnu7VPXJa/Tg/Y0rbE7+SbgDi9zi3nj8u9VWIpzkg01GIuKk4EANeG\n M/1aAgAA"
        ],
        "X-CMS-MailID": "20201017030713eucas1p1173c2178e647be341db2da29078c8d5d",
        "X-Msg-Generator": "CA",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "X-RootMTR": "20201017030713eucas1p1173c2178e647be341db2da29078c8d5d",
        "X-EPHeader": "CA",
        "CMS-TYPE": "201P",
        "X-CMS-RootMailID": "20201017030713eucas1p1173c2178e647be341db2da29078c8d5d",
        "References": "<20201010160508.19709-1-l.wojciechow@partner.samsung.com>\n <20201017030701.16134-1-l.wojciechow@partner.samsung.com>\n <CGME20201017030713eucas1p1173c2178e647be341db2da29078c8d5d@eucas1p1.samsung.com>",
        "Subject": "[dpdk-dev] [PATCH v8 05/17] test/distributor: fix shutdown of busy\n\tworker",
        "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": "The sanity test with worker shutdown delegates all bufs\nto be processed by a single lcore worker, then it freezes\none of the lcore workers and continues to send more bufs.\nThe freezed core shuts down first by calling\nrte_distributor_return_pkt().\n\nThe test intention is to verify if packets assigned to\nthe shut down lcore will be reassigned to another worker.\n\nHowever the shutdown core was not always the one, that was\nprocessing packets. The lcore processing mbufs might be different\nevery time test is launched. This is caused by keeping the value\nof wkr static variable in rte_distributor_process() function\nbetween running test cases.\n\nTest freezed always lcore with 0 id. The patch stores the id\nof worker that is processing the data in zero_idx global atomic\nvariable. This way the freezed lcore is always the proper one.\n\nFixes: c3eabff124e6 (\"distributor: add unit tests\")\nCc: bruce.richardson@intel.com\nCc: stable@dpdk.org\n\nSigned-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>\nTested-by: David Hunt <david.hunt@intel.com>\n---\n app/test/test_distributor.c | 23 +++++++++++++++++++++--\n 1 file changed, 21 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c\nindex 52230d250..6cd7a2edd 100644\n--- a/app/test/test_distributor.c\n+++ b/app/test/test_distributor.c\n@@ -28,6 +28,7 @@ struct worker_params worker_params;\n static volatile int quit;      /**< general quit variable for all threads */\n static volatile int zero_quit; /**< var for when we just want thr0 to quit*/\n static volatile unsigned worker_idx;\n+static volatile unsigned zero_idx;\n \n struct worker_stats {\n \tvolatile unsigned handled_packets;\n@@ -340,26 +341,43 @@ handle_work_for_shutdown_test(void *arg)\n \tunsigned int total = 0;\n \tunsigned int i;\n \tunsigned int returned = 0;\n+\tunsigned int zero_id = 0;\n+\tunsigned int zero_unset;\n \tconst unsigned int id = __atomic_fetch_add(&worker_idx, 1,\n \t\t\t__ATOMIC_RELAXED);\n \n \tnum = rte_distributor_get_pkt(d, id, buf, NULL, 0);\n \n+\tif (num > 0) {\n+\t\tzero_unset = RTE_MAX_LCORE;\n+\t\t__atomic_compare_exchange_n(&zero_idx, &zero_unset, id,\n+\t\t\tfalse, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE);\n+\t}\n+\tzero_id = __atomic_load_n(&zero_idx, __ATOMIC_ACQUIRE);\n+\n \t/* wait for quit single globally, or for worker zero, wait\n \t * for zero_quit */\n-\twhile (!quit && !(id == 0 && zero_quit)) {\n+\twhile (!quit && !(id == zero_id && zero_quit)) {\n \t\tworker_stats[id].handled_packets += num;\n \t\tcount += num;\n \t\tfor (i = 0; i < num; i++)\n \t\t\trte_pktmbuf_free(buf[i]);\n \t\tnum = rte_distributor_get_pkt(d, id, buf, NULL, 0);\n+\n+\t\tif (num > 0) {\n+\t\t\tzero_unset = RTE_MAX_LCORE;\n+\t\t\t__atomic_compare_exchange_n(&zero_idx, &zero_unset, id,\n+\t\t\t\tfalse, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE);\n+\t\t}\n+\t\tzero_id = __atomic_load_n(&zero_idx, __ATOMIC_ACQUIRE);\n+\n \t\ttotal += num;\n \t}\n \tworker_stats[id].handled_packets += num;\n \tcount += num;\n \treturned = rte_distributor_return_pkt(d, id, buf, num);\n \n-\tif (id == 0) {\n+\tif (id == zero_id) {\n \t\t/* for worker zero, allow it to restart to pick up last packet\n \t\t * when all workers are shutting down.\n \t\t */\n@@ -578,6 +596,7 @@ quit_workers(struct worker_params *wp, struct rte_mempool *p)\n \trte_eal_mp_wait_lcore();\n \tquit = 0;\n \tworker_idx = 0;\n+\tzero_idx = RTE_MAX_LCORE;\n }\n \n static int\n",
    "prefixes": [
        "v8",
        "05/17"
    ]
}