From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0059.outbound.protection.outlook.com [104.47.33.59]) by dpdk.org (Postfix) with ESMTP id 2C0461B19E for ; Sun, 1 Oct 2017 11:15:02 +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=c6MnNwV3fes6kHsnj9Zi6VRBNMT9REhBz0Nv1ZR1TSE=; b=cmhFMQqKm5wRMRUFJmZOgN+BFLINRZtL+nM7P/lOKukt2Hkb305fr/oiLxrR/hanQeOq0n6p9EMA73RT8rtuRNFBlOVoxnRHs289IuI5Nff1tTkg/6Nh0HX53qWU6xE8oUEFU3zTLc5iE3lCs/aNA7oTg39UKyDhbEqbXYRnHa8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from localhost.localdomain (111.93.218.67) by MWHPR07MB3104.namprd07.prod.outlook.com (10.172.95.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Sun, 1 Oct 2017 09:14:57 +0000 From: Santosh Shukla To: olivier.matz@6wind.com, dev@dpdk.org Cc: thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, Santosh Shukla Date: Sun, 1 Oct 2017 14:44:39 +0530 Message-Id: <20171001091440.10232-2-santosh.shukla@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171001091440.10232-1-santosh.shukla@caviumnetworks.com> References: <20170911151837.25092-1-santosh.shukla@caviumnetworks.com> <20171001091440.10232-1-santosh.shukla@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MWHPR13CA0019.namprd13.prod.outlook.com (10.169.208.29) To MWHPR07MB3104.namprd07.prod.outlook.com (10.172.95.10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fe687710-9447-419c-b120-08d508ace3c3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:MWHPR07MB3104; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3104; 3:bkmHVuxd0ZCYSNyB4WfT9WKgIarT+hNzLa41d9GEuThtZdKHF2fAa5IgIhWPLUBrM47N/FpCtw0I52Ld7jRMPHyDATSZmhDkxrgUei3KEoOORfOfzcAHcYOF/AOgLaN6jQ2yl5WDYsqNw1bh1VBUJaIQymhpca8+U2XMY/KBlwftVbTw0C9UlnvW7ynQvAoFxAYkM0dE9AjnRmVATrwf64b9Ra8apcaCOHuXqPVe9nPe2CdIldLJUXqWUw7GRpUg; 25:4U63k0uQHTsh6XVIbHvdwES3iQKi0vCoDinyyilWAcrXV96ZfxTItU78c7AQDy6Eyp8d+0/lwHJS1Koagl3L358GNF77b7FGuU5HlDOVSI6ExYXLQS8Q+U7KtWlJCqeoV0FEtg5EvTK/5dv+NytmENwAfOkcNdv8biv0ex7YLqHfOmMRICPrHeIGnuU8xhqWOUVa7zgjYW1NcMm0/Ssh+RrEjukyuAkOYESWkM4uZlAIOwQ01ZGpp8IJhM0crdJNPFLAsRQEwyBEhtVOiqqprLHIZA4rRqNpUOBemxK85Hmw52hJjYz9luppK7hTB/mSUUfu6gss611YHQ/6GX4+rw==; 31:c6Susq69YxxCjo2FDEuNuHlrGXxK8ZOZsCW00Gvt4DjpATF2wdDkN9kf0ASj8KeBMZBEK5JXUknWYtMyHwcF7Y2dk4ufwIxophqBPuDilQgp3L/Vj0DmrBDvXGi54H0EpLB/ojyIMzJg+DOi+pRAmvJhCRlxzVlIuJk3L7wxMswXo7NWEDk+sgRMl4oOlWmJF6rGmlwHXR3e+SqgvMIZOqA97qbKB+7gMPGhf9Ld0uQ= X-MS-TrafficTypeDiagnostic: MWHPR07MB3104: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3104; 20:dRWR+sEYAuMw/MKSAwX1iPgGhavWHTIiHMyPz4kEaWBp+iB+HeuXdh8bmFqLK/jJ9YmPQaR+zR8/+/RL6IzYTHmA0NhBQ57xW0yYWQ/JZ5OgIJwS3zjlglRS+WLFRu6BBtmwxJ9MEXvAHK9OwqGk1u3BPGzJ7yBQQ1rkk1GTMiFQyB28lNtLbSNdu+YGnpgfmRoZBzCyImF0ZJKlHcQv5PJPQCr7aPQJQ+n/on5qholNbhDmoJGmIdHD7K8nNIE9Rz+4F2vJLB6RJV8UsV6lq4lYz92TzmM+8RCwJhb65Jftf0KNTZSwhy9IcwfxZgL/FVdfbSVH/d+hNHJI9/DvESqrresLbhXj6PxF62Z1jLAQhRkwruXrH84pZj+W2f+UcEQOcALeJom6Onfehq7XiaKLpUv9F+OwlLgxPbvJGr9fH6VJNZbv/flI65gq4hV7QLosPvShrP92G+fx55mcKRwxbTLWccsdUnPBqUDFdGc6D5N7YUYU+KmxZXBGa8aF0MdmF7XPjyQwgX6i6O/BsJmcPPtUX8jZurNDNiyKP298UrcJ8N+Vsk1F1UTb1irPy7Vhz8D8QLgi4bt608I6pQQd8MSBFQTCj9Th/eewfrs=; 4:c4mzTMBTDM1Nup2wmFPVfpzWp2NvucXaUydtToAheaq5SGXV0GWjZo89P9aqXYnkckkALaJXaOToHjwl2Pla1Nb8btVwHZPEoMIayAwCI7MmRxdKAzs2OP6jsG7F5slMJ8uYZHpAYeomghMdxl0NZwMfNVsUSrYxJYhv6PxoUWgopLS/BDVEzbjWqheuRiSnR/Bfg5u8UlBDPGqdIVBw7ylqWW0aRoDkWO+k8VrIlgkQjAiyAMVAd5uOOTpfCfyIAt8XR+n1G+wA76eKP9Fl7pXS2bisIM/DdwdKNELTmnM= 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)(93006095)(10201501046)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123558100)(20161123555025)(20161123560025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR07MB3104; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR07MB3104; X-Forefront-PRVS: 0447DB1C71 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(346002)(376002)(39830400002)(199003)(189002)(3846002)(8676002)(50226002)(16586007)(5009440100003)(478600001)(8936002)(6512007)(6116002)(305945005)(1076002)(6506006)(81166006)(81156014)(53936002)(16526017)(316002)(2950100002)(7736002)(5660300001)(66066001)(47776003)(36756003)(575784001)(8656003)(5003940100001)(42882006)(68736007)(106356001)(101416001)(97736004)(72206003)(105586002)(50466002)(189998001)(33646002)(76176999)(6666003)(4326008)(6486002)(48376002)(50986999)(107886003)(2906002)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3104; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; MWHPR07MB3104; 23:RWeqnWoM0TB9OiV2Gs/DFOZfJ1+Ru7+h7/jMmz3Mu?= =?us-ascii?Q?uIb2OcktYYRYZydHuYGn2fwbURGY1Qh/D61X9sSBjTpivrhuKst0TDfL+hY/?= =?us-ascii?Q?O3H7AVNYhbqAxJdEWbLi8FZZoxyzsB9ri1PYOxahPrXXGWa1YgnmN4PfJqMU?= =?us-ascii?Q?t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gwKAtvNKD1tbT/sBhcwM/hQJJUUBwY+pOlQAGhFSqnqCw8qa5tMRPk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Oct 2017 09:14:57.2067 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3104 Subject: [dpdk-dev] [PATCH v5 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: Sun, 01 Oct 2017 09:15:02 -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 --- 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..1ad3b6c59 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -98,6 +98,7 @@ eal_long_options[] = { {OPT_VFIO_INTR, 1, NULL, OPT_VFIO_INTR_NUM }, {OPT_VMWARE_TSC_MAP, 0, NULL, OPT_VMWARE_TSC_MAP_NUM }, {OPT_XEN_DOM0, 0, NULL, OPT_XEN_DOM0_NUM }, + {OPT_MBUF_POOL_OPS_NAME, 1, NULL, OPT_MBUF_POOL_OPS_NAME_NUM}, {0, 0, NULL, 0 } }; @@ -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 @@ -1309,5 +1311,6 @@ eal_common_usage(void) " --"OPT_NO_PCI" Disable PCI\n" " --"OPT_NO_HPET" Disable HPET\n" " --"OPT_NO_SHCONF" No shared config (mmap'd files)\n" + " --"OPT_MBUF_POOL_OPS_NAME" Pool ops name for mbuf to use\n" "\n", RTE_MAX_LCORE); } 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..8cdc25208 100644 --- a/lib/librte_eal/common/eal_options.h +++ b/lib/librte_eal/common/eal_options.h @@ -83,6 +83,8 @@ enum { OPT_VMWARE_TSC_MAP_NUM, #define OPT_XEN_DOM0 "xen-dom0" OPT_XEN_DOM0_NUM, +#define OPT_MBUF_POOL_OPS_NAME "mbuf-pool-ops-name" + OPT_MBUF_POOL_OPS_NAME_NUM, OPT_LONG_MAX_NUM }; diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h index 0e7363d77..022f92302 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); + #define RTE_INIT(func) \ static void __attribute__((constructor, used)) func(void) 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