Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/123658/?format=api
http://patchwork.dpdk.org/api/patches/123658/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230210065407.209567-3-kamalakshitha.aligeri@arm.com/", "project": { "id": 1, "url": "http://patchwork.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": "<20230210065407.209567-3-kamalakshitha.aligeri@arm.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230210065407.209567-3-kamalakshitha.aligeri@arm.com", "date": "2023-02-10T06:54:07", "name": "[v2,2/2] test/mempool: add zero-copy API's", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "9c252ccd1fdac8f1061fe79c1230c854f7f08ef2", "submitter": { "id": 2887, "url": "http://patchwork.dpdk.org/api/people/2887/?format=api", "name": "Kamalakshitha Aligeri", "email": "kamalakshitha.aligeri@arm.com" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230210065407.209567-3-kamalakshitha.aligeri@arm.com/mbox/", "series": [ { "id": 26941, "url": "http://patchwork.dpdk.org/api/series/26941/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=26941", "date": "2023-02-10T06:54:05", "name": "Integrated mempool cache zero-copy API's", "version": 2, "mbox": "http://patchwork.dpdk.org/series/26941/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/123658/comments/", "check": "fail", "checks": "http://patchwork.dpdk.org/api/patches/123658/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 51D7441C5B;\n\tFri, 10 Feb 2023 07:54:45 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 40C7B42B71;\n\tFri, 10 Feb 2023 07:54:45 +0100 (CET)", "from foss.arm.com (foss.arm.com [217.140.110.172])\n by mails.dpdk.org (Postfix) with ESMTP id C801B40EE3\n for <dev@dpdk.org>; Fri, 10 Feb 2023 07:54:43 +0100 (CET)", "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C2EB34B3;\n Thu, 9 Feb 2023 22:55:25 -0800 (PST)", "from ampere-altra-2-1.usa.Arm.com (ampere-altra-2-1.usa.arm.com\n [10.118.91.158])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 25EF53F8C6;\n Thu, 9 Feb 2023 22:54:43 -0800 (PST)" ], "From": "Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>", "To": "Yuying.Zhang@intel.com, beilei.xing@intel.com, olivier.matz@6wind.com,\n andrew.rybchenko@oktetlabs.ru, bruce.richardson@intel.com,\n mb@smartsharesystems.com, konstantin.ananyev@huawei.com,\n Honnappa.Nagarahalli@arm.com, ruifeng.wang@arm.com, feifei.wang2@arm.com", "Cc": "dev@dpdk.org, nd@arm.com,\n Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>", "Subject": "[PATCH v2 2/2] test/mempool: add zero-copy API's", "Date": "Fri, 10 Feb 2023 06:54:07 +0000", "Message-Id": "<20230210065407.209567-3-kamalakshitha.aligeri@arm.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20230210065407.209567-1-kamalakshitha.aligeri@arm.com>", "References": "<20230209062501.142828-1-kamalakshitha.aligeri@arm.com>\n <20230210065407.209567-1-kamalakshitha.aligeri@arm.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "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" }, "content": "Added mempool test cases with zero-copy get and put API's\n\nSigned-off-by: Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>\nReviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>\nReviewed-by: Feifei Wang <feifei.wang2@arm.com>\n---\nLink: https://patchwork.dpdk.org/project/dpdk/patch/20230209145833.129986-1-mb@smartsharesystems.com/\n\n app/test/test_mempool.c | 81 ++++++++++++++++++++++++++++++-----------\n 1 file changed, 60 insertions(+), 21 deletions(-)\n\n--\n2.25.1", "diff": "diff --git a/app/test/test_mempool.c b/app/test/test_mempool.c\nindex 8e493eda47..6d29f5bc7b 100644\n--- a/app/test/test_mempool.c\n+++ b/app/test/test_mempool.c\n@@ -74,7 +74,7 @@ my_obj_init(struct rte_mempool *mp, __rte_unused void *arg,\n\n /* basic tests (done on one core) */\n static int\n-test_mempool_basic(struct rte_mempool *mp, int use_external_cache)\n+test_mempool_basic(struct rte_mempool *mp, int use_external_cache, int use_zc_api)\n {\n \tuint32_t *objnum;\n \tvoid **objtable;\n@@ -84,6 +84,7 @@ test_mempool_basic(struct rte_mempool *mp, int use_external_cache)\n \tunsigned i, j;\n \tint offset;\n \tstruct rte_mempool_cache *cache;\n+\tvoid **cache_objs;\n\n \tif (use_external_cache) {\n \t\t/* Create a user-owned mempool cache. */\n@@ -100,8 +101,13 @@ test_mempool_basic(struct rte_mempool *mp, int use_external_cache)\n \trte_mempool_dump(stdout, mp);\n\n \tprintf(\"get an object\\n\");\n-\tif (rte_mempool_generic_get(mp, &obj, 1, cache) < 0)\n-\t\tGOTO_ERR(ret, out);\n+\tif (use_zc_api) {\n+\t\tcache_objs = rte_mempool_cache_zc_get_bulk(cache, mp, 1);\n+\t\tobj = *cache_objs;\n+\t} else {\n+\t\tif (rte_mempool_generic_get(mp, &obj, 1, cache) < 0)\n+\t\t\tGOTO_ERR(ret, out);\n+\t}\n \trte_mempool_dump(stdout, mp);\n\n \t/* tests that improve coverage */\n@@ -123,21 +129,41 @@ test_mempool_basic(struct rte_mempool *mp, int use_external_cache)\n #endif\n\n \tprintf(\"put the object back\\n\");\n-\trte_mempool_generic_put(mp, &obj, 1, cache);\n+\tif (use_zc_api) {\n+\t\tcache_objs = rte_mempool_cache_zc_put_bulk(cache, mp, 1);\n+\t\trte_memcpy(cache_objs, &obj, sizeof(void *));\n+\t} else {\n+\t\trte_mempool_generic_put(mp, &obj, 1, cache);\n+\t}\n \trte_mempool_dump(stdout, mp);\n\n \tprintf(\"get 2 objects\\n\");\n-\tif (rte_mempool_generic_get(mp, &obj, 1, cache) < 0)\n-\t\tGOTO_ERR(ret, out);\n-\tif (rte_mempool_generic_get(mp, &obj2, 1, cache) < 0) {\n-\t\trte_mempool_generic_put(mp, &obj, 1, cache);\n-\t\tGOTO_ERR(ret, out);\n+\tif (use_zc_api) {\n+\t\tcache_objs = rte_mempool_cache_zc_get_bulk(cache, mp, 1);\n+\t\tobj = *cache_objs;\n+\t\tcache_objs = rte_mempool_cache_zc_get_bulk(cache, mp, 1);\n+\t\tobj2 = *cache_objs;\n+\t} else {\n+\t\tif (rte_mempool_generic_get(mp, &obj, 1, cache) < 0)\n+\t\t\tGOTO_ERR(ret, out);\n+\t\tif (rte_mempool_generic_get(mp, &obj2, 1, cache) < 0) {\n+\t\t\trte_mempool_generic_put(mp, &obj, 1, cache);\n+\t\t\tGOTO_ERR(ret, out);\n+\t\t}\n \t}\n \trte_mempool_dump(stdout, mp);\n\n \tprintf(\"put the objects back\\n\");\n-\trte_mempool_generic_put(mp, &obj, 1, cache);\n-\trte_mempool_generic_put(mp, &obj2, 1, cache);\n+\tif (use_zc_api) {\n+\t\tcache_objs = rte_mempool_cache_zc_put_bulk(cache, mp, 1);\n+\t\trte_memcpy(cache_objs, &obj, sizeof(void *));\n+\t\tcache_objs = rte_mempool_cache_zc_put_bulk(cache, mp, 1);\n+\t\trte_memcpy(cache_objs, &obj2, sizeof(void *));\n+\n+\t} else {\n+\t\trte_mempool_generic_put(mp, &obj, 1, cache);\n+\t\trte_mempool_generic_put(mp, &obj2, 1, cache);\n+\t}\n \trte_mempool_dump(stdout, mp);\n\n \t/*\n@@ -149,8 +175,13 @@ test_mempool_basic(struct rte_mempool *mp, int use_external_cache)\n \t\tGOTO_ERR(ret, out);\n\n \tfor (i = 0; i < MEMPOOL_SIZE; i++) {\n-\t\tif (rte_mempool_generic_get(mp, &objtable[i], 1, cache) < 0)\n-\t\t\tbreak;\n+\t\tif (use_zc_api) {\n+\t\t\tcache_objs = rte_mempool_cache_zc_get_bulk(cache, mp, 1);\n+\t\t\tobjtable[i] = *cache_objs;\n+\t\t} else {\n+\t\t\tif (rte_mempool_generic_get(mp, &objtable[i], 1, cache) < 0)\n+\t\t\t\tbreak;\n+\t\t}\n \t}\n\n \t/*\n@@ -170,8 +201,12 @@ test_mempool_basic(struct rte_mempool *mp, int use_external_cache)\n \t\t\tif (obj_data[j] != 0)\n \t\t\t\tret = -1;\n \t\t}\n-\n-\t\trte_mempool_generic_put(mp, &objtable[i], 1, cache);\n+\t\tif (use_zc_api) {\n+\t\t\tcache_objs = rte_mempool_cache_zc_put_bulk(cache, mp, 1);\n+\t\t\trte_memcpy(cache_objs, &objtable[i], sizeof(void *));\n+\t\t} else {\n+\t\t\trte_mempool_generic_put(mp, &objtable[i], 1, cache);\n+\t\t}\n \t}\n\n \tfree(objtable);\n@@ -979,15 +1014,19 @@ test_mempool(void)\n \trte_mempool_list_dump(stdout);\n\n \t/* basic tests without cache */\n-\tif (test_mempool_basic(mp_nocache, 0) < 0)\n+\tif (test_mempool_basic(mp_nocache, 0, 0) < 0)\n+\t\tGOTO_ERR(ret, err);\n+\n+\t/* basic tests with zero-copy API's */\n+\tif (test_mempool_basic(mp_cache, 0, 1) < 0)\n \t\tGOTO_ERR(ret, err);\n\n-\t/* basic tests with cache */\n-\tif (test_mempool_basic(mp_cache, 0) < 0)\n+\t/* basic tests with user-owned cache and zero-copy API's */\n+\tif (test_mempool_basic(mp_nocache, 1, 1) < 0)\n \t\tGOTO_ERR(ret, err);\n\n \t/* basic tests with user-owned cache */\n-\tif (test_mempool_basic(mp_nocache, 1) < 0)\n+\tif (test_mempool_basic(mp_nocache, 1, 0) < 0)\n \t\tGOTO_ERR(ret, err);\n\n \t/* more basic tests without cache */\n@@ -1008,10 +1047,10 @@ test_mempool(void)\n \t\tGOTO_ERR(ret, err);\n\n \t/* test the stack handler */\n-\tif (test_mempool_basic(mp_stack, 1) < 0)\n+\tif (test_mempool_basic(mp_stack, 1, 0) < 0)\n \t\tGOTO_ERR(ret, err);\n\n-\tif (test_mempool_basic(default_pool, 1) < 0)\n+\tif (test_mempool_basic(default_pool, 1, 0) < 0)\n \t\tGOTO_ERR(ret, err);\n\n \t/* test mempool event callbacks */\n", "prefixes": [ "v2", "2/2" ] }{ "id": 123658, "url": "