From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0079.outbound.protection.outlook.com [104.47.34.79]) by dpdk.org (Postfix) with ESMTP id 7502C7CE8 for ; Mon, 4 Sep 2017 16:58:57 +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=aTHprL64nuYBLtgsztrEyR73EyX18vCAX6QeXwI4unI=; b=f5wR7DXvAkAkThj7b9DuFd4xHCLqoQyJGA9xJf2brzbOiQLFXIfzzIvtgYpVg6bL7GTUfzhJe5T7oVmvK3xykvctkOtAs7M+4h144OoycN/nF9d2G0nVsZiDpHp4PN44qcklyIHZAF8g9a4HkMQ7EkOgF53nepzGAxuBz0TTjxs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from [10.89.1.1] (14.140.2.178) 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.13.10; Mon, 4 Sep 2017 14:58:53 +0000 To: Olivier MATZ References: <20170720134759.4680-1-santosh.shukla@caviumnetworks.com> <20170815060743.21076-1-santosh.shukla@caviumnetworks.com> <20170815060743.21076-3-santosh.shukla@caviumnetworks.com> <20170904142232.jri222kqnvc5sorv@neon> <20170904144636.7kot5gcvpv3w5k4a@neon> Cc: dev@dpdk.org, thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com From: santosh Message-ID: <3d57f862-4005-79e7-4732-ae03dd0b6399@caviumnetworks.com> Date: Mon, 4 Sep 2017 20:28:36 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170904144636.7kot5gcvpv3w5k4a@neon> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: PN1PR01CA0101.INDPRD01.PROD.OUTLOOK.COM (10.174.144.17) To DM5PR07MB3098.namprd07.prod.outlook.com (10.172.85.8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e99aca2b-cc51-4d73-a827-08d4f3a576d2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DM5PR07MB3098; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3098; 3:o9fgYpJ/voSPkgMqzhBKblQqupTvSS4qpbhSbMRZ7N8vXD9MfDcId/yV6d7g70p+TaAHcPfrC0X9vZOH3DGrh4FELW1RT5TkASKDJRTKqm6RcdCKkbBfVsayG3lTdoZwDiFn0e2YMxoocZYaML5r0SXA3oqmCZV9+BgnYf7P4wnnH+O2/lG4evDaccUzNPpK+X4SQYeTTEKnavKkuWcNQHPWce1WzkVmNij8TUll8tVnzMiSFQvKYzPOc0nQvt0b; 25:7RLOagd/3aGqK3dWwqP5ftQGZJaxPwzgkhaBkxdBXD7OuYPMFenq4UD4QynLFx0em6vReMl54ACszXtLgtZJOPqUIB6JK+MOYTN43NVRSvdYXPjpBE9QuZQR8fZj/IZ0E70UXXZlyfHpb8bLVlh9OtkBAjN16ud+1XVLNMjJqffYS4SC7Ln+d3LIS9hHiqIEZv5NrBblHMzp9wN1ty/Qy7HKWMosnEJ6pWshv4bi0iYtJ/icBVt4QBxY5RXQB0lxIgdn7LgcPXAFQZXkov2KeUvgxvLPb2X/TdIlVwYMx2ffcDoUlyMZW39M6dtHh41kYdWItaU5yNhPWvvvBjpGRw==; 31:3S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p0O5pRXsfFL5AyJeI1OdWJJhDuEFdXM9yfdd4d0zUO9fuiiRQz5s3G/CVNgSSHIY+vjIDXE3m9QIcuVYlaniu19NILH2R0VQS2LqowWN/P/f/ X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(10201501046)(100000703101)(100105400095)(3002001)(93006095)(6041248)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123555025)(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: 0420213CCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6049001)(199003)(189002)(24454002)(377454003)(2906002)(5660300001)(42186005)(305945005)(7736002)(72206003)(8936002)(64126003)(101416001)(33646002)(6916009)(42882006)(8676002)(6116002)(106356001)(23746002)(105586002)(6666003)(81166006)(229853002)(81156014)(54356999)(76176999)(50986999)(31686004)(2950100002)(50466002)(478600001)(4326008)(83506001)(53936002)(110136004)(6246003)(5009440100003)(4001350100001)(230700001)(97736004)(90366009)(575784001)(93886005)(47776003)(65956001)(77096006)(66066001)(31696002)(8656003)(65806001)(25786009)(189998001)(65826007)(6486002)(86152003)(36756003)(68736007)(3846002)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3098; H:[10.89.1.1]; 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: =?Windows-1252?Q?1; DM5PR07MB3098; 23:Db7iwn+t4QRXEclY9qoTRXJ4+0F30GwW3+h8B?= =?Windows-1252?Q?HvyFu3VyD24uyfUGTQlENhGtdQ5TObAPru57jkWzBXDwiVcp+dTFlgqy?= =?Windows-1252?Q?uZo1dOM1JPqG4s/vXEt0hlUJeB1hLo6Ifg2YN0WgdKWeufIvFzVnS9ec?= =?Windows-1252?Q?/f9xQObyMmUgzG7z7CNsVP1hdfyTfZ8YBZUXRI0LvU+yjk/zxzsv1U8Q?= =?Windows-1252?Q?gI0YPNSht/DH5KR23P1EOSBNKeXvMxqw4hKH7FVigoJ1R9oeldDtDoFh?= =?Windows-1252?Q?4nhDkqOO6Fdfz0DI7lh0XhOtiGRonITYtLx21+7PCXmxM5aZIVxbvj7e?= =?Windows-1252?Q?NXnHoN5n9DpRIyW56YCV8vO64gucEiyrdxxTCcirGc/wBo3s6zniMEVb?= =?Windows-1252?Q?rDvp/Szf3MNVDzoPwSojN8lrr8WqU/j3H5xCUZgIcBef6uQPn8IAa+p2?= =?Windows-1252?Q?5WKslkfUfYLx6XT3UcK6h3GLTsoT4e7uiwP+5tndmhtTjFMyCtYYDS5p?= =?Windows-1252?Q?8a6VrHbT+5h9jtCFcVX7AvHS+daNWk/Lwrusf/VGuAswHDa+NHMJ1DCk?= =?Windows-1252?Q?DPtYANx/MxKzB5yNj0eyLwJeiEXI4Tnk/jBSs+4snOa7eXvxnVXBkTcW?= =?Windows-1252?Q?Bxiyb17RO+vo1l4AoLqzeZ+LLQiXeYD9airLVUOxiKT4IDFCt4difr6J?= =?Windows-1252?Q?HYYvVjiJ2WxbbRHz9BUBvuBJ4aJgExKBzseJWO3wPam2TT3FrvECZviH?= =?Windows-1252?Q?WVcYChhZut5G7QrL206VDoktZmoNDiVQ3LGtu43UZ6s38leFsWHBvWQT?= =?Windows-1252?Q?b95AUsf8l0QdQNDRqekHsM0mHs2NrLz8iuJD/or4YIbPMef66A7PYDrt?= =?Windows-1252?Q?8vQclps/sLLIp5vqPA+UbVTffmo714jhHhF6/3rpQIDZjVPv4PuD1PgS?= =?Windows-1252?Q?SOeP1ieHrNaYuULUY1S/Ez5AHfdt6y2FW+fQk3jwedklJYoMQyxnuPiH?= =?Windows-1252?Q?R0o3EVkDZexZTvhlgPRSJKUcxl4g4AZQ8fuQl91w8t5XW5HJJzqs1ZZk?= =?Windows-1252?Q?vjf5r07ZCIRJUOtHpDcIwfcf4oOPbzobTycoE0NK00D00A7MqTymeZdb?= =?Windows-1252?Q?QlaHewBYBv7fHdW9TUGukndUgHEvi7Fh8NxcK19YmA4I7rNoVA3PJVZe?= =?Windows-1252?Q?sb/7WZoEGftpI7lM52txUf1i2fkA6labyholbOe37D3GdOLojTU9XfWq?= =?Windows-1252?Q?XZc0/fExgHBNFq/UQ5Q7dridHVnVKCisuQ4AD7Z+j32vP8Gen3hT3xtZ?= =?Windows-1252?Q?BvT2FiNqpjRsOkM+VyslWqNujxhOKDrPXRoTGxkAgyMqPbDrNxNkNMYJ?= =?Windows-1252?Q?ZciCo752xfp53DjKlYam8O8uUqLuYlvJFLxu6Y8DsWNn2o1jdcPrAqrN?= =?Windows-1252?Q?MFjFL/7TBNHsLqvAy3UPuDM60OAYfEWMMHxWhyhVFB9J8YMwy0KqBb7f?= =?Windows-1252?Q?rM1dXip08xn1CmCvhxTpL2rK1drlfNx3n9CP0VnLY9OP43RKkG4QLmod?= =?Windows-1252?Q?sfIPUR8X76u+lGSSk1IynZlGeMugfm1kHzk?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3098; 6:Gy2BIrTjSaEJAhQiYNJjs8Enp04DGlCD5Cjc4Gb3YFAJVU2aM0r0NEZIFoMn87TDeb2CS5vCox4DxVIWwndHi/7JkaSGr19/61yTZbuyDAlRoyqR/HNRuHAy+P3AQaGRbcfHrx0wFS7V66bSfo0ElpCb7drJiNIJ6tQphMP6u9Y65Qf9spUwOoqxfXUdKf+xBs5J81vVxgtxDcykreK9GC3cBXU/u8U1kWMk2STPrJ7+FoOjkhqYU4/8AZ2yvyA59KyEVJMImc3WP/qsL9nnzGD7hAcHPy8HXdI4X6YSJmFjQPMa3vr/jhkQ7rNJYCiKsuuwK9UOJ0jqvDYOVi0T/w==; 5:8aZJGqzqNXHmZA1J55EEbO5LLsj7KbHuNmhYCc1yTpj6nNqhgQOYsdERwe6jL4WrX4L1Sy5xuWV25Q+eRU9OE6AZUoZys45t/WPPE673QBFdNUF8m0FSLUjY9t1CFD7XVNZWf1XDyzddkIrvjewrhw==; 24:nYKS1FZ5/iDLzTuAKY/RlKl4LWRCyPxosTqjth4lyaEGHgN1OQ0JMQLq2ljTv/Mxj8JrbNe5v77YCt+V2v2S/uzq5Hkoqdwq9ygtDNVYsV0=; 7:SRW4xqTkOSm7q8QIPE19SduM9ykY6k8E5K3jSOFfATdcivoaH+HQgaU84t/OBWNHuS5pZ0qgbCEuLK3GEIGl3Qp/YWHpy4CKlfP6ztPmmIsddVWBNs3ESDcTRcW20abZJ18AOEQC3HWN7L2DYDdIRK1009VxFqaXJAKXvXxBCH6wUEPKpGec1A2inG5JVCSdpQd3nKft5VElINLyrCtCBHvkKF/HXRfkqlKq6DJcBbM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2017 14:58:53.1471 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3098 Subject: Re: [dpdk-dev] [PATCH v4 2/7] mempool: add mempool arg in xmem size and usage 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: Mon, 04 Sep 2017 14:58:58 -0000 On Monday 04 September 2017 08:16 PM, Olivier MATZ wrote: > On Mon, Sep 04, 2017 at 08:03:53PM +0530, santosh wrote: >> >> On Monday 04 September 2017 07:52 PM, Olivier MATZ wrote: >>> On Tue, Aug 15, 2017 at 11:37:38AM +0530, Santosh Shukla wrote: >>>> xmem_size and xmem_usage need to know the status of mp->flag. >>>> Following patch will make use of that. >>>> >>>> Signed-off-by: Santosh Shukla >>>> --- >>>> drivers/net/xenvirt/rte_mempool_gntalloc.c | 5 +++-- >>>> lib/librte_mempool/rte_mempool.c | 10 ++++++---- >>>> lib/librte_mempool/rte_mempool.h | 8 ++++++-- >>>> test/test/test_mempool.c | 4 ++-- >>>> 4 files changed, 17 insertions(+), 10 deletions(-) >>>> >>>> diff --git a/drivers/net/xenvirt/rte_mempool_gntalloc.c b/drivers/net/xenvirt/rte_mempool_gntalloc.c >>>> index 73e82f808..ee0bda459 100644 >>>> --- a/drivers/net/xenvirt/rte_mempool_gntalloc.c >>>> +++ b/drivers/net/xenvirt/rte_mempool_gntalloc.c >>>> @@ -114,7 +114,7 @@ _create_mempool(const char *name, unsigned elt_num, unsigned elt_size, >>>> pg_shift = rte_bsf32(pg_sz); >>>> >>>> rte_mempool_calc_obj_size(elt_size, flags, &objsz); >>>> - sz = rte_mempool_xmem_size(elt_num, objsz.total_size, pg_shift); >>>> + sz = rte_mempool_xmem_size(elt_num, objsz.total_size, pg_shift, NULL); >>>> pg_num = sz >> pg_shift; >>>> >>>> pa_arr = calloc(pg_num, sizeof(pa_arr[0])); >>> What is the meaning of passing NULL to rte_mempool_xmem_size()? >>> Does it mean that flags are ignored? >> Yes that mean flags are ignored. > But the flags change the return value of rte_mempool_xmem_size(), right? no, It won't change. > So, correct me if I'm wrong, but if we don't pass the proper flags, the > returned value won't be the one we expect. passing flag value other than MEMPOOL_F_POOL_BLK_SZ_ALIGNED, wont impact return value. >>> Wouldn't it be better to pass the mempool flags instead of the mempool >>> pointer? >> Keeping mempool as param rather flag useful in case user want to do/refer more >> thing in future for xmem_size/usage() api. Otherwise he has append one more param >> to api and send out deprecation notice.. Btw, its const param so won;t hurt right? >> >> However if you still want to restrict param to mp->flags then pl. suggest. >> >> Thanks. >> >>