get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 80242,
    "url": "https://patches.dpdk.org/api/patches/80242/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20201009220202.20834-14-l.wojciechow@partner.samsung.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": "<20201009220202.20834-14-l.wojciechow@partner.samsung.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201009220202.20834-14-l.wojciechow@partner.samsung.com",
    "date": "2020-10-09T22:02:00",
    "name": "[v6,13/15] test/distributor: add test with packets marking",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "86b09a02aaf3357518eda9afcb600137cef107a4",
    "submitter": {
        "id": 1628,
        "url": "https://patches.dpdk.org/api/people/1628/?format=api",
        "name": "Lukasz Wojciechowski",
        "email": "l.wojciechow@partner.samsung.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/20201009220202.20834-14-l.wojciechow@partner.samsung.com/mbox/",
    "series": [
        {
            "id": 12840,
            "url": "https://patches.dpdk.org/api/series/12840/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=12840",
            "date": "2020-10-09T22:01:47",
            "name": "fix distributor synchronization issues",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/12840/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/80242/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/80242/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 9AAEFA04BC;\n\tSat, 10 Oct 2020 00:07:14 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 3A7D41D6AF;\n\tSat, 10 Oct 2020 00:03:21 +0200 (CEST)",
            "from mailout2.w1.samsung.com (mailout2.w1.samsung.com\n [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 72F001D66A\n for <dev@dpdk.org>; Sat, 10 Oct 2020 00:03:10 +0200 (CEST)",
            "from eucas1p1.samsung.com (unknown [182.198.249.206])\n by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id\n 20201009220300euoutp020c1642af047a1bde88bd6d3ebbae504d~8cg-2V29X1684516845euoutp02y\n for <dev@dpdk.org>; Fri,  9 Oct 2020 22:03:00 +0000 (GMT)",
            "from eusmges1new.samsung.com (unknown [203.254.199.242]) by\n eucas1p1.samsung.com (KnoxPortal) with ESMTP id\n 20201009220254eucas1p1a85ddeb69360f58f057dcf40791e31c8~8cg6oLy1j1071010710eucas1p1f;\n Fri,  9 Oct 2020 22:02:54 +0000 (GMT)",
            "from eucas1p2.samsung.com ( [182.198.249.207]) by\n eusmges1new.samsung.com (EUCPMTA) with SMTP id 00.87.06456.E0ED08F5; Fri,  9\n Oct 2020 23:02:54 +0100 (BST)",
            "from eusmtrp2.samsung.com (unknown [182.198.249.139]) by\n eucas1p2.samsung.com (KnoxPortal) with ESMTPA id\n 20201009220253eucas1p2c0e27c3a495cb9603102b2cbf8a8f706~8cg5vnIMl1920419204eucas1p2W;\n Fri,  9 Oct 2020 22:02:53 +0000 (GMT)",
            "from eusmgms1.samsung.com (unknown [182.198.249.179]) by\n eusmtrp2.samsung.com (KnoxPortal) with ESMTP id\n 20201009220253eusmtrp2d2846ef4ae5c5a300f850b59de7b2fb0~8cg5vCM7F2402824028eusmtrp2B;\n Fri,  9 Oct 2020 22:02:53 +0000 (GMT)",
            "from eusmtip1.samsung.com ( [203.254.199.221]) by\n eusmgms1.samsung.com (EUCPMTA) with SMTP id A4.E2.06314.D0ED08F5; Fri,  9\n Oct 2020 23:02:53 +0100 (BST)",
            "from Padamandas.fritz.box (unknown [106.210.88.70]) by\n eusmtip1.samsung.com (KnoxPortal) with ESMTPA id\n 20201009220253eusmtip14fbeb38d36f65331065bdf48c4a0bc98~8cg5PbH0R1334813348eusmtip10;\n Fri,  9 Oct 2020 22:02:53 +0000 (GMT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com\n 20201009220300euoutp020c1642af047a1bde88bd6d3ebbae504d~8cg-2V29X1684516845euoutp02y",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com;\n s=mail20170921; t=1602280980;\n bh=H0SESRE59ofq6tEaPxg1A+VKjAU63AAfipdXXlkRUGc=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=ApxczXocZd1G/d6Ebr3BCY655eYg/r6UsUdf+IIv/s9rboh0v35LQMNyMdQDvfNX7\n /jCk9p/tazuKdbEtQITiyRrW4d22xTsBLVB73aiX6Eg1G3vGKzJWpzUpQVmptEKSlD\n m/qSaJnk5I7zWPGil+VgeLR/HY3+3wmezVJG/EPM=",
        "X-AuditID": "cbfec7f2-7efff70000001938-1b-5f80de0eb5fd",
        "From": "Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>",
        "To": "David Hunt <david.hunt@intel.com>",
        "Cc": "dev@dpdk.org, l.wojciechow@partner.samsung.com",
        "Date": "Sat, 10 Oct 2020 00:02:00 +0200",
        "Message-Id": "<20201009220202.20834-14-l.wojciechow@partner.samsung.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20201009220202.20834-1-l.wojciechow@partner.samsung.com>",
        "X-Brightmail-Tracker": [
            "\n H4sIAAAAAAAAA+NgFrrHIsWRmVeSWpSXmKPExsWy7djP87p89xriDZY907Tom/SRyeLdp+1M\n Fs961jE6MHv8WrCU1WPxnpdMHgff7WEKYI7isklJzcksSy3St0vgynj34hBbwWGtilVbTrM1\n MG5V7GLk5JAQMJH42HeDpYuRi0NIYAWjxJn9F6CcL4wSP66+ZoVwPjNKNK+byATTMvlkLyNE\n YjmjxOF/L9hBEkICnxgl3jezgdhsArYSR2Z+ZQWxRQRUJf7t/wTWzCxgJPGyeyJzFyMHh7CA\n p8SPX2BnsACVNPzeDFbCK+Am8ez4L3aIXfISqzccYAaxOYHirbuWgV0nIXCETWJeSyvUQS4S\n Zx+chmoQlnh1fAuULSPxf+d8JoiGbYwSV3//ZIRw9jNKXO9dAVVlDfTBbzaQi5gFNCXW79KH\n CDtKnFm7A+xQCQE+iRtvBSHu55OYtG06VJhXoqNNCKJaT+Jpz1RGmLV/1j5hgbA9JPonvYaG\n 6FVGiWWvp7BOYJSfhbBsASPjKkbx1NLi3PTUYsO81HK94sTc4tK8dL3k/NxNjMBYP/3v+Kcd\n jF8vJR1iFOBgVOLhbUhuiBdiTSwrrsw9xCjBwawkwut09nScEG9KYmVValF+fFFpTmrxIUZp\n DhYlcV7jRS9jhQTSE0tSs1NTC1KLYLJMHJxSDYzVW0LPHS35PN/jvczq2/syu/+KLPr4P1pI\n fllSw66C62tb75neDDm2pNbxZIHh16cP9n693PopzcRaborF62ebf89borv6bdmbf7a1K7Xu\n Hzrl03Jixnz9JMc53wUYei88U3b4Iziz6r3GAoMjf4J8J25duMo69WDMnPvTNmzZz3Tyh9vf\n u2GCq5RYijMSDbWYi4oTAeSwmW/xAgAA",
            "\n H4sIAAAAAAAAA+NgFtrPLMWRmVeSWpSXmKPExsVy+t/xu7q89xriDQ51qVv0TfrIZPHu03Ym\n i2c96xgdmD1+LVjK6rF4z0smj4Pv9jAFMEfp2RTll5akKmTkF5fYKkUbWhjpGVpa6BmZWOoZ\n GpvHWhmZKunb2aSk5mSWpRbp2yXoZbx7cYit4LBWxaotp9kaGLcqdjFyckgImEhMPtnL2MXI\n xSEksJRRYsGZVcxdjBxACRmJD5cEIGqEJf5c62KDqPnAKPHn1msWkASbgK3EkZlfWUFsEQFV\n iX/7PzGB2MxAQ2/Pa2IDmSMs4Cnx4xfYLhagkobfm8FKeAXcJJ4d/8UOMV9eYvWGA8wgNidQ\n vHXXMhaIXY2MElsOvGSewMi3gJFhFaNIamlxbnpusaFecWJucWleul5yfu4mRmDgbTv2c/MO\n xksbgw8xCnAwKvHwaiQ2xAuxJpYVV+YeYpTgYFYS4XU6ezpOiDclsbIqtSg/vqg0J7X4EKMp\n 0FUTmaVEk/OBUZFXEm9oamhuYWlobmxubGahJM7bIXAwRkggPbEkNTs1tSC1CKaPiYNTqoFx\n Vlfmuuufj9srV8R4LbyVu4x965HLeu4vIyQ9bkz6c3zrf8MLSwN1L7nu4mk/vOjoTZ7/l9mO\n lm15/+n0/JdBC9t1t3aLfA74ftrKrVhuVZ3IoptFMZerv8VlxD46Z9jouf/yCvaKyE+xVcpa\n 818Y2e9c4nKFvSbZTGeWa5vGf8toyUfvgln9lFiKMxINtZiLihMBVXDKhVICAAA="
        ],
        "X-CMS-MailID": "20201009220253eucas1p2c0e27c3a495cb9603102b2cbf8a8f706",
        "X-Msg-Generator": "CA",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "X-RootMTR": "20201009220253eucas1p2c0e27c3a495cb9603102b2cbf8a8f706",
        "X-EPHeader": "CA",
        "CMS-TYPE": "201P",
        "X-CMS-RootMailID": "20201009220253eucas1p2c0e27c3a495cb9603102b2cbf8a8f706",
        "References": "<20201008052323.11547-1-l.wojciechow@partner.samsung.com>\n <20201009220202.20834-1-l.wojciechow@partner.samsung.com>\n <CGME20201009220253eucas1p2c0e27c3a495cb9603102b2cbf8a8f706@eucas1p2.samsung.com>",
        "Subject": "[dpdk-dev] [PATCH v6 13/15] test/distributor: add test with packets\n\tmarking",
        "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": "All of the former tests analyzed only statistics\nof packets processed by all workers.\nThe new test verifies also if packets are processed\non workers as expected.\nEvery packets processed by the worker is marked\nand analyzed after it is returned to distributor.\n\nThis test allows finding issues in matching algorithms.\n\nSigned-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>\nAcked-by: David Hunt <david.hunt@intel.com>\n---\n app/test/test_distributor.c | 141 ++++++++++++++++++++++++++++++++++++\n 1 file changed, 141 insertions(+)",
    "diff": "diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c\nindex e8dd75078..4fc10b3cc 100644\n--- a/app/test/test_distributor.c\n+++ b/app/test/test_distributor.c\n@@ -542,6 +542,141 @@ test_flush_with_worker_shutdown(struct worker_params *wp,\n \treturn 0;\n }\n \n+static int\n+handle_and_mark_work(void *arg)\n+{\n+\tstruct rte_mbuf *buf[8] __rte_cache_aligned;\n+\tstruct worker_params *wp = arg;\n+\tstruct rte_distributor *db = wp->dist;\n+\tunsigned int num, i;\n+\tunsigned int id = __atomic_fetch_add(&worker_idx, 1, __ATOMIC_RELAXED);\n+\tnum = rte_distributor_get_pkt(db, id, buf, NULL, 0);\n+\twhile (!quit) {\n+\t\t__atomic_fetch_add(&worker_stats[id].handled_packets, num,\n+\t\t\t\t__ATOMIC_RELAXED);\n+\t\tfor (i = 0; i < num; i++)\n+\t\t\tbuf[i]->udata64 += id + 1;\n+\t\tnum = rte_distributor_get_pkt(db, id,\n+\t\t\t\tbuf, buf, num);\n+\t}\n+\t__atomic_fetch_add(&worker_stats[id].handled_packets, num,\n+\t\t\t__ATOMIC_RELAXED);\n+\trte_distributor_return_pkt(db, id, buf, num);\n+\treturn 0;\n+}\n+\n+/* sanity_mark_test sends packets to workers which mark them.\n+ * Every packet has also encoded sequence number.\n+ * The returned packets are sorted and verified if they were handled\n+ * by proper workers.\n+ */\n+static int\n+sanity_mark_test(struct worker_params *wp, struct rte_mempool *p)\n+{\n+\tconst unsigned int buf_count = 24;\n+\tconst unsigned int burst = 8;\n+\tconst unsigned int shift = 12;\n+\tconst unsigned int seq_shift = 10;\n+\n+\tstruct rte_distributor *db = wp->dist;\n+\tstruct rte_mbuf *bufs[buf_count];\n+\tstruct rte_mbuf *returns[buf_count];\n+\tunsigned int i, count, id;\n+\tunsigned int sorted[buf_count], seq;\n+\tunsigned int failed = 0;\n+\n+\tprintf(\"=== Marked packets test ===\\n\");\n+\tclear_packet_count();\n+\tif (rte_mempool_get_bulk(p, (void *)bufs, buf_count) != 0) {\n+\t\tprintf(\"line %d: Error getting mbufs from pool\\n\", __LINE__);\n+\t\treturn -1;\n+\t}\n+\n+\t/* bufs' hashes will be like these below, but shifted left.\n+\t * The shifting is for avoiding collisions with backlogs\n+\t * and in-flight tags left by previous tests.\n+\t * [1, 1, 1, 1, 1, 1, 1, 1\n+\t *  1, 1, 1, 1, 2, 2, 2, 2\n+\t *  2, 2, 2, 2, 1, 1, 1, 1]\n+\t */\n+\tfor (i = 0; i < burst; i++) {\n+\t\tbufs[0 * burst + i]->hash.usr = 1 << shift;\n+\t\tbufs[1 * burst + i]->hash.usr = ((i < burst / 2) ? 1 : 2)\n+\t\t\t<< shift;\n+\t\tbufs[2 * burst + i]->hash.usr = ((i < burst / 2) ? 2 : 1)\n+\t\t\t<< shift;\n+\t}\n+\t/* Assign a sequence number to each packet. The sequence is shifted,\n+\t * so that lower bits of the udate64 will hold mark from worker.\n+\t */\n+\tfor (i = 0; i < buf_count; i++)\n+\t\tbufs[i]->udata64 = i << seq_shift;\n+\n+\tcount = 0;\n+\tfor (i = 0; i < buf_count/burst; i++) {\n+\t\trte_distributor_process(db, &bufs[i * burst], burst);\n+\t\tcount += rte_distributor_returned_pkts(db, &returns[count],\n+\t\t\tbuf_count - count);\n+\t}\n+\n+\tdo {\n+\t\trte_distributor_flush(db);\n+\t\tcount += rte_distributor_returned_pkts(db, &returns[count],\n+\t\t\tbuf_count - count);\n+\t} while (count < buf_count);\n+\n+\tfor (i = 0; i < rte_lcore_count() - 1; i++)\n+\t\tprintf(\"Worker %u handled %u packets\\n\", i,\n+\t\t\t__atomic_load_n(&worker_stats[i].handled_packets,\n+\t\t\t\t\t__ATOMIC_RELAXED));\n+\n+\t/* Sort returned packets by sent order (sequence numbers). */\n+\tfor (i = 0; i < buf_count; i++) {\n+\t\tseq = returns[i]->udata64 >> seq_shift;\n+\t\tid = returns[i]->udata64 - (seq << seq_shift);\n+\t\tsorted[seq] = id;\n+\t}\n+\n+\t/* Verify that packets [0-11] and [20-23] were processed\n+\t * by the same worker\n+\t */\n+\tfor (i = 1; i < 12; i++) {\n+\t\tif (sorted[i] != sorted[0]) {\n+\t\t\tprintf(\"Packet number %u processed by worker %u,\"\n+\t\t\t\t\" but should be processes by worker %u\\n\",\n+\t\t\t\ti, sorted[i], sorted[0]);\n+\t\t\tfailed = 1;\n+\t\t}\n+\t}\n+\tfor (i = 20; i < 24; i++) {\n+\t\tif (sorted[i] != sorted[0]) {\n+\t\t\tprintf(\"Packet number %u processed by worker %u,\"\n+\t\t\t\t\" but should be processes by worker %u\\n\",\n+\t\t\t\ti, sorted[i], sorted[0]);\n+\t\t\tfailed = 1;\n+\t\t}\n+\t}\n+\t/* And verify that packets [12-19] were processed\n+\t * by the another worker\n+\t */\n+\tfor (i = 13; i < 20; i++) {\n+\t\tif (sorted[i] != sorted[12]) {\n+\t\t\tprintf(\"Packet number %u processed by worker %u,\"\n+\t\t\t\t\" but should be processes by worker %u\\n\",\n+\t\t\t\ti, sorted[i], sorted[12]);\n+\t\t\tfailed = 1;\n+\t\t}\n+\t}\n+\n+\trte_mempool_put_bulk(p, (void *)bufs, buf_count);\n+\n+\tif (failed)\n+\t\treturn -1;\n+\n+\tprintf(\"Marked packets test passed\\n\");\n+\treturn 0;\n+}\n+\n static\n int test_error_distributor_create_name(void)\n {\n@@ -726,6 +861,12 @@ test_distributor(void)\n \t\t\t\tgoto err;\n \t\t\tquit_workers(&worker_params, p);\n \n+\t\t\trte_eal_mp_remote_launch(handle_and_mark_work,\n+\t\t\t\t\t&worker_params, SKIP_MASTER);\n+\t\t\tif (sanity_mark_test(&worker_params, p) < 0)\n+\t\t\t\tgoto err;\n+\t\t\tquit_workers(&worker_params, p);\n+\n \t\t} else {\n \t\t\tprintf(\"Too few cores to run worker shutdown test\\n\");\n \t\t}\n",
    "prefixes": [
        "v6",
        "13/15"
    ]
}