get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 81181,
    "url": "http://patches.dpdk.org/api/patches/81181/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20201017030701.16134-14-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-14-l.wojciechow@partner.samsung.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201017030701.16134-14-l.wojciechow@partner.samsung.com",
    "date": "2020-10-17T03:06:57",
    "name": "[v8,13/17] test/distributor: add test with packets marking",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "86b09a02aaf3357518eda9afcb600137cef107a4",
    "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-14-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/81181/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/81181/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 7FEC9A04DB;\n\tSat, 17 Oct 2020 05:13:58 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 06459FC34;\n\tSat, 17 Oct 2020 05:08:24 +0200 (CEST)",
            "from mailout1.w1.samsung.com (mailout1.w1.samsung.com\n [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 0CA59E2BF\n for <dev@dpdk.org>; Sat, 17 Oct 2020 05:07:50 +0200 (CEST)",
            "from eucas1p2.samsung.com (unknown [182.198.249.207])\n by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id\n 20201017030727euoutp0110bd4fbfdc2b1a9f60c36fe9a191fc1f~_qL0RG3xe1627116271euoutp01b\n for <dev@dpdk.org>; Sat, 17 Oct 2020 03:07:27 +0000 (GMT)",
            "from eusmges3new.samsung.com (unknown [203.254.199.245]) by\n eucas1p1.samsung.com (KnoxPortal) with ESMTP id\n 20201017030721eucas1p12ead66bc746e018d3e4d19b8b0465edf~_qLugm-oa0898308983eucas1p17;\n Sat, 17 Oct 2020 03:07:21 +0000 (GMT)",
            "from eucas1p1.samsung.com ( [182.198.249.206]) by\n eusmges3new.samsung.com (EUCPMTA) with SMTP id 09.D5.06318.9EF5A8F5; Sat, 17\n Oct 2020 04:07:21 +0100 (BST)",
            "from eusmtrp2.samsung.com (unknown [182.198.249.139]) by\n eucas1p1.samsung.com (KnoxPortal) with ESMTPA id\n 20201017030720eucas1p1359382fafa661abb1ba82fa65e19562c~_qLt_RcA72252822528eucas1p12;\n Sat, 17 Oct 2020 03:07:20 +0000 (GMT)",
            "from eusmgms1.samsung.com (unknown [182.198.249.179]) by\n eusmtrp2.samsung.com (KnoxPortal) with ESMTP id\n 20201017030720eusmtrp28fbece19743db7098239e41d575e3f3a~_qLt9zbMy2572125721eusmtrp2k;\n Sat, 17 Oct 2020 03:07:20 +0000 (GMT)",
            "from eusmtip1.samsung.com ( [203.254.199.221]) by\n eusmgms1.samsung.com (EUCPMTA) with SMTP id 4C.99.06314.8EF5A8F5; Sat, 17\n Oct 2020 04:07:20 +0100 (BST)",
            "from localhost.localdomain (unknown [106.210.88.70]) by\n eusmtip1.samsung.com (KnoxPortal) with ESMTPA id\n 20201017030720eusmtip192a41e4b2a463ec92c45998780623990~_qLthzjng0424404244eusmtip1R;\n Sat, 17 Oct 2020 03:07:20 +0000 (GMT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com\n 20201017030727euoutp0110bd4fbfdc2b1a9f60c36fe9a191fc1f~_qL0RG3xe1627116271euoutp01b",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com;\n s=mail20170921; t=1602904047;\n bh=KYVc1+6CtSGD0DPYSHvyk1Sa6nIsG/kBvkm4YykYcng=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=fsRsNI8qYMnSbejE4xij77fUrloqajHkTZMG5Jv7dOEIRMwcDvfD57Fdi3ZUaee9a\n Ngd3E+5xHPmTL7Kw+oP6xtTgSrqx8qSRF0riZ8dKZCnz0lRnY95fNds9qw/pW7j+Yq\n CREiYW2960IrXM0ViZ5IUUkfq+8TAe56aq+YeT/o=",
        "X-AuditID": "cbfec7f5-38bff700000018ae-9c-5f8a5fe9f400",
        "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, 17 Oct 2020 05:06:57 +0200",
        "Message-Id": "<20201017030701.16134-14-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+NgFrrPIsWRmVeSWpSXmKPExsWy7djPc7ov47viDQ6fZLXom/SRyeLdp+1M\n Fs961jE6MHv8WrCU1WPxnpdMHgff7WEKYI7isklJzcksSy3St0vgyvi86jpjwWGtitd3JrA2\n MG5V7GLk5JAQMJHYtu06WxcjF4eQwApGiYdHDzBBOF8YJW7Nf8kM4XxmlHh8pY0NpuXrx59Q\n ieWMEgcm9SNUnbn6FKyKTcBW4sjMr6wgtoiAqsS//Z+YQGxmASOJl90TmUFsYQFPiT1HWxhB\n bBagmiv3/oPFeQXcJLbMPsEIsU1eYvWGA0BxDg5OoHjjcVeQXRICR9gkrjY8YIaocZG4e3wj\n O4QtLPHq+BYoW0bi/875TBAN2xglrv7+yQjh7GeUuN67AqrKWuLwv99sIBuYBTQl1u/Shwg7\n SlzpvcAEEpYQ4JO48VYQ4n4+iUnbpjNDhHklOtqEIKr1JJ72TGWEWftn7RMWCNtD4vjtr9Dw\n ucoo8abhFfMERvlZCMsWMDKuYhRPLS3OTU8tNs5LLdcrTswtLs1L10vOz93ECIz20/+Of93B\n uO9P0iFGAQ5GJR5ejqWd8UKsiWXFlbmHGCU4mJVEeJ3Ono4T4k1JrKxKLcqPLyrNSS0+xCjN\n waIkzmu86GWskEB6YklqdmpqQWoRTJaJg1OqgVHGuOVToIryFtHzS1b+qtBgD17Rf7fAodG0\n Pe73patnjwZ2ZbKcb719u/PL9CaBH/wRETf+Te447D3n0n8vIeGd93Zl5p6fOGnxBoElB1Kt\n 99vMsTC8NmthUOlOg8JfnSu+qGso1kbd0nWaEzt7S6yZtLXB/TNLo8/Ef3M58P/WM678ur/h\n lruUWIozEg21mIuKEwET9lVU8gIAAA==",
            "\n H4sIAAAAAAAAA+NgFtrPLMWRmVeSWpSXmKPExsVy+t/xu7ov4rviDbbuU7Lom/SRyeLdp+1M\n Fs961jE6MHv8WrCU1WPxnpdMHgff7WEKYI7SsynKLy1JVcjILy6xVYo2tDDSM7S00DMysdQz\n NDaPtTIyVdK3s0lJzcksSy3St0vQy/i86jpjwWGtitd3JrA2MG5V7GLk5JAQMJH4+vEncxcj\n F4eQwFJGiZ1P9gA5HEAJGYkPlwQgaoQl/lzrYoOo+cgo0X59OztIgk3AVuLIzK+sILaIgKrE\n v/2fmEBsZqCht+c1sYHYwgKeEnuOtjCC2CxANVfu/WcGsXkF3CS2zD7BCLFAXmL1hgNgezmB\n 4o3HXSF2NTJKnJ21jmUCI98CRoZVjCKppcW56bnFhnrFibnFpXnpesn5uZsYgYG37djPzTsY\n L20MPsQowMGoxMO7YVFnvBBrYllxZe4hRgkOZiURXqezp+OEeFMSK6tSi/Lji0pzUosPMZoC\n HTWRWUo0OR8YFXkl8YamhuYWlobmxubGZhZK4rwdAgdjhATSE0tSs1NTC1KLYPqYODilGhjD\n lRy8U+eeifmybHbN95vvb5f3cgCj6rFeflqXyCo2aZ5Jjw/n7XA1TL72coGJCtNlTav8wiOr\n d9u/nb3o+pFvh/lUZ9+YbHDyZUrZzgD5etn9uxT2BZ39/37Wd+nk8ylb8mb+Pth5fnvRqsaN\n z2xX8Oxfeb1tdey5PzMNXWZkH9j0sF2gbPclJZbijERDLeai4kQAJ0OBJlICAAA="
        ],
        "X-CMS-MailID": "20201017030720eucas1p1359382fafa661abb1ba82fa65e19562c",
        "X-Msg-Generator": "CA",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "X-RootMTR": "20201017030720eucas1p1359382fafa661abb1ba82fa65e19562c",
        "X-EPHeader": "CA",
        "CMS-TYPE": "201P",
        "X-CMS-RootMailID": "20201017030720eucas1p1359382fafa661abb1ba82fa65e19562c",
        "References": "<20201010160508.19709-1-l.wojciechow@partner.samsung.com>\n <20201017030701.16134-1-l.wojciechow@partner.samsung.com>\n <CGME20201017030720eucas1p1359382fafa661abb1ba82fa65e19562c@eucas1p1.samsung.com>",
        "Subject": "[dpdk-dev] [PATCH v8 13/17] 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 fdb6ea9ce..cfae5a1ac 100644\n--- a/app/test/test_distributor.c\n+++ b/app/test/test_distributor.c\n@@ -543,6 +543,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@@ -727,6 +862,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": [
        "v8",
        "13/17"
    ]
}