get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 60711,
    "url": "https://patches.dpdk.org/api/patches/60711/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20191008163350.20779-6-stephen@networkplumber.org/",
    "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": "<20191008163350.20779-6-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191008163350.20779-6-stephen@networkplumber.org",
    "date": "2019-10-08T16:33:50",
    "name": "[v6,5/5] mbuf: add pktmbuf copy test",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "880e76be6de143a90678aa4451e8f37562f80fc5",
    "submitter": {
        "id": 27,
        "url": "https://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "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/20191008163350.20779-6-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 6746,
            "url": "https://patches.dpdk.org/api/series/6746/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=6746",
            "date": "2019-10-08T16:33:45",
            "name": "mbuf: copy/cloning enhancements",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/6746/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/60711/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/60711/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 4D7181DFE3;\n\tTue,  8 Oct 2019 18:34:12 +0200 (CEST)",
            "from mail-pf1-f194.google.com (mail-pf1-f194.google.com\n\t[209.85.210.194]) by dpdk.org (Postfix) with ESMTP id 12B831D42B\n\tfor <dev@dpdk.org>; Tue,  8 Oct 2019 18:34:05 +0200 (CEST)",
            "by mail-pf1-f194.google.com with SMTP id x127so11066677pfb.7\n\tfor <dev@dpdk.org>; Tue, 08 Oct 2019 09:34:04 -0700 (PDT)",
            "from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127])\n\tby smtp.gmail.com with ESMTPSA id\n\t18sm17702551pfp.100.2019.10.08.09.34.02\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 08 Oct 2019 09:34:02 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=networkplumber-org.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=LYiypZaEWrK3SD786cwpvQB7zDQwprOL/UnAs+oU7Sc=;\n\tb=lZM+K/VHFXuj/+XC2y315Utc9lhl3H0IVnzp8qsqkiBXWT3sAXXpkPShVpxuy3ajjs\n\tikUZ5JUzLZ7y6QuGpJjdGAlpcMrKKZdBlkPyV3p+ivMQgxMJIxWTUiohpiEoINThnWvU\n\tt26o3zqOCbPoWy6jlzZHX5DcS1cPRsWa0Z/pxU4mOJ+UGqUcw6gOOAeRNv/qgURxODxo\n\taa2i7gQir5g9rCDpD+ysU0gPWsmiV+V4AAQrUh/Iw3vJhWpRJden7nSekllvGTxBkJcv\n\thcS4toFtHrea9mbu8io4SKU7M/LT6pi9ehQZc0sR6Mpre9lq3tlfZtj92vm17JqojzIc\n\tVavQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=LYiypZaEWrK3SD786cwpvQB7zDQwprOL/UnAs+oU7Sc=;\n\tb=t2Vl9bKQ1aPQT9FaJFD9e54h3QFXFpznjpzsao5lsIfr63jmwG32X6PcyFU/Uzcl25\n\tu7/XEQUyJWZJxUM5rsTORo69HRJTa2Gj09j49eMSE7Bf5TBBG8JiGBU0xi828bhoDTdv\n\tIy9fQcFzCZPuT4IHnc/zLPK/bIrnkeXT1UTYwOQTzq/u6OmYdk5TtqQK+qh5FgwlwTmt\n\td44i72kUZ7NIUQrPqfCcsE0EDPwoqud3FAiUOPTh0lGOwuk5x/EQ9z4DzcvTLvIOv6+x\n\tr0DcLSTdgPErs37o4xdsep3pcxXPjjrG0TwPGsRGuCiaQQ7F4fd4RoHjmrxpbpcNo/92\n\thlyg==",
        "X-Gm-Message-State": "APjAAAVYjH+FPwEoliwd9T90YDOaYQ2wPuibjg4m1UQIN/DKx5zgeau/\n\t+GZr6zmaZb0LO/eVRXhgtr6kGVt9pLzQSQ==",
        "X-Google-Smtp-Source": "APXvYqxWvNHd+nBMYOx3/dtoIBBIba0t+iGaHNUzOBesxY+mpdVltA3AjcEExyZ4xZypmq9WaYegFw==",
        "X-Received": "by 2002:a63:e14:: with SMTP id d20mr36901303pgl.33.1570552443745;\n\tTue, 08 Oct 2019 09:34:03 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>,\n\tOlivier Matz <olivier.matz@6wind.com>",
        "Date": "Tue,  8 Oct 2019 09:33:50 -0700",
        "Message-Id": "<20191008163350.20779-6-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20191008163350.20779-1-stephen@networkplumber.org>",
        "References": "<20190928003758.18489-1-stephen@networkplumber.org>\n\t<20191008163350.20779-1-stephen@networkplumber.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v6 5/5] mbuf: add pktmbuf copy test",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "New test for rte_pktmbuf_copy based of the clone tests.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\nAcked-by: Olivier Matz <olivier.matz@6wind.com>\n---\n app/test/test_mbuf.c | 157 +++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 157 insertions(+)",
    "diff": "diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c\nindex aafad0cf6206..0df6b0e12a39 100644\n--- a/app/test/test_mbuf.c\n+++ b/app/test/test_mbuf.c\n@@ -399,6 +399,158 @@ testclone_testupdate_testdetach(struct rte_mempool *pktmbuf_pool)\n \treturn -1;\n }\n \n+static int\n+test_pktmbuf_copy(struct rte_mempool *pktmbuf_pool)\n+{\n+\tstruct rte_mbuf *m = NULL;\n+\tstruct rte_mbuf *copy = NULL;\n+\tstruct rte_mbuf *copy2 = NULL;\n+\tstruct rte_mbuf *clone = NULL;\n+\tunaligned_uint32_t *data;\n+\n+\t/* alloc a mbuf */\n+\tm = rte_pktmbuf_alloc(pktmbuf_pool);\n+\tif (m == NULL)\n+\t\tGOTO_FAIL(\"ooops not allocating mbuf\");\n+\n+\tif (rte_pktmbuf_pkt_len(m) != 0)\n+\t\tGOTO_FAIL(\"Bad length\");\n+\n+\trte_pktmbuf_append(m, sizeof(uint32_t));\n+\tdata = rte_pktmbuf_mtod(m, unaligned_uint32_t *);\n+\t*data = MAGIC_DATA;\n+\n+\t/* copy the allocated mbuf */\n+\tcopy = rte_pktmbuf_copy(m, pktmbuf_pool, 0, UINT32_MAX);\n+\tif (copy == NULL)\n+\t\tGOTO_FAIL(\"cannot copy data\\n\");\n+\n+\tif (rte_pktmbuf_pkt_len(copy) != sizeof(uint32_t))\n+\t\tGOTO_FAIL(\"copy length incorrect\\n\");\n+\n+\tif (rte_pktmbuf_data_len(copy) != sizeof(uint32_t))\n+\t\tGOTO_FAIL(\"copy data length incorrect\\n\");\n+\n+\tdata = rte_pktmbuf_mtod(copy, unaligned_uint32_t *);\n+\tif (*data != MAGIC_DATA)\n+\t\tGOTO_FAIL(\"invalid data in copy\\n\");\n+\n+\t/* free the copy */\n+\trte_pktmbuf_free(copy);\n+\tcopy = NULL;\n+\n+\t/* same test with a cloned mbuf */\n+\tclone = rte_pktmbuf_clone(m, pktmbuf_pool);\n+\tif (clone == NULL)\n+\t\tGOTO_FAIL(\"cannot clone data\\n\");\n+\n+\tif (!RTE_MBUF_CLONED(clone))\n+\t\tGOTO_FAIL(\"clone did not give a cloned mbuf\\n\");\n+\n+\tcopy = rte_pktmbuf_copy(clone, pktmbuf_pool, 0, UINT32_MAX);\n+\tif (copy == NULL)\n+\t\tGOTO_FAIL(\"cannot copy cloned mbuf\\n\");\n+\n+\tif (RTE_MBUF_CLONED(copy))\n+\t\tGOTO_FAIL(\"copy of clone is cloned?\\n\");\n+\n+\tif (rte_pktmbuf_pkt_len(copy) != sizeof(uint32_t))\n+\t\tGOTO_FAIL(\"copy clone length incorrect\\n\");\n+\n+\tif (rte_pktmbuf_data_len(copy) != sizeof(uint32_t))\n+\t\tGOTO_FAIL(\"copy clone data length incorrect\\n\");\n+\n+\tdata = rte_pktmbuf_mtod(copy, unaligned_uint32_t *);\n+\tif (*data != MAGIC_DATA)\n+\t\tGOTO_FAIL(\"invalid data in clone copy\\n\");\n+\trte_pktmbuf_free(clone);\n+\trte_pktmbuf_free(copy);\n+\tcopy = NULL;\n+\tclone = NULL;\n+\n+\n+\t/* same test with a chained mbuf */\n+\tm->next = rte_pktmbuf_alloc(pktmbuf_pool);\n+\tif (m->next == NULL)\n+\t\tGOTO_FAIL(\"Next Pkt Null\\n\");\n+\tm->nb_segs = 2;\n+\n+\trte_pktmbuf_append(m->next, sizeof(uint32_t));\n+\tm->pkt_len = 2 * sizeof(uint32_t);\n+\tdata = rte_pktmbuf_mtod(m->next, unaligned_uint32_t *);\n+\t*data = MAGIC_DATA + 1;\n+\n+\tcopy = rte_pktmbuf_copy(m, pktmbuf_pool, 0, UINT32_MAX);\n+\tif (copy == NULL)\n+\t\tGOTO_FAIL(\"cannot copy data\\n\");\n+\n+\tif (rte_pktmbuf_pkt_len(copy) != 2 * sizeof(uint32_t))\n+\t\tGOTO_FAIL(\"chain copy length incorrect\\n\");\n+\n+\tif (rte_pktmbuf_data_len(copy) != 2 * sizeof(uint32_t))\n+\t\tGOTO_FAIL(\"chain copy data length incorrect\\n\");\n+\n+\tdata = rte_pktmbuf_mtod(copy, unaligned_uint32_t *);\n+\tif (data[0] != MAGIC_DATA || data[1] != MAGIC_DATA + 1)\n+\t\tGOTO_FAIL(\"invalid data in copy\\n\");\n+\n+\trte_pktmbuf_free(copy2);\n+\n+\t/* test offset copy */\n+\tcopy2 = rte_pktmbuf_copy(copy, pktmbuf_pool,\n+\t\t\t\t sizeof(uint32_t), UINT32_MAX);\n+\tif (copy2 == NULL)\n+\t\tGOTO_FAIL(\"cannot copy the copy\\n\");\n+\n+\tif (rte_pktmbuf_pkt_len(copy2) != sizeof(uint32_t))\n+\t\tGOTO_FAIL(\"copy with offset, length incorrect\\n\");\n+\n+\tif (rte_pktmbuf_data_len(copy2) != sizeof(uint32_t))\n+\t\tGOTO_FAIL(\"copy with offset, data length incorrect\\n\");\n+\n+\tdata = rte_pktmbuf_mtod(copy2, unaligned_uint32_t *);\n+\tif (data[0] != MAGIC_DATA + 1)\n+\t\tGOTO_FAIL(\"copy with offset, invalid data\\n\");\n+\n+\trte_pktmbuf_free(copy2);\n+\n+\t/* test truncation copy */\n+\tcopy2 = rte_pktmbuf_copy(copy, pktmbuf_pool,\n+\t\t\t\t 0, sizeof(uint32_t));\n+\tif (copy2 == NULL)\n+\t\tGOTO_FAIL(\"cannot copy the copy\\n\");\n+\n+\tif (rte_pktmbuf_pkt_len(copy2) != sizeof(uint32_t))\n+\t\tGOTO_FAIL(\"copy with truncate, length incorrect\\n\");\n+\n+\tif (rte_pktmbuf_data_len(copy2) != sizeof(uint32_t))\n+\t\tGOTO_FAIL(\"copy with truncate, data length incorrect\\n\");\n+\n+\tdata = rte_pktmbuf_mtod(copy2, unaligned_uint32_t *);\n+\tif (data[0] != MAGIC_DATA)\n+\t\tGOTO_FAIL(\"copy with truncate, invalid data\\n\");\n+\n+\t/* free mbuf */\n+\trte_pktmbuf_free(m);\n+\trte_pktmbuf_free(copy);\n+\trte_pktmbuf_free(copy2);\n+\n+\tm = NULL;\n+\tcopy = NULL;\n+\tcopy2 = NULL;\n+\tprintf(\"%s ok\\n\", __func__);\n+\treturn 0;\n+\n+fail:\n+\tif (m)\n+\t\trte_pktmbuf_free(m);\n+\tif (copy)\n+\t\trte_pktmbuf_free(copy);\n+\tif (copy2)\n+\t\trte_pktmbuf_free(copy2);\n+\treturn -1;\n+}\n+\n static int\n test_attach_from_different_pool(struct rte_mempool *pktmbuf_pool,\n \t\t\t\tstruct rte_mempool *pktmbuf_pool2)\n@@ -1203,6 +1355,11 @@ test_mbuf(void)\n \t\tgoto err;\n \t}\n \n+\tif (test_pktmbuf_copy(pktmbuf_pool) < 0) {\n+\t\tprintf(\"test_pktmbuf_copy() failed.\\n\");\n+\t\tgoto err;\n+\t}\n+\n \tif (test_attach_from_different_pool(pktmbuf_pool, pktmbuf_pool2) < 0) {\n \t\tprintf(\"test_attach_from_different_pool() failed\\n\");\n \t\tgoto err;\n",
    "prefixes": [
        "v6",
        "5/5"
    ]
}