Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/60629/?format=api
http://patches.dpdk.org/api/patches/60629/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191007154343.8556-6-stephen@networkplumber.org/", "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": "<20191007154343.8556-6-stephen@networkplumber.org>", "list_archive_url": "https://inbox.dpdk.org/dev/20191007154343.8556-6-stephen@networkplumber.org", "date": "2019-10-07T15:43:43", "name": "[v5,5/5] mbuf: add pktmbuf copy test", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "3c7a7200de7f6fdc8647ccb6e70bde120c3684a9", "submitter": { "id": 27, "url": "http://patches.dpdk.org/api/people/27/?format=api", "name": "Stephen Hemminger", "email": "stephen@networkplumber.org" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20191007154343.8556-6-stephen@networkplumber.org/mbox/", "series": [ { "id": 6725, "url": "http://patches.dpdk.org/api/series/6725/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=6725", "date": "2019-10-07T15:43:38", "name": "mbuf copy/cloning enhancements", "version": 5, "mbox": "http://patches.dpdk.org/series/6725/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/60629/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/60629/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 F0E071C43E;\n\tMon, 7 Oct 2019 17:44:04 +0200 (CEST)", "from mail-pf1-f195.google.com (mail-pf1-f195.google.com\n\t[209.85.210.195]) by dpdk.org (Postfix) with ESMTP id CF4F31C1F8\n\tfor <dev@dpdk.org>; Mon, 7 Oct 2019 17:43:58 +0200 (CEST)", "by mail-pf1-f195.google.com with SMTP id y72so8873649pfb.12\n\tfor <dev@dpdk.org>; Mon, 07 Oct 2019 08:43:58 -0700 (PDT)", "from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127])\n\tby smtp.gmail.com with ESMTPSA id\n\tk5sm20779345pfp.109.2019.10.07.08.43.56\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 07 Oct 2019 08:43:56 -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=hnJVNme230AHorC9MqsxxOvVRW7V8JTUGHH+CXxU7nQ=;\n\tb=DfqksnP82UmaAp2xMelex1CZXFaaPqFBYz/0DCqP5hWij7hFx9jE1nxzbtzAZaRb3t\n\tPVQh3kIswAmp+uL9QEdDzo+Ysy8dDSDvWK/hGKv9zk/ersjWYZHu4NgxmvBONw49mIWc\n\t+ZsYkDz0DTpffwZaaqzrBum3d2sLKtlyWSIOgFndxaeFkMOHbYOdQjXNXuVb+6T+nKdc\n\tDpqFTDKaW/Ad2JKc7sJDbovTCmMBrb5XWnqYvayLBwKVMf2OycaUlYRFaYJptqbtYCn2\n\t5Fl1XofiyAVUaPuClJ4e6tvxeHYfC91LdYhC/el/ChN7vef2VhsdVAR3SHQ88/mbrnCy\n\t16UA==", "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=hnJVNme230AHorC9MqsxxOvVRW7V8JTUGHH+CXxU7nQ=;\n\tb=Lr1etXh8K+Bz2PnzIzNNa12C05R+GcrJL9b0sVOxWFLYG+Hke8fKY1l3cZPedCS7D3\n\tsnLOjxGSGP+5Mew/aYGll10rAFFecA5JPZYMwnQkNbriCT2Vaec594Yndas4McL3Wh+Y\n\tWgoh3J5hl3qLeI+bcVxGQ8KWTYK7VVaoyWcm7Qrga2LyT/voTinDbJ5epzYLFRG5mqaK\n\txxitpPm9DpJCnfFBdjQ0Rny6YfFaczboCIXH3AfpHQI42Wn3q74/k0opdoyzV+Q8cz93\n\to/xGwdtWl3y8IYw8qgggwr2e9SG9gTmDyBBRfoo/l4/Xy4vHKtrHDL7AtNhG+xzCp/zH\n\tqvlg==", "X-Gm-Message-State": "APjAAAVxtXApB8boOH1XoyCUN3cjJJpcMuKm/xNSzf5a0lnsrH6Bng0z\n\tYtYbePL33JeOmH2sNPl2wPimLg2JaECGxQ==", "X-Google-Smtp-Source": "APXvYqxd/d3b5I+RjoxZQS7yCGsKJhiHEZ9MLsB8IAB4jD7ZfhvM03A1IrW9mDfi0GrlSPKqFpPYpw==", "X-Received": "by 2002:a63:2a08:: with SMTP id\n\tq8mr31894764pgq.421.1570463037734; \n\tMon, 07 Oct 2019 08:43:57 -0700 (PDT)", "From": "Stephen Hemminger <stephen@networkplumber.org>", "To": "dev@dpdk.org", "Cc": "Stephen Hemminger <stephen@networkplumber.org>", "Date": "Mon, 7 Oct 2019 08:43:43 -0700", "Message-Id": "<20191007154343.8556-6-stephen@networkplumber.org>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20191007154343.8556-1-stephen@networkplumber.org>", "References": "<20190928003758.18489-1-stephen@networkplumber.org>\n\t<20191007154343.8556-1-stephen@networkplumber.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v5 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>\n---\n app/test/test_mbuf.c | 126 +++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 126 insertions(+)", "diff": "diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c\nindex aafad0cf6206..49c3a5f7893c 100644\n--- a/app/test/test_mbuf.c\n+++ b/app/test/test_mbuf.c\n@@ -399,6 +399,127 @@ 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+\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 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 +1324,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": [ "v5", "5/5" ] }{ "id": 60629, "url": "