From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0062.outbound.protection.outlook.com [104.47.2.62]) by dpdk.org (Postfix) with ESMTP id 980FDA84F for ; Fri, 2 Feb 2018 09:04:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=jF4waXf7pZxvHrluu+h0VrH0Th2F6UPj6Ln++gZdmLU=; b=eNVuUeomV8pOGnQ80uwT3xyjTyz6Lz2XLPULi2kHcuHMl65isC4Mt1uZexkO220pUWm5nLbPwklzQCDl9RYRCE0sbpa8RqlCQXiIOE1wBLpoBXXOJQVwpDfzbSub2EZfVw5GhK5Xu1JFTOi5RThZt9d4bfGUu8YKaxz3urXnxZs= Received: from bf-netperf1.ap.freescale.net (192.88.169.1) by DB4PR04MB0768.eurprd04.prod.outlook.com (2a01:111:e400:984d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Fri, 2 Feb 2018 08:04:37 +0000 From: Hemant Agrawal To: olivier.matz@6wind.com, thomas@monjalon.net, pbhagavatula@caviumnetworks.com Cc: nipun.gupta@nxp.com, jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.com, dev@dpdk.org Date: Fri, 2 Feb 2018 13:33:01 +0530 Message-Id: <1517558582-27108-2-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517558582-27108-1-git-send-email-hemant.agrawal@nxp.com> References: <1517514427-28843-1-git-send-email-hemant.agrawal@nxp.com> <1517558582-27108-1-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.88.169.1] X-ClientProxiedBy: SG2PR06CA0087.apcprd06.prod.outlook.com (2603:1096:3:14::13) To DB4PR04MB0768.eurprd04.prod.outlook.com (2a01:111:e400:984d::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6cd79976-f879-48e3-9d73-08d56a139c64 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:DB4PR04MB0768; X-Microsoft-Exchange-Diagnostics: 1; DB4PR04MB0768; 3:gtTSEuGJBHzu3g3rijom1/Xw91Fb6xsdQovsRGqWZYPn9Bsjb+EJdaf0hNXe4iwVoPO4OuGBrdS8I3tCy3v+JpTdxNm3yUtHCS68fzQXJPduqL8LWAfXY9dtJXhfSh9TIvdUOwBofUsLriz1MKRzG80pUz1vEORUKP5c/Uv9vww+LhIAm3NQqFIpEIgO3+rLUTO4D1mIlQ0qFP5BQ4GlOd6bGoB99Tizrpr17sqriWwkXDjvIqBLByMNdqNJJwfg; 25:I1vycWjB5ThQLf813JukzDNam9b+ZGV9YFsAj+Wt35ErMbU4fbwTJrZyEaW6MoxgScFfODUS1Je2i4t0ttAMEL5CMDpCekl8AW+Q8ZGInX/XYfEYtb/LH0mhsl/BVfncZdsbDppiPLDGUQTL7/J3Y3bJ4GPJLzLgoDde0yVySf61qff1gEh1Cuebi2tkEC/9q0I1q0p888F7muGqKDNWa0JigpDjf060QMyNBfxcWsBExUjIDBhNmbcNAX74gUUnYdH66IqpCi1LXFq5nN2zLt2KsxN8fGGrLklehc/jrIDYKfGAA20lMzb8ZFta1bkMETvc2SMYdb69P4s9qQ/KyQ==; 31:CjiBUzRxOatF5yAosYQ+eaPiNjJN4o0TTWOnCkD6ff1VGb8Wka8dpUK5pwx+AmjRkKI7/dVGoyjRHRlDPs3FOmIYRcuwXV1gXC1GNI8rfvynUV/bZc1V+KXKmhrXIR3v+F9mP6WPqZalNA66sjxDjkSal5y92Wd2sMhv50qHAokrnb692JMjd5lC7dCWMxiuOk9+57QdyKGWXZ+UFFYfo7+FusgCLK5Pv2Ckv3r9yIw= X-MS-TrafficTypeDiagnostic: DB4PR04MB0768: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; X-Microsoft-Exchange-Diagnostics: 1; DB4PR04MB0768; 20:TbUh1Qy4NVect1Hld0112FBLeg1gOTHwUqTqJR5ouN7A81aIIcnWiz18KXODkPHFVMJ7RP9fHIPqRlYYdOEGG67P3Ffoil8RuDU17JB4tKQlVvTQfcnAI9r72VEL5VsNrQo71NBep/AQ441f0I05bjVdO5SVDEkrUH22GytJAvsrJwqUIc7sE1eGyC228Nr1RnlNMpR6GrBVpG7WBHjeRIgtnMDuE+YURyBkn8SjQC8nT8GSG4DQ+a0/bduhIRZaZgFrdtyRwZWXdsUaflbAwjPRsgEWNaITsCqBpUDGhX7kTSoef6CEGfBHIQYbdLIe+AYLnriHe5wJHOIXM841JbU9JRLxfchJ0RCdo0G6Dpg7vWftlsKV9mWd5LHtV62q7t7AgTEr+EKF8NYu5N9hNrO7L2fLCd8i5R4bmwJww7RDWdN7QBils78OtFCfmvNiY9dupSjgoRq31jS7lyxraq95YE8MspHw43MCIsWz+ZZjaN7K932clmk7qBck6w6Q; 4:8Wts+WVYKEy6yr/QmxVhNSbzWrvK60xM3+vF9dYoYWEgnlARS6wqvgrR4n6JLfBtH0HlBeoO8MUT0FCxbEEn5x0NFxBPUcS9qKNTqmlzJ92apR6X/EdEhj6rfGuoL3T6Uu0I1ecP+nYlfQfxL/4Pzo9oUjmE+PSTJI9/+cqF9K6uM/wYfIb4JDAzAQL6iiQ2uNMSD74kfsWTIr/7YaHVVq+eoWvhL4Fky9k3Rusz7tG4kK9hGimGoNUyrrz+KCOvBAq1VYo8zgF3mkWRrhjUCTPj9ee6Y/YON8zynptVpM2G9IY8GCfi7/jiTWVkoikC X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(3231101)(2400082)(944501161)(10201501046)(6055026)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:DB4PR04MB0768; BCL:0; PCL:0; RULEID:; SRVR:DB4PR04MB0768; X-Forefront-PRVS: 05715BE7FD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(376002)(39380400002)(39860400002)(346002)(366004)(396003)(189003)(199004)(6512007)(6486002)(53936002)(478600001)(305945005)(316002)(16586007)(50226002)(25786009)(386003)(59450400001)(106356001)(6506007)(8676002)(51416003)(81156014)(52116002)(81166006)(105586002)(6116002)(3846002)(5660300001)(4326008)(2950100002)(76176011)(2906002)(8936002)(6666003)(36756003)(66066001)(48376002)(68736007)(86362001)(575784001)(97736004)(47776003)(186003)(16526019)(7736002)(26005)(50466002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB4PR04MB0768; H:bf-netperf1.ap.freescale.net; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB4PR04MB0768; 23:Tp5jHywl3SZEgd49Rf9rRcR4G9eBoqsuxWTwEE0HZ?= =?us-ascii?Q?xj2iR7tFVrbT+AyTHr+sav474hDgVPVOlJNyC9Eao0Q1Qrs+HxGvk1LaJUIs?= =?us-ascii?Q?KzKemJwweqhvb0OBl+FJBtwoZlmyBLZO0yvvskP439td53khWHe6qeQ3ISZr?= =?us-ascii?Q?7rTv13uGcuzTHcC3i1860X8psdXpeZJ7dAB/NGlY4aVnlzd9ldqMxTQhfLIm?= =?us-ascii?Q?jkpnT5VDB1aI5KMk+yabD0/jg3W0swAaabkCKBATo2fLq26yJ0OOE9XQm6dQ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zn SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2018 08:04:37.4023 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6cd79976-f879-48e3-9d73-08d56a139c64 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR04MB0768 Subject: [dpdk-dev] [PATCH FIX-OPTION-1] mbuf: fix the logic of user mempool ops API 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, 02 Feb 2018 08:04:46 -0000 From: Nipun Gupta The existing rte_eal_mbuf_default mempool ops can return the compile time default ops name if the user has not provided command line inputs for mempool ops name. It will break the logic of best mempool ops as it will never return platform hw mempool ops. This patch introduces a new API to just return the user mempool ops only. Fixes: 8b0f7f434132 ("mbuf: maintain user and compile time mempool ops name") Signed-off-by: Nipun Gupta --- lib/librte_eal/bsdapp/eal/eal.c | 7 +++++++ lib/librte_eal/common/include/rte_eal.h | 12 ++++++++++++ lib/librte_eal/linuxapp/eal/eal.c | 7 +++++++ lib/librte_eal/rte_eal_version.map | 1 + lib/librte_mbuf/rte_mbuf_pool_ops.c | 2 +- 5 files changed, 28 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index 1622a41..4eafcb5 100644 --- a/lib/librte_eal/bsdapp/eal/eal.c +++ b/lib/librte_eal/bsdapp/eal/eal.c @@ -82,6 +82,13 @@ struct internal_config internal_config; /* used by rte_rdtsc() */ int rte_cycles_vmware_tsc_map; +/* Return user provided mbuf pool ops name */ +const char * __rte_experimental +rte_eal_mbuf_user_pool_ops(void) +{ + return internal_config.user_mbuf_pool_ops_name; +} + /* Return mbuf pool ops name */ const char * rte_eal_mbuf_default_mempool_ops(void) diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h index 08c6637..044474e 100644 --- a/lib/librte_eal/common/include/rte_eal.h +++ b/lib/librte_eal/common/include/rte_eal.h @@ -452,6 +452,18 @@ static inline int rte_gettid(void) enum rte_iova_mode rte_eal_iova_mode(void); /** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice + * + * Get user provided pool ops name for mbuf + * + * @return + * returns user provided pool ops name. + */ +const char * __rte_experimental +rte_eal_mbuf_user_pool_ops(void); + +/** * Get default pool ops name for mbuf * * @return diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index 451fdaf..38306bf 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -92,6 +92,13 @@ struct internal_config internal_config; /* used by rte_rdtsc() */ int rte_cycles_vmware_tsc_map; +/* Return user provided mbuf pool ops name */ +const char * __rte_experimental +rte_eal_mbuf_user_pool_ops(void) +{ + return internal_config.user_mbuf_pool_ops_name; +} + /* Return mbuf pool ops name */ const char * rte_eal_mbuf_default_mempool_ops(void) diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map index 4146907..2e6cbe9 100644 --- a/lib/librte_eal/rte_eal_version.map +++ b/lib/librte_eal/rte_eal_version.map @@ -220,6 +220,7 @@ EXPERIMENTAL { rte_eal_devargs_remove; rte_eal_hotplug_add; rte_eal_hotplug_remove; + rte_eal_mbuf_user_pool_ops; rte_mp_action_register; rte_mp_action_unregister; rte_mp_sendmsg; diff --git a/lib/librte_mbuf/rte_mbuf_pool_ops.c b/lib/librte_mbuf/rte_mbuf_pool_ops.c index 385fc43..48cc342 100644 --- a/lib/librte_mbuf/rte_mbuf_pool_ops.c +++ b/lib/librte_mbuf/rte_mbuf_pool_ops.c @@ -74,7 +74,7 @@ rte_mbuf_user_mempool_ops(void) mz = rte_memzone_lookup("mbuf_user_pool_ops"); if (mz == NULL) - return rte_eal_mbuf_default_mempool_ops(); + return rte_eal_mbuf_user_pool_ops(); return mz->addr; } -- 2.7.4