From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0073.outbound.protection.outlook.com [104.47.32.73]) by dpdk.org (Postfix) with ESMTP id 8181E7CD8 for ; Fri, 19 Jan 2018 13:32:02 +0100 (CET) Received: from MWHPR03CA0025.namprd03.prod.outlook.com (10.174.173.142) by BY2PR0301MB0726.namprd03.prod.outlook.com (10.160.63.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Fri, 19 Jan 2018 12:32:00 +0000 Received: from BL2FFO11FD051.protection.gbl (2a01:111:f400:7c09::158) by MWHPR03CA0025.outlook.office365.com (2603:10b6:301:3b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.428.17 via Frontend Transport; Fri, 19 Jan 2018 12:32:00 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD051.mail.protection.outlook.com (10.173.161.213) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Fri, 19 Jan 2018 12:31:59 +0000 Received: from [10.232.133.65] (B10814-12.ap.freescale.net [10.232.133.65]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w0JCVtlw003856; Fri, 19 Jan 2018 05:31:56 -0700 To: Olivier Matz References: <1515996674-26338-1-git-send-email-hemant.agrawal@nxp.com> <1516281992-6873-1-git-send-email-hemant.agrawal@nxp.com> <1516281992-6873-3-git-send-email-hemant.agrawal@nxp.com> <20180119100137.ezr44stykkb3udqc@platinum> CC: , , , Pavan Nikhilesh From: Hemant Agrawal Message-ID: Date: Fri, 19 Jan 2018 18:01:55 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20180119100137.ezr44stykkb3udqc@platinum> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131608387196449583; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(7966004)(376002)(39860400002)(346002)(396003)(39380400002)(2980300002)(1109001)(1110001)(339900001)(76104003)(189003)(53474002)(199004)(65806001)(31686004)(81156014)(4326008)(31696002)(97736004)(966005)(2950100002)(6916009)(508600001)(6246003)(81166006)(305945005)(26005)(356003)(53546011)(77096007)(2906002)(50466002)(53376002)(64126003)(68736007)(65956001)(8676002)(47776003)(8936002)(76176011)(93886005)(6306002)(230700001)(58126008)(67846002)(104016004)(83506002)(53936002)(54906003)(85426001)(105606002)(106466001)(316002)(229853002)(23746002)(5660300001)(86362001)(65826007)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB0726; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD051; 1:2cK+pJmBtPRo5WzQlmf/MqMq9J5Q0MhO2lyz2DVZsB7sUiKZbXrzBy+L7lhcdpQ+vEDrU8lEtzUSoTlVLVjqqz/9pAMS8BjIskX6seJqZzNE+3oYnxid3BcBV7LPOhEc X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b880228d-5407-403f-732f-08d55f38a2c5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(5600026)(4604075)(2017052603307); SRVR:BY2PR0301MB0726; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0726; 3:SKPQ5XokC+3vm3EBjMZxhhJZu6a4rBP/XwYZ04H2SQ9nvlcuau3qRO8u+xWB5vf9ydw8QKGifm1kFl1i4dV9D3gdSYjrTUnu+yeZpdJC3Su2riATl28A/XijYNjQRjOn/QXLR9LxhRmICyUaYsRggUAFX7/Bvfjx+QSlxadepBiiWCkngYFuZHG6zva/h+gk8c4D76KMCsgdX44SNGMCZ3hNxJiv5hYcqQ3QSZnEHWLIbxafzy0W5z6SoCinuGUpru2xOAai/m1rsOI9PLpF06Tw50GeO8BGTnSqzJUswDV515PAKoOYQtLh5snRzAYCGMh6tzvWvIHCvxsLpyGBvz9RhCtIWDLjndrvOfPRND0=; 25:S3k6uSFQg9DY4Egb9K2+RugFLN0+/nXBKSsb9J9CNBAQ6KT4d0lqspfS9npy4jjPqu+Smluts9aMC0yFze3r5sfOZ5WD68MXEmnbj4atyRWMCxLeAQ6JjLmU78kU4Et/ew2HqkoOD6bfSx78ZX5kDN5S5VpH8ZojeWDqWKEn+cM0fHZwhXIPQCNF2LeAjfvJYi7yfpuHsqY05T7KXTRF5skV62jetCpL7nr2Fd/FcviSdxg9re7VrQjTyTTOGU9wlbK+T7V/I+js727mN8ApgC89OVfTOWIG0Monwxon9qjmfp8+P2rLWQw8MxeENq+HYm56TVhslL1QVd0hMLfCCg== X-MS-TrafficTypeDiagnostic: BY2PR0301MB0726: X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0726; 31:ku7BTrfjrXExha3CrfkcM0fRV+35ZSQ+IJ/wDxTHFW8onDp4oj2cmyXXRYQ1IZmd8HwS6J2n23SxUrQhN3KYOhoGSqMt/VeKLSs3Oj768WqYcK+IVBG/ub/Ayl9SheFaQWUduzFz8Geng2lxxlyHa99nzfeg6MuaL5C3/D/v+RxE3UunJCZzkiemHJYTDZhFSKBdhfN23FLrLF7sAxqug4hSUVb1fLovEuphqiqjFVs=; 4:bfsUYxnrchGag78gw9vbgbFpwjxlhaXe+rNV6avjf/P22T5kEYL3s2AdcLYVCjl7i54HCOjaRULiFrCnWO6O1Bg8O/U7O7JJketntnQ0M2NwnrV1XID1BMGTWI2u83Ff/Jx6m5hqn8+bPIXbB0M5w0zLxwGN+iz/8L8D7mp5S7uiEvSBM4ohgUqZ/3fO7pew2JYAfrFFCRJ1CAy+o0hvErj+fZWffGX5LoNCwtQrUsEx9eEp2hVmHfdrjQzZl/5zvzolzoGRTuDyJPfEHCzMFKgvgELX+AMYGvnLO89iXggmlsXnQyz9+YbEB8qJqludN0c7tNtwr1sTxSUIjh9wMA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(3231023)(2400077)(944501161)(6055026)(6096035)(20161123559100)(20161123563025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(20161123556025)(20161123565025)(20161123561025)(201708071742011); SRVR:BY2PR0301MB0726; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BY2PR0301MB0726; X-Forefront-PRVS: 0557CBAD84 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; BY2PR0301MB0726; 23:1aMgyj858KqB4BaadFFwf3OoHFehZ0yggU6?= =?Windows-1252?Q?UQK2NEcLtAl3VUUn35m6fc4HmvV63MQPPcO0QghBhIx2uUOItwIRszyJ?= =?Windows-1252?Q?0mQNUIg3JXMyMjsFsMJXPM80Ia5nO7Wa0ScPAnjolF/QG7uSwDKl19Sx?= =?Windows-1252?Q?vBXmVkr4g+AwzpT/COu6iPJf9T53b9HqalU/KwLC7wftfawE3UlORVsW?= =?Windows-1252?Q?55YbhHqLnahULY5Z2gx/2bM3KUsMdISKQbw+UGeBnNPD8grEh7OmZKT4?= =?Windows-1252?Q?bv2MjOMRjd96X2jJVOcg/h/bYjtDtdxj0WipXLKWyENmjLY1Um1jciYw?= =?Windows-1252?Q?wm511IFOK4AjQKxuUIAksWLHzlg0CT+aeXmKwmUOGHS6NxQnrAoIRnlK?= =?Windows-1252?Q?9BNrohKCSWlUEsvSFhtmlrt/mMx6lpBGa8cbbxyZmQRotyviq96u7Hz3?= =?Windows-1252?Q?wwtkeSlLRSosFDO0UkGPtWPpcaYqvmvOnGhAaIDrQBm7Nk3sch6K/rpN?= =?Windows-1252?Q?JUmGUIKW6MQkHrBD8Ds75AIRu/u2VR+jwMzWmfZylpNf9ew6sHmTjK77?= =?Windows-1252?Q?76BOOf4NNnrFUZ7LUj9kZfUv7tB1W9QY+8mpoSj2gurm6yY2WmxAeuNl?= =?Windows-1252?Q?bpSfG5U8lGvCqPoklvCgIl9UMKd5q4VaKRFvKJNVsN2CsvrM7d7S30kf?= =?Windows-1252?Q?89n2wpY9t8rswg7wG2P+pR72ec5dfMEQfxpxluFBVVNkSsyqK0J9lmN5?= =?Windows-1252?Q?UuXFckTlahfY7T1CZeZARM6im8bx42CgD+RB8qdowUZrNG0KebBICAC5?= =?Windows-1252?Q?AOfamvJsvvy7gv2HstcyLdoK7nrCx2rivEJnCFx+Sq5uSLi89I21GJx6?= =?Windows-1252?Q?xehPOwmLgr6oCVWhN8fE4n/MBRG16kzN9UqRgAEe54d3bDhd1HTTyaMK?= =?Windows-1252?Q?3xRWq+cGYKC8ndoiffhuB15CTmn8zfQ/3Q4Vnntdc7NN5JoG8xbgeMnV?= =?Windows-1252?Q?8koFqcdDB4/u796mHFlyXuf6RINpexfad5U7llMnBo0c8Phet7gCal+0?= =?Windows-1252?Q?O/dT7TNwPC6iqwlfJH/sAqtY0e1SV22WUyVoc0D0JEVDMdlq77ydJgfY?= =?Windows-1252?Q?bsYrhuuQf2oaXewLVI95fZ1fLzMHHSQLU+6f/aqNHX3FtsljKguGCdQ8?= =?Windows-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2GJ0N76m5p4yht2yn+Gx82wzAsv/JmdKqRAG34P70XJ+ZwZ0HYUpPtjM8JT4DDu/Glt//wpWaNpg2zSesIf3LQc8p8Oa5rTihwwMdvvPi+uGO4vrPxoDLb/+uxwzmuPbM+Sz/rJuwbmGGcEajk6KiMoatGu40ByA6fZRUxWn1UT+bWyQ4w0Y3183m6CRDcn0Ov5njIvqUUMB3d5IRUL70AzGTJt40EAqAHMfRWYkZc6Ckcp3HFZRlQG SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2018 12:31:59.4733 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b880228d-5407-403f-732f-08d55f38a2c5 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB0726 Subject: Re: [dpdk-dev] [PATCH v3 2/7] eal: add API to set user default mbuf mempool ops 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, 19 Jan 2018 12:32:03 -0000 Hi Olivier, On 1/19/2018 3:31 PM, Olivier Matz wrote: > On Thu, Jan 18, 2018 at 06:56:27PM +0530, Hemant Agrawal wrote: >> Add new API to set the user defined mbuf mempool ops name >> i.e. set the provided ops name to `internal_config.mbuf_pool_ops_name`. >> >> Signed-off-by: Pavan Nikhilesh >> Signed-off-by: Hemant Agrawal >> --- >> lib/librte_eal/bsdapp/eal/eal.c | 6 ++++++ >> lib/librte_eal/common/include/rte_eal.h | 9 +++++++++ >> lib/librte_eal/linuxapp/eal/eal.c | 6 ++++++ >> lib/librte_eal/rte_eal_version.map | 1 + >> 4 files changed, 22 insertions(+) >> >> diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c >> index c602d02..64f010a 100644 >> --- a/lib/librte_eal/bsdapp/eal/eal.c >> +++ b/lib/librte_eal/bsdapp/eal/eal.c >> @@ -117,6 +117,12 @@ rte_eal_mbuf_default_mempool_ops(void) >> return internal_config.user_mbuf_pool_ops_name; >> } >> >> +void >> +rte_eal_set_mbuf_user_mempool_ops(const char *ops_name) >> +{ >> + internal_config.user_mbuf_pool_ops_name = ops_name; >> +} >> + > > I think we should only have the "set" API in mbuf lib. > > What do you think about what I suggested in > http://dpdk.org/ml/archives/dev/2018-January/087419.html ? > > """ > The proper way is maybe to keep the parsing in eal, and at librte_mbuf > initialization, query the eal library to get the user pool if any. > After that, all will be managed inside librte_mbuf. So the eal lib will > only do the argument parsing. > """ > Will you please help me in understanding, how should I do it? 1. The is no standard librte_mbuf initialization routine. RTE_INIT will not work, as it will be executed before eal_init. dlopen is for shared lib only. Is there any other method? 2. If I call it on the very first call of rte_mbuf_user_mempool_ops_name or rte_mbuf_set_user_mempool_ops_name, I will be checking against NULL. It can be NULL always. So, no real meaning of maintaining it in librte_mbuf as well. Yes, I can maintain a flag to know, If I have synced with eal parse before. But that is not sounding to me clean. > In that case, this patch could be dropped. Please refer to my comment > in patch 3 to see what other modifications would be needed. >