get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 79983,
    "url": "http://patches.dpdk.org/api/patches/79983/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20201008052323.11547-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": "<20201008052323.11547-14-l.wojciechow@partner.samsung.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201008052323.11547-14-l.wojciechow@partner.samsung.com",
    "date": "2020-10-08T05:23:21",
    "name": "[v5,13/15] test/distributor: add test with packets marking",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "fc3ebb8edfc63aeaec09370fcd5d34fb32b3c382",
    "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/20201008052323.11547-14-l.wojciechow@partner.samsung.com/mbox/",
    "series": [
        {
            "id": 12767,
            "url": "http://patches.dpdk.org/api/series/12767/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12767",
            "date": "2020-10-08T05:23:09",
            "name": "fix distributor synchronization issues",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/12767/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/79983/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/79983/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 D70A0A04BC;\n\tThu,  8 Oct 2020 07:28:29 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 85E701BC0C;\n\tThu,  8 Oct 2020 07:24:08 +0200 (CEST)",
            "from mailout1.w1.samsung.com (mailout1.w1.samsung.com\n [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 87D171B733\n for <dev@dpdk.org>; Thu,  8 Oct 2020 07:23:47 +0200 (CEST)",
            "from eucas1p1.samsung.com (unknown [182.198.249.206])\n by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id\n 20201008052347euoutp012ea755b944c20017850914f822871e4c~77PSCGKJU2347823478euoutp01A\n for <dev@dpdk.org>; Thu,  8 Oct 2020 05:23:47 +0000 (GMT)",
            "from eusmges2new.samsung.com (unknown [203.254.199.244]) by\n eucas1p2.samsung.com (KnoxPortal) with ESMTP id\n 20201008052347eucas1p280cd984b68178743ed7774188d4f14a1~77PR6av9g2934729347eucas1p2W;\n Thu,  8 Oct 2020 05:23:47 +0000 (GMT)",
            "from eucas1p1.samsung.com ( [182.198.249.206]) by\n eusmges2new.samsung.com (EUCPMTA) with SMTP id 55.01.05997.362AE7F5; Thu,  8\n Oct 2020 06:23:47 +0100 (BST)",
            "from eusmtrp1.samsung.com (unknown [182.198.249.138]) by\n eucas1p1.samsung.com (KnoxPortal) with ESMTPA id\n 20201008052346eucas1p15b04bf84cafc2ba52bbe063f57d08c39~77PRW3p1u1495514955eucas1p1C;\n Thu,  8 Oct 2020 05:23:46 +0000 (GMT)",
            "from eusmgms2.samsung.com (unknown [182.198.249.180]) by\n eusmtrp1.samsung.com (KnoxPortal) with ESMTP id\n 20201008052346eusmtrp116169c7e5de2076253e5fe70aece2f75~77PRQf77Y2941629416eusmtrp1Z;\n Thu,  8 Oct 2020 05:23:46 +0000 (GMT)",
            "from eusmtip1.samsung.com ( [203.254.199.221]) by\n eusmgms2.samsung.com (EUCPMTA) with SMTP id 6E.F0.06017.262AE7F5; Thu,  8\n Oct 2020 06:23:46 +0100 (BST)",
            "from Padamandas.fritz.box (unknown [106.210.88.70]) by\n eusmtip1.samsung.com (KnoxPortal) with ESMTPA id\n 20201008052346eusmtip1b64152b47d6b23d57c700ec04fe88cef~77PQ0msyK2784127841eusmtip1-;\n Thu,  8 Oct 2020 05:23:45 +0000 (GMT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com\n 20201008052347euoutp012ea755b944c20017850914f822871e4c~77PSCGKJU2347823478euoutp01A",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com;\n s=mail20170921; t=1602134627;\n bh=jMHuFwore4XCujWFa4FPHZRC4UgHvZ5ghfXB+hPBmOQ=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=byeXNuHVkA7ynwyLJ2MkUMgUZYLfl/B4Oe2bV6BQVX89hYu/vjF8OG2f4r3pths7+\n qyCI33fDlZn4KpGJNEWrvgyIuHcgfdiGDGfluSYx8uuGh4rMKTSVA5EY92fqpzyGcL\n +gAZg2+qBMf78rnm8FAcAQ2/PVbCgxAPxUvUfFTA=",
        "X-AuditID": "cbfec7f4-65dff7000000176d-75-5f7ea2630eda",
        "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": "Thu,  8 Oct 2020 07:23:21 +0200",
        "Message-Id": "<20201008052323.11547-14-l.wojciechow@partner.samsung.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20201008052323.11547-1-l.wojciechow@partner.samsung.com>",
        "X-Brightmail-Tracker": [
            "\n H4sIAAAAAAAAA+NgFrrNIsWRmVeSWpSXmKPExsWy7djPc7rJi+riDe5sYrfom/SRyeLdp+1M\n Fs961jE6MHv8WrCU1WPxnpdMHgff7WEKYI7isklJzcksSy3St0vgytjSso+1oFWr4vn9iAbG\n XsUuRk4OCQETiZ8f57F1MXJxCAmsYJT4tOYdE4TzhVGieclaIIcDyPnMKNHuBdOwcuUOVoia\n 5UA19+ezgySEBD4xSkzaVgpiswnYShyZ+ZUVxBYRUJX4t/8TE4jNLGAk8bJ7IjOILSzgKTHh\n 9y1WkPksQDXL5giDhHkF3CTuTu1gg9glL7F6wwGwck6g+Nn/d8H2SggcYJP4OPMGK0SRi8SN\n R13sELawxKvjW6BsGYnTk3tYIBq2MUpc/f2TEcLZzyhxvXcFVJW1xOF/v9lArmAW0JRYv0sf\n IuwocXf2d7CwhACfxI23ghD38wG9OJ0ZIswr0dEmBFGtJ/G0ZyojzNo/a5+wQNgeEjee/YaG\n 51VGiR+L5zJOYJSfhbBsASPjKkbx1NLi3PTUYqO81HK94sTc4tK8dL3k/NxNjMAoP/3v+Jcd\n jLv+JB1iFOBgVOLhNThaGy/EmlhWXJl7iFGCg1lJhNfp7Ok4Id6UxMqq1KL8+KLSnNTiQ4zS\n HCxK4rzGi17GCgmkJ5akZqemFqQWwWSZODilGhj52eIPX/imr77SPoWxTHHhO9s8pcdMXwIy\n pjELPS2P+T1ndyz7gZL9x3nsWbtVPlhOyetPzvr1gfPpqU/+d5jF1xz3PpP1w8Ah6ZzkpoBd\n pizFc+dd8zp1m7/FxJ1r5jqOOZkBaxpeqgjb1L57J2Yfcq8uyfjaiYumx9667Dt5SYLzYV7e\n z+NKLMUZiYZazEXFiQD+VTcC7gIAAA==",
            "\n H4sIAAAAAAAAA+NgFtrHLMWRmVeSWpSXmKPExsVy+t/xu7pJi+riDTYtlbbom/SRyeLdp+1M\n Fs961jE6MHv8WrCU1WPxnpdMHgff7WEKYI7SsynKLy1JVcjILy6xVYo2tDDSM7S00DMysdQz\n NDaPtTIyVdK3s0lJzcksSy3St0vQy9jSso+1oFWr4vn9iAbGXsUuRk4OCQETiZUrd7B2MXJx\n CAksZZTo//eIpYuRAyghI/HhkgBEjbDEn2tdbBA1Hxgl7u29zwqSYBOwlTgy8yuYLSKgKvFv\n /ycmEJsZaOjteU1sILawgKfEhN+3WEFmsgDVLJsjDBLmFXCTuDu1gw1ivrzE6g0HmEFsTqD4\n 2f93oe5pZJS4eX4m2wRGvgWMDKsYRVJLi3PTc4uN9IoTc4tL89L1kvNzNzECw27bsZ9bdjB2\n vQs+xCjAwajEw2twtDZeiDWxrLgy9xCjBAezkgiv09nTcUK8KYmVValF+fFFpTmpxYcYTYGO\n msgsJZqcD4yJvJJ4Q1NDcwtLQ3Njc2MzCyVx3g6BgzFCAumJJanZqakFqUUwfUwcnFINjDN5\n Fpu+7uV8MO+UeoSqd3JC7GOX2Ey5ELHG+AXPFscnchzRDwmKO+C825gv2EhPzNm+NtCXMfFZ\n S8+eXtep1t5pptxf+SfMrhWKSvCY2XzXIvkm9xS5kzoTM4MZNH54nP1RxM5tErZI6uS7K07P\n HRi33c4+eX11nkhIwvxv1abG68Vn2D5UYinOSDTUYi4qTgQAXsCt/lECAAA="
        ],
        "X-CMS-MailID": "20201008052346eucas1p15b04bf84cafc2ba52bbe063f57d08c39",
        "X-Msg-Generator": "CA",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "X-RootMTR": "20201008052346eucas1p15b04bf84cafc2ba52bbe063f57d08c39",
        "X-EPHeader": "CA",
        "CMS-TYPE": "201P",
        "X-CMS-RootMailID": "20201008052346eucas1p15b04bf84cafc2ba52bbe063f57d08c39",
        "References": "<20200925224209.12173-1-l.wojciechow@partner.samsung.com>\n <20201008052323.11547-1-l.wojciechow@partner.samsung.com>\n <CGME20201008052346eucas1p15b04bf84cafc2ba52bbe063f57d08c39@eucas1p1.samsung.com>",
        "Subject": "[dpdk-dev] [PATCH v5 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>\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 1e0a079ff..0404e463a 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_ACQ_REL);\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_ACQ_REL);\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+/* bufs' hashes will be like these below, but shifted left.\n+ * The shifting is for avoiding collisions with backlogs\n+ * and in-flight tags left by previous tests.\n+ * [1, 1, 1, 1, 1, 1, 1, 1\n+ *  1, 1, 1, 1, 2, 2, 2, 2\n+ *  2, 2, 2, 2, 1, 1, 1, 1]\n+ */\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+/* Assign a sequence number to each packet. The sequence is shifted,\n+ * so that lower bits of the udate64 will hold mark from worker.\n+ */\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_ACQUIRE));\n+\n+/* 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+/* Verify that packets [0-11] and [20-23] were processed\n+ * by the same worker\n+ */\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+/* And verify that packets [12-19] were processed\n+ * by the another worker\n+ */\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": [
        "v5",
        "13/15"
    ]
}