From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0053.outbound.protection.outlook.com [104.47.41.53]) by dpdk.org (Postfix) with ESMTP id CBD0E1B26F for ; Fri, 6 Oct 2017 09:46:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=s6HIKAozUbuzr6GXjKa5d2qrLLTBfEZo60zjl0sYfj4=; b=eSzf0w4VJOrhE6hAV3j1ftSDTChe9g6KRcL6TEbO/0MjHGgs8ymoxCVtAp9JgbtZXXW9NUDhi5RwMHXtaoq4Kc1J0hNgqDqfrn01vphSKUW5zmqdk4Acy3+Fh6uxM9PB6HaYMvY2aXcHHiuL36KfZYc+jSD3o0Z/G3ZLv7px+x0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from localhost.localdomain (223.180.6.162) by DM5PR07MB3098.namprd07.prod.outlook.com (10.172.85.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Fri, 6 Oct 2017 07:46:14 +0000 From: Santosh Shukla To: dev@dpdk.org, thomas@monjalon.net Cc: olivier.matz@6wind.com, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, Santosh Shukla Date: Fri, 6 Oct 2017 13:15:29 +0530 Message-Id: <20171006074530.12521-2-santosh.shukla@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171006074530.12521-1-santosh.shukla@caviumnetworks.com> References: <20171001091440.10232-2-santosh.shukla@caviumnetworks.com> <20171006074530.12521-1-santosh.shukla@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [223.180.6.162] X-ClientProxiedBy: PN1PR01CA0106.INDPRD01.PROD.OUTLOOK.COM (10.174.144.22) To DM5PR07MB3098.namprd07.prod.outlook.com (10.172.85.8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 20e3fd81-a5f7-427f-6269-08d50c8e535a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM5PR07MB3098; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3098; 3:w8EEMXH4BSkBr7h0qQ2WbMAb/GDQGWJnMWU/jJYHf7dThObuMKFg/92xw8j4Cwn3Vh5L2B4l3YOXLLdUil44vGopHrb3oONpjxCS4jgFxQYtdZAF/ZnGGZh/M4GjuF4uKMU+CzLUXFv2E5Fz4Xi3UffXEs9pDUgOFB6iZYxXa4lM6kMFUcJ32RFk2hBNJn6PpLapw+IARa21rpSAC+NIywY6R0T+8Y+XBiKB0xyosowPClvFAr807g0VUNstZUR4; 25:ZZbwu6IlYgRSnMSpagJ5+Gtyw5i+Fv8bgzld0X4HrwBzYN+6crB1L1j4wKfmrC4gYc/Xb2weeHCmi7Hzr5UHjY/fUWBWTs6ar4vKJzEN1Rx/pFoZ2PlkvboPpWXHwVjOQcjWNhFBoRIu3DYc1VakJhcXCKORatpiDPz7wvtsMOi7SemBv1KPrjRTdJty78whLgwPXIFs442b519Yxm1L9kfWcSOpBnWLKt/S3ft3KJDFiAiukPfAwnkn6yqJTRWm/vA1HlzTKPaontYuvk8h8hg/AN0auwFu7dp4YAWuNvOCIZMDarD/Hd4UrE0OqpQNL6LO69eidbRmbxRVnVyg8w==; 31:851zltvm4BGeZ3bn8srSJuiNCDTkOylUNMDvkozJKH98AmwQ9iwE8d2EDWFfIq5yr9ztLWjLDE2OzlZR8Eegqu05EKXc9nkazk2EpOdhEFomvsNyVjMMH5MvcCPwpQ5RPdGwzy6BjZ0Gs/EM7CWv7eJ7iYfoA1BeirzV0PuCB7iFtOlNstrg4MXCXRnbt9xlht1IKoTLzTgaqtkLXpQlVVa9jutzJWZOyb4+Y1YKBTU= X-MS-TrafficTypeDiagnostic: DM5PR07MB3098: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3098; 20:EOG10Obh41HvBJfwATgz5R3smSiHZuyO2HBbwU6m4Ddiph5Hcfo5TR1WF1/MhS+/JnlHVWf4i0hFrTd0dDWCLfUaZcfCxjeQ2Q8w8FM58p/8OH7CVyHCFQSBBxSOHdT9qfOSgtdc3JU1A4HdaBI53QK6g+e2KRv34ybbc9j9wemnW2PY4IhepmeEZd14wXpvURYRAV794V+pwjr/caIrVkOcg0bFEF5SpKSvLHa3xnWkwxFyJJZcfXxFGyKWu8k6wDvAUjxS7fcMKCihta+gC1qhjdciPYBrY4yKr+4ltDZYvmLRWtmLBQN4SHX04WlBgsDtOmvtPKw4RjRfvjbg0QiSIgAmB82FxK7yPO2MWhg2bJy+Jh8e8Ni/hHi2qPZHiqY1EdIgwZwzVFnpeiA1ZTnHe88X66iCmhOnIhEN9bUQspMc4/dfKYAV129kCO4FSNoaN8HqniNfMGVy0wMJVFRQRG0WiVvhoVIUUaJmiBDzpDAI9lpwzs02oRsP/AzxN2zgPKwor8pehsMSsSdtAaTvmbrx7DjVdsjYDe4ayEjPMZ5ar+Mo9HyVHMjwA6wqCSrUEGCKxKg/W9m7gEsdqSLkUwXN8706kNNCQgfK1ng=; 4:WkixW50mSoxbssKC5UmBfGPaqxZhbLtBD0BO9YwvvjXXTinbaTjfWqUHU/ouvUMXwPblfig2udFui3Cce3prMpP3257a2pP4TZGnHaGADZlbmjpfUB32y4OTwiYTA9qWwGOKZ2B5yjmoQG6irtPZTWTShHdJSUiHROHqZhYH8KIQKbqMWQ3UhYzTmvG9WWXcdrc7vLBYjquqkwxYo4gA3HFY1MR3/qU0KZo3o+jHJaLBNdowqp2HXWmvF2eGjdLo6XEPdtVDM/4N9EaHAHIR3a1yup9zoz1NuLRPsHnQEwc= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(10201501046)(93006095)(3002001)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR07MB3098; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR07MB3098; X-Forefront-PRVS: 0452022BE1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(376002)(346002)(189002)(199003)(25786009)(76176999)(66066001)(6116002)(478600001)(36756003)(4326008)(16586007)(8936002)(3846002)(316002)(2906002)(2950100002)(68736007)(5660300001)(42882006)(97736004)(101416001)(7736002)(81156014)(33646002)(1076002)(575784001)(305945005)(6512007)(53936002)(81166006)(48376002)(8656003)(47776003)(189998001)(72206003)(106356001)(8676002)(6666003)(5003940100001)(50226002)(50986999)(16526018)(6486002)(107886003)(6506006)(50466002)(105586002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3098; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR07MB3098; 23:FwSSNT5/Nlh6m5lz5XJj8FxFhh4JtX5L5cUjzJZ3K?= =?us-ascii?Q?bddheY65xOlzvl3uN4J6jt8qwynMym0nPdQ9bZCU8dFU+VojIBABU7S+A5KL?= =?us-ascii?Q?CDi6LVg4Djsp5kVxQJB6uW/+zHIH93P+K+WIMIn6eqBaY2ZPtOsTCKQO/iGd?= =?us-ascii?Q?VST7dG8IKko+vf7/37eqvGc8Vb1fUn4f1j0C4uqGDlaGPLdEwBKxRvSo4m/E?= =?us-ascii?Q?95A79WELMh7AFUZ2uqnUhO7xhlcUGsS8wieIHtIhPIAjepOhODDP/Gw5lRdZ?= =?us-ascii?Q?UNpI1e4969kTf5DYF73CbFTVdC0tp087bHW2peUbges9j8VsMJxl1TnINvrw?= =?us-ascii?Q?fSRDw/cHcgfMDFG6lPMyZ2CSG+CAYuvMjXoAC8cmzCv5dsmsh4pAvZ3PBGjX?= =?us-ascii?Q?6IgoZuwMIPV1RLMrPf3Os1xyiM3GseO5OUZXv6G01BIwQqBlGK97kYDE5sxK?= =?us-ascii?Q?zmLmOORv35acvnxEP6g8L2jtGw59iWg6EB6oxu3PFA2W8kaYcR193+odEdNa?= =?us-ascii?Q?OyzZzASDO8506DgCfpA2WVV0uda26eD8JxgoyK6V27T/tKohbZRhzeJEEMrT?= =?us-ascii?Q?lpXMGw8ICTPtCCX7Bem2Eu3Pu0yto5k4/56F7mlnIY0vxUhWxE7aTL27VWPX?= =?us-ascii?Q?LidytRnLcD9cX+cWtmC75azQRQiAEqW+jMSZ3tCF9BD7QcD6j/EfsjN0PuHF?= =?us-ascii?Q?IWfwfLlYubaA4VoV82WKVbzEmGZn4BgSnOXjGwcv3svSLGyFFXbv3/jZ5EPf?= =?us-ascii?Q?C6HhBB54SD7BzAvJZNHG+70FJRmzrfhRD22KBIffM/scbSg23Qi/tvISLezf?= =?us-ascii?Q?HNBrdgJS1Ymgof8sEQnQ1+fhErXgga0nicMzHVSVqkVQWABZ4nyIrx7QuA7j?= =?us-ascii?Q?Ubsihd/38a9Q5ETqEcBdv+8plkspzpw1lf5lRM88JSpE4dCQeHQo7CxRNMKQ?= =?us-ascii?Q?nSxXbj7/7xxJ3wz7Bxokp+rjCHrFpzVRB6E7QL+JnJpxuF61HLmar7A/gz/G?= =?us-ascii?Q?tkKKml4ArFlKkgv9MOs4gtlgFDviYrO/owxtSgi3TLEySAolr0Og9qVVgvlW?= =?us-ascii?Q?j0i/RbTaR6mhk+KUnmC14od/VvZrugepOZ1T69hm1RiqTGEBiYi+vRSdQ8Kt?= =?us-ascii?Q?UWZu63nOCQJ00PpK1LRuuIZouFavpAPNXjhC+Odhoq3YtDQTa84ug=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3098; 6:QmsdbiVIUlDmSoO85OsaJSQlL12m7Wg6RenggYaSMqnAo69NEk7WLUGqOwv14684opOUhjrhYl5fIiScNCdjcSFyCZPb6YzCwL/hb6zYlWWStgx4bYt94XK+IIJgmQDNokma8tkZ1cfQaNdj1vwkaL9fYUWX4HD40b9D/+dW/ZoyZCgL12/hdUECK9uyEqNmGbjah3Z98nIplAxAXVeLOkRYnwWwhQ5BKmPGhFfO7olctY9YZdZTA8XpmeJ8bkJxX/G84Et2jNzShHlxC2yKKJmZ2H2AhBaRsdQ0C55eruP8klhvySXfGVM7aiELeQMlRlozVuc9UUq8U7gNdF268g==; 5:fFk7KwoLu/HuHVWg4XVeVPQ2CeKbCRbtIXkXfvspqMUfxIDe+IksKhljd6GDKLANVfIGaNCSkyPFiCszhEGyHldxbk4DTbcuG143mVZg79V5z4i3XCE4SRy4rr/7tucHo1tWoJTT85OnkH9ueGszXA==; 24:v9B2zpnvcniIf6ryl0w2NeUxuFnmKsdEzINjbXDjLxqLsiKapZc7JoRZz7asjgMKs9Hz35VMY8WbYTbJZ/bTDUbH46eP6uzlVsKQ7nD9e2c=; 7:lcUMynuoVxbFEKvA1X65EHrxrJ/Esux3jv/0rSdTRl9Y6V7eDIcRmWvvl9X905HuDWSUtCBhPB8Ykn4FapVA6uqYuHRbLegMyN/70RfQAikaEHck2ArjwyfXEFN0VvO9WwbV1L7/ur7JSW8aV7no0N9w8UuacbzByHflW3/GdMyDpvZeoCl49PY4/7NURsipWk+p72f7dhSBdFEUFZIHXCBJhY1CBog1gzRKmjlsTb8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2017 07:46:14.4239 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3098 Subject: [dpdk-dev] [PATCH v6 1/2] eal: allow user to override default pool handle X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 07:46:18 -0000 DPDK has support for both sw and hw mempool and currently user is limited to use ring_mp_mc pool. In case user want to use other pool handle, need to update config RTE_MEMPOOL_OPS_DEFAULT, then build and run with desired pool handle. Introducing eal option to override default pool handle. Now user can override the RTE_MEMPOOL_OPS_DEFAULT by passing pool handle to eal `--mbuf-pool-ops-name=""`. Signed-off-by: Santosh Shukla Acked-by: Hemant Agrawal Acked-by: Olivier Matz --- v5 --> v6: - Arranged alphabetical order for OPT_MBUF_POOL_OPS_NAME_NUM. (Suggested by Thomas) v4 --> v5: - Renamed mbuf_pool_name to mbuf_pool_ops_name, same change reflected across patch in respective areas. (Suggested by Olivier). v3 --> v4: - Removed RTE_MBUF_XX_POOL_NAMESIZE macro. (Suggested by Olivier) - Replaced char * with const char * for 'mbuf_pool_name' var. (Olivier) - Added eal arg info in release guide. doc/guides/freebsd_gsg/build_sample_apps.rst | 3 +++ doc/guides/linux_gsg/build_sample_apps.rst | 3 +++ doc/guides/testpmd_app_ug/run_app.rst | 4 ++++ lib/librte_eal/bsdapp/eal/eal.c | 10 ++++++++++ lib/librte_eal/bsdapp/eal/rte_eal_version.map | 7 +++++++ lib/librte_eal/common/eal_common_options.c | 3 +++ lib/librte_eal/common/eal_internal_cfg.h | 2 +- lib/librte_eal/common/eal_options.h | 2 ++ lib/librte_eal/common/include/rte_eal.h | 9 +++++++++ lib/librte_eal/linuxapp/eal/eal.c | 11 +++++++++++ lib/librte_eal/linuxapp/eal/rte_eal_version.map | 7 +++++++ lib/librte_mbuf/rte_mbuf.c | 5 +++-- 12 files changed, 63 insertions(+), 3 deletions(-) diff --git a/doc/guides/freebsd_gsg/build_sample_apps.rst b/doc/guides/freebsd_gsg/build_sample_apps.rst index 9faa0e6e5..d84f15b82 100644 --- a/doc/guides/freebsd_gsg/build_sample_apps.rst +++ b/doc/guides/freebsd_gsg/build_sample_apps.rst @@ -163,6 +163,9 @@ Other options, specific to Linux and are not supported under FreeBSD are as foll * ``--huge-dir``: The directory where hugetlbfs is mounted. +* ``mbuf-pool-ops-name``: + Pool ops name for mbuf to use. + * ``--file-prefix``: The prefix text used for hugepage filenames. diff --git a/doc/guides/linux_gsg/build_sample_apps.rst b/doc/guides/linux_gsg/build_sample_apps.rst index 0cc5fd173..ec0a9ec50 100644 --- a/doc/guides/linux_gsg/build_sample_apps.rst +++ b/doc/guides/linux_gsg/build_sample_apps.rst @@ -157,6 +157,9 @@ The EAL options are as follows: * ``--huge-dir``: The directory where hugetlbfs is mounted. +* ``mbuf-pool-ops-name``: + Pool ops name for mbuf to use. + * ``--file-prefix``: The prefix text used for hugepage filenames. diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst index e8303f3ba..10fec60f9 100644 --- a/doc/guides/testpmd_app_ug/run_app.rst +++ b/doc/guides/testpmd_app_ug/run_app.rst @@ -110,6 +110,10 @@ See the DPDK Getting Started Guides for more information on these options. Specify the directory where the hugetlbfs is mounted. +* ``mbuf-pool-ops-name``: + + Pool ops name for mbuf to use. + * ``--proc-type`` Set the type of the current process. diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index 5fa598842..2991fcbcf 100644 --- a/lib/librte_eal/bsdapp/eal/eal.c +++ b/lib/librte_eal/bsdapp/eal/eal.c @@ -112,6 +112,13 @@ struct internal_config internal_config; /* used by rte_rdtsc() */ int rte_cycles_vmware_tsc_map; +/* Return mbuf pool ops name */ +const char * +rte_eal_mbuf_default_mempool_ops(void) +{ + return internal_config.mbuf_pool_ops_name; +} + /* Return a pointer to the configuration structure */ struct rte_config * rte_eal_get_configuration(void) @@ -385,6 +392,9 @@ eal_parse_args(int argc, char **argv) continue; switch (opt) { + case OPT_MBUF_POOL_OPS_NAME_NUM: + internal_config.mbuf_pool_ops_name = optarg; + break; case 'h': eal_usage(prgname); exit(EXIT_SUCCESS); diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map index 47a09ea7f..c30f25fe3 100644 --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map @@ -238,3 +238,10 @@ EXPERIMENTAL { rte_service_start_with_defaults; } DPDK_17.08; + +DPDK_17.11 { + global: + + rte_eal_mbuf_default_mempool_ops; + +} DPDK_17.08; diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index 1da185e59..f406592f3 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -85,6 +85,7 @@ eal_long_options[] = { {OPT_LCORES, 1, NULL, OPT_LCORES_NUM }, {OPT_LOG_LEVEL, 1, NULL, OPT_LOG_LEVEL_NUM }, {OPT_MASTER_LCORE, 1, NULL, OPT_MASTER_LCORE_NUM }, + {OPT_MBUF_POOL_OPS_NAME, 1, NULL, OPT_MBUF_POOL_OPS_NAME_NUM}, {OPT_NO_HPET, 0, NULL, OPT_NO_HPET_NUM }, {OPT_NO_HUGE, 0, NULL, OPT_NO_HUGE_NUM }, {OPT_NO_PCI, 0, NULL, OPT_NO_PCI_NUM }, @@ -220,6 +221,7 @@ eal_reset_internal_config(struct internal_config *internal_cfg) #endif internal_cfg->vmware_tsc_map = 0; internal_cfg->create_uio_dev = 0; + internal_cfg->mbuf_pool_ops_name = RTE_MBUF_DEFAULT_MEMPOOL_OPS; } static int @@ -1279,6 +1281,7 @@ eal_common_usage(void) " '@' can be omitted if cpus and lcores have the same value\n" " -s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores\n" " --"OPT_MASTER_LCORE" ID Core ID that is used as master\n" + " --"OPT_MBUF_POOL_OPS_NAME" Pool ops name for mbuf to use\n" " -n CHANNELS Number of memory channels\n" " -m MB Memory to allocate (see also --"OPT_SOCKET_MEM")\n" " -r RANKS Force number of memory ranks (don't detect)\n" diff --git a/lib/librte_eal/common/eal_internal_cfg.h b/lib/librte_eal/common/eal_internal_cfg.h index 7b7e8c887..658783db3 100644 --- a/lib/librte_eal/common/eal_internal_cfg.h +++ b/lib/librte_eal/common/eal_internal_cfg.h @@ -82,7 +82,7 @@ struct internal_config { volatile enum rte_intr_mode vfio_intr_mode; const char *hugefile_prefix; /**< the base filename of hugetlbfs files */ const char *hugepage_dir; /**< specific hugetlbfs directory to use */ - + const char *mbuf_pool_ops_name; /**< mbuf pool ops name */ unsigned num_hugepage_sizes; /**< how many sizes on this system */ struct hugepage_info hugepage_info[MAX_HUGEPAGE_SIZES]; }; diff --git a/lib/librte_eal/common/eal_options.h b/lib/librte_eal/common/eal_options.h index 439a26104..79410bd6a 100644 --- a/lib/librte_eal/common/eal_options.h +++ b/lib/librte_eal/common/eal_options.h @@ -61,6 +61,8 @@ enum { OPT_LOG_LEVEL_NUM, #define OPT_MASTER_LCORE "master-lcore" OPT_MASTER_LCORE_NUM, +#define OPT_MBUF_POOL_OPS_NAME "mbuf-pool-ops-name" + OPT_MBUF_POOL_OPS_NAME_NUM, #define OPT_PROC_TYPE "proc-type" OPT_PROC_TYPE_NUM, #define OPT_NO_HPET "no-hpet" diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h index 559d2308e..0964e49a0 100644 --- a/lib/librte_eal/common/include/rte_eal.h +++ b/lib/librte_eal/common/include/rte_eal.h @@ -287,6 +287,15 @@ static inline int rte_gettid(void) return RTE_PER_LCORE(_thread_id); } +/** + * Get default pool ops name for mbuf + * + * @return + * returns default pool ops name. + */ +const char * +rte_eal_mbuf_default_mempool_ops(void); + /** * Run function before main() with low priority. * diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index 48f12f44c..2401f7bf4 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -121,6 +121,13 @@ struct internal_config internal_config; /* used by rte_rdtsc() */ int rte_cycles_vmware_tsc_map; +/* Return mbuf pool ops name */ +const char * +rte_eal_mbuf_default_mempool_ops(void) +{ + return internal_config.mbuf_pool_ops_name; +} + /* Return a pointer to the configuration structure */ struct rte_config * rte_eal_get_configuration(void) @@ -610,6 +617,10 @@ eal_parse_args(int argc, char **argv) internal_config.create_uio_dev = 1; break; + case OPT_MBUF_POOL_OPS_NAME_NUM: + internal_config.mbuf_pool_ops_name = optarg; + break; + default: if (opt < OPT_LONG_MIN_NUM && isprint(opt)) { RTE_LOG(ERR, EAL, "Option %c is not supported " diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map index 8c08b8d1e..cbbb6f332 100644 --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map @@ -243,3 +243,10 @@ EXPERIMENTAL { rte_service_start_with_defaults; } DPDK_17.08; + +DPDK_17.11 { + global: + + rte_eal_mbuf_default_mempool_ops; + +} DPDK_17.08; diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c index 26a62b8e1..5a81c8a4f 100644 --- a/lib/librte_mbuf/rte_mbuf.c +++ b/lib/librte_mbuf/rte_mbuf.c @@ -157,6 +157,7 @@ rte_pktmbuf_pool_create(const char *name, unsigned n, { struct rte_mempool *mp; struct rte_pktmbuf_pool_private mbp_priv; + const char *mp_ops_name; unsigned elt_size; int ret; @@ -176,8 +177,8 @@ rte_pktmbuf_pool_create(const char *name, unsigned n, if (mp == NULL) return NULL; - ret = rte_mempool_set_ops_byname(mp, - RTE_MBUF_DEFAULT_MEMPOOL_OPS, NULL); + mp_ops_name = rte_eal_mbuf_default_mempool_ops(); + ret = rte_mempool_set_ops_byname(mp, mp_ops_name, NULL); if (ret != 0) { RTE_LOG(ERR, MBUF, "error setting mempool handler\n"); rte_mempool_free(mp); -- 2.14.1