Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/51334/?format=api
https://patches.dpdk.org/api/patches/51334/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190319071256.26302-7-xiaolong.ye@intel.com/", "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": "<20190319071256.26302-7-xiaolong.ye@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20190319071256.26302-7-xiaolong.ye@intel.com", "date": "2019-03-19T07:12:56", "name": "[v2,6/6] app/testpmd: add mempool flags parameter", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "36eb137a6d5864ee280fd04271176efa49f93ae8", "submitter": { "id": 1120, "url": "https://patches.dpdk.org/api/people/1120/?format=api", "name": "Xiaolong Ye", "email": "xiaolong.ye@intel.com" }, "delegate": { "id": 319, "url": "https://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20190319071256.26302-7-xiaolong.ye@intel.com/mbox/", "series": [ { "id": 3796, "url": "https://patches.dpdk.org/api/series/3796/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=3796", "date": "2019-03-19T07:12:50", "name": "Introduce AF_XDP PMD", "version": 2, "mbox": "https://patches.dpdk.org/series/3796/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/51334/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/51334/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 77D7D4F90;\n\tTue, 19 Mar 2019 08:17:16 +0100 (CET)", "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby dpdk.org (Postfix) with ESMTP id 130514CA6\n\tfor <dev@dpdk.org>; Tue, 19 Mar 2019 08:17:05 +0100 (CET)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t19 Mar 2019 00:17:05 -0700", "from yexl-server.sh.intel.com ([10.67.110.206])\n\tby fmsmga005.fm.intel.com with ESMTP; 19 Mar 2019 00:17:04 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.58,496,1544515200\"; d=\"scan'208\";a=\"329890026\"", "From": "Xiaolong Ye <xiaolong.ye@intel.com>", "To": "dev@dpdk.org", "Cc": "Qi Zhang <qi.z.zhang@intel.com>,\n\tKarlsson Magnus <magnus.karlsson@intel.com>,\n\tTopel Bjorn <bjorn.topel@intel.com>, Xiaolong Ye <xiaolong.ye@intel.com>", "Date": "Tue, 19 Mar 2019 15:12:56 +0800", "Message-Id": "<20190319071256.26302-7-xiaolong.ye@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20190319071256.26302-1-xiaolong.ye@intel.com>", "References": "<20190301080947.91086-1-xiaolong.ye@intel.com>\n\t<20190319071256.26302-1-xiaolong.ye@intel.com>", "Subject": "[dpdk-dev] [PATCH v2 6/6] app/testpmd: add mempool flags parameter", "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": "When create rte_mempool, flags can be parsed from command line.\nNow, it is possible for testpmd to create a af_xdp friendly\nmempool (which enable zero copy).\n\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\nSigned-off-by: Xiaolong Ye <xiaolong.ye@intel.com>\n---\n app/test-pmd/parameters.c | 12 ++++++++++++\n app/test-pmd/testpmd.c | 17 ++++++++++-------\n app/test-pmd/testpmd.h | 1 +\n doc/guides/testpmd_app_ug/run_app.rst | 4 ++++\n 4 files changed, 27 insertions(+), 7 deletions(-)", "diff": "diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c\nindex 38b419767..9d5be0007 100644\n--- a/app/test-pmd/parameters.c\n+++ b/app/test-pmd/parameters.c\n@@ -61,6 +61,7 @@ usage(char* progname)\n \t \"--tx-first | --stats-period=PERIOD | \"\n \t \"--coremask=COREMASK --portmask=PORTMASK --numa \"\n \t \"--mbuf-size= | --total-num-mbufs= | \"\n+\t \"--mp-flags= | \"\n \t \"--nb-cores= | --nb-ports= | \"\n #ifdef RTE_LIBRTE_CMDLINE\n \t \"--eth-peers-configfile= | \"\n@@ -105,6 +106,7 @@ usage(char* progname)\n \tprintf(\" --socket-num=N: set socket from which all memory is allocated \"\n \t \"in NUMA mode.\\n\");\n \tprintf(\" --mbuf-size=N: set the data size of mbuf to N bytes.\\n\");\n+\tprintf(\" --mp-flags=N: set the flags when create mbuf memory pool.\\n\");\n \tprintf(\" --total-num-mbufs=N: set the number of mbufs to be allocated \"\n \t \"in mbuf pools.\\n\");\n \tprintf(\" --max-pkt-len=N: set the maximum size of packet to N bytes.\\n\");\n@@ -585,6 +587,7 @@ launch_args_parse(int argc, char** argv)\n \t\t{ \"ring-numa-config\", 1, 0, 0 },\n \t\t{ \"socket-num\",\t\t\t1, 0, 0 },\n \t\t{ \"mbuf-size\",\t\t\t1, 0, 0 },\n+\t\t{ \"mp-flags\",\t\t\t1, 0, 0 },\n \t\t{ \"total-num-mbufs\",\t\t1, 0, 0 },\n \t\t{ \"max-pkt-len\",\t\t1, 0, 0 },\n \t\t{ \"pkt-filter-mode\", 1, 0, 0 },\n@@ -811,6 +814,15 @@ launch_args_parse(int argc, char** argv)\n \t\t\t\t\trte_exit(EXIT_FAILURE,\n \t\t\t\t\t\t \"mbuf-size should be > 0 and < 65536\\n\");\n \t\t\t}\n+\t\t\tif (!strcmp(lgopts[opt_idx].name, \"mp-flags\")) {\n+\t\t\t\tn = atoi(optarg);\n+\t\t\t\tif (n > 0 && n <= 0xFFFF)\n+\t\t\t\t\tmp_flags = (uint16_t)n;\n+\t\t\t\telse\n+\t\t\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t\t\t \"mp-flags should be > 0 and < 65536\\n\");\n+\t\t\t}\n+\n \t\t\tif (!strcmp(lgopts[opt_idx].name, \"total-num-mbufs\")) {\n \t\t\t\tn = atoi(optarg);\n \t\t\t\tif (n > 1024)\ndiff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex d9d0c16d4..eb46dfa53 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -195,6 +195,7 @@ uint32_t burst_tx_delay_time = BURST_TX_WAIT_US;\n uint32_t burst_tx_retry_num = BURST_TX_RETRIES;\n \n uint16_t mbuf_data_size = DEFAULT_MBUF_DATA_SIZE; /**< Mbuf data space size. */\n+uint16_t mp_flags = 0; /**< flags parsed when create mempool */\n uint32_t param_total_num_mbufs = 0; /**< number of mbufs in all pools - if\n * specified on command-line. */\n uint16_t stats_period; /**< Period to show statistics (disabled by default) */\n@@ -834,6 +835,7 @@ setup_extmem(uint32_t nb_mbufs, uint32_t mbuf_sz, bool huge)\n */\n static void\n mbuf_pool_create(uint16_t mbuf_seg_size, unsigned nb_mbuf,\n+\t\t unsigned int flags,\n \t\t unsigned int socket_id)\n {\n \tchar pool_name[RTE_MEMPOOL_NAMESIZE];\n@@ -853,8 +855,8 @@ mbuf_pool_create(uint16_t mbuf_seg_size, unsigned nb_mbuf,\n \t\t\t/* wrapper to rte_mempool_create() */\n \t\t\tTESTPMD_LOG(INFO, \"preferred mempool ops selected: %s\\n\",\n \t\t\t\t\trte_mbuf_best_mempool_ops());\n-\t\t\trte_mp = rte_pktmbuf_pool_create(pool_name, nb_mbuf,\n-\t\t\t\tmb_mempool_cache, 0, mbuf_seg_size, socket_id);\n+\t\t\trte_mp = rte_pktmbuf_pool_create_with_flags(pool_name, nb_mbuf,\n+\t\t\t\tmb_mempool_cache, 0, mbuf_seg_size, flags, socket_id);\n \t\t\tbreak;\n \t\t}\n \tcase MP_ALLOC_ANON:\n@@ -891,8 +893,8 @@ mbuf_pool_create(uint16_t mbuf_seg_size, unsigned nb_mbuf,\n \n \t\t\tTESTPMD_LOG(INFO, \"preferred mempool ops selected: %s\\n\",\n \t\t\t\t\trte_mbuf_best_mempool_ops());\n-\t\t\trte_mp = rte_pktmbuf_pool_create(pool_name, nb_mbuf,\n-\t\t\t\t\tmb_mempool_cache, 0, mbuf_seg_size,\n+\t\t\trte_mp = rte_pktmbuf_pool_create_with_flags(pool_name, nb_mbuf,\n+\t\t\t\t\tmb_mempool_cache, 0, mbuf_seg_size, flags,\n \t\t\t\t\theap_socket);\n \t\t\tbreak;\n \t\t}\n@@ -1128,13 +1130,14 @@ init_config(void)\n \n \t\tfor (i = 0; i < num_sockets; i++)\n \t\t\tmbuf_pool_create(mbuf_data_size, nb_mbuf_per_pool,\n-\t\t\t\t\t socket_ids[i]);\n+\t\t\t\t\t mp_flags, socket_ids[i]);\n \t} else {\n \t\tif (socket_num == UMA_NO_CONFIG)\n-\t\t\tmbuf_pool_create(mbuf_data_size, nb_mbuf_per_pool, 0);\n+\t\t\tmbuf_pool_create(mbuf_data_size, nb_mbuf_per_pool,\n+\t\t\t\t\t mp_flags, 0);\n \t\telse\n \t\t\tmbuf_pool_create(mbuf_data_size, nb_mbuf_per_pool,\n-\t\t\t\t\t\t socket_num);\n+\t\t\t\t\t mp_flags, socket_num);\n \t}\n \n \tinit_port_config();\ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex fa4887853..3ddb70e3e 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -408,6 +408,7 @@ extern uint8_t dcb_config;\n extern uint8_t dcb_test;\n \n extern uint16_t mbuf_data_size; /**< Mbuf data space size. */\n+extern uint16_t mp_flags; /**< flags for mempool creation. */\n extern uint32_t param_total_num_mbufs;\n \n extern uint16_t stats_period;\ndiff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst\nindex 4495ed038..bafb9c493 100644\n--- a/doc/guides/testpmd_app_ug/run_app.rst\n+++ b/doc/guides/testpmd_app_ug/run_app.rst\n@@ -392,6 +392,10 @@ The commandline options are:\n * xmemhuge: create and populate mempool using externally and anonymously\n allocated hugepage area\n \n+* ``--mp-flag=<N>``\n+\n+ Select mempool allocation flag.\n+\n * ``--noisy-tx-sw-buffer-size``\n \n Set the number of maximum elements of the FIFO queue to be created\n", "prefixes": [ "v2", "6/6" ] }{ "id": 51334, "url": "