From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0047.outbound.protection.outlook.com [104.47.37.47]) by dpdk.org (Postfix) with ESMTP id 789F158F6 for ; Mon, 4 Sep 2017 16:34:21 +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=O9d2n9fYUMjbgt8HxgaDR+omGd/3/E4k9M1wxe0CLzY=; b=emVJfdrRoEhnzfpfK035cJK37vSqmkrpX4VjtjsqKCGXY2bXHbWowmdwT+3i7exKc5Azg3KmkndUxweiM/yNvE83EveJx862wUwQALcGGl4YVHMqRo06IznHiBJ4SFy2ReyevUHWMgw632cxxHBkmM44VfITMyK7+1EtVamoq3Y= 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:34:17 +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> Cc: dev@dpdk.org, thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com From: santosh Message-ID: Date: Mon, 4 Sep 2017 20:03:53 +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: <20170904142232.jri222kqnvc5sorv@neon> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: MA1PR01CA0084.INDPRD01.PROD.OUTLOOK.COM (10.174.56.24) To DM5PR07MB3098.namprd07.prod.outlook.com (10.172.85.8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5924af09-87ed-41a3-1474-08d4f3a20720 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:Sb4zRkY3TP/nXpzSZkPjNqeEllpT4rbxKZQRO3j0zZ63G6Yk4nBhUTQa7wFj1M3S6+q2YuNUadssGf3DL3C0nwBj4NgjAI1JdDNJsHbrZQmTBPiqrhab02y9++w2rToFR0Do8L1vQxeEtbJV5wBI3CjNKtgO/Ue48zuGeLXCybikTSNLod0n01gcv0cCF7fjOAKacqk8T6R+m0/yDuphxGwbLOWadZYy6UtNCjrZ6nMyDq/gmOjMf54y/1FAItX0; 25:99aqBrsHkN9X+vNzJ7E9yl6OXQsteebT9EttJJEUAd2pi3ccMfooSv/zxuLU6FCRbheAnBUzuusCYgQWTx5zYre7JjbPL+MiJcM50SqMIwr8x3PduOjA5OTCy3z73kFzyf61OXCXF4zrO1vWi+MowLZIWPz2VK2yYEq8MSpbegZhtVh44hJhR8hugg1AWzNGb12D7s/PYDxLS4pVtjTw6FeJpKkqn9ZunOxt3AVf9s82WSQsX9d+Kn+8tIU64TPT6ICZFgIyyadACAMNoADll+0qBowyuxaeL1NoTEb2v71uVI7TWJGUP3I+r3iQ0eponBA/qBTAlQIja1g9ofyQ7g==; 31:ZDesjDWi/+fPM1jsdiNfAI1Mma/vvTOVFBBiMzA5L9yd+h5Ot1f5mk2RE3F54v9MDM4HvSImhm8tvh/iUpQceW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Wbcf/3fjAwfAWXXC1j3Wb2 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)(101416001)(72206003)(8936002)(64126003)(33646002)(6916009)(8676002)(42882006)(6116002)(106356001)(23746002)(105586002)(81166006)(6666003)(81156014)(229853002)(54356999)(76176999)(50986999)(31686004)(2950100002)(50466002)(478600001)(4326008)(83506001)(53936002)(110136004)(5009440100003)(4001350100001)(6246003)(230700001)(97736004)(90366009)(575784001)(93886005)(47776003)(65956001)(77096006)(31696002)(8656003)(65806001)(25786009)(189998001)(65826007)(86152003)(6486002)(66066001)(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:H1apZoyVV18P5QJUBwP48tjpqlwkfAcN/yxTt?= =?Windows-1252?Q?PRKWZURmDjV5n2Z6HiYKQWegRmRopnqjnnRGmZPfZiUBzXFvfmjtmT1P?= =?Windows-1252?Q?LSyfrlSfkUeBN1NjyQHAwl2QnzoPXx2Zz86Ka5CbABuD+PhOsUqXS+xb?= =?Windows-1252?Q?khgp95RSPI3LWvjINj2SJR9wZcZ7RLjuvp3PIDlR1k2GsZV9WHJPXAm0?= =?Windows-1252?Q?WOqHv5HGXKcMwEzl3i/dG9LQjsBSpdBVso+858jMRHTaZiZso9FgB7wA?= =?Windows-1252?Q?NtVfjWv2kamdV+fJ9fJnt2aOLIhhP+gunIf25gtGx6O/D/pXBAuJr5af?= =?Windows-1252?Q?bXqFfvVT9SLEjzJQvwQ1WjbybjFZxWDjaIZ0f83DlTfRm9LV3vO3Q+EZ?= =?Windows-1252?Q?H4x0MvIYLhEB818TLqHY9eikd5ZrLpQIg95j+oxWfU55ZJmmYoegwHCO?= =?Windows-1252?Q?5LY3d1I/lA2A/bi7+xaQLIHI+tnDjaWZ9AfbMew79h355rAt5b2o8bBe?= =?Windows-1252?Q?2JIACwBVDu7M5DBboBBz8lx5/mbFz2EldWpG6zZte14rvGZKJ4nN9bXs?= =?Windows-1252?Q?HT6fJksn8Vsv07cut95PlxS5jJoOdD5o5jRbRtVRF2eFsZMyjMk5u5CJ?= =?Windows-1252?Q?QmBmfrkHkRXScZBdIg1c/A9+Zj12w9vgxkmxyrrEL/Yq9tglyPD6UEHq?= =?Windows-1252?Q?Maw8uDRzHqXc2zkXJGo2evx6ZIlm+zGdflX+GGyGD9U+R7qoARt3GMAM?= =?Windows-1252?Q?XFHF4ROCiabSwY/VnhMQCtrwuRwWhSUz/k3Fi8ys+TIj7xmGsqkPu14q?= =?Windows-1252?Q?PlgS3eKpFHeHshTEFR4HwxzBFXleT0nUnTfdrsNUtIghK+dPlfQa6eNw?= =?Windows-1252?Q?hlN5ugupn/blx0vHgsr0Y7lF0gv83pz1odls40TFkvVa7tNL7P9lGKhP?= =?Windows-1252?Q?tb254YkyBjNK6SA/8WcOyIE+UBUpbawaNuhZP37k74vIk7msSYQeHcN2?= =?Windows-1252?Q?sYKMXx0m0BQLaiwn51wyJLhQzf5EDfBRJLHal7G0glasbQXsuLbl+VX9?= =?Windows-1252?Q?YkrIguVNPUD7VqnfsAgCsqxOrp8+JdAL9YgP+OB9x8q20LGQtB50cl6J?= =?Windows-1252?Q?q84m48tCmFs00ssOQ0at0AsIiHYQDrthDHAU1TaLYGemL7XBCeSPWPPO?= =?Windows-1252?Q?da91bzwA3GwjMld+vcTQGZcnaEeGicW4Fh31CY6v9OPwKbNjMtVpBQXM?= =?Windows-1252?Q?4DcpMkLGXw4wZZCRyveW3zSXIb+o+uFtJuo6Xf2U7EGiCz+AvPoFLtk6?= =?Windows-1252?Q?hlXUKaBf3StdRepODPR1x9N2FjdM/MZ7NCBQF4bIDp7N9Y7b7ahd2oU5?= =?Windows-1252?Q?iGl3W291wmIkYPal2cSBiYmNt8v3OQWu2exFzFsAJ+HArQ1v+j3hXYUR?= =?Windows-1252?Q?BhYtvfo3HoMxYDN+DX36HL/xXBDkeopBbr19r1rDUXVpo8zXlnRaquHf?= =?Windows-1252?Q?hyJi8oP/2pf7esjMRVImYT/sS32ALSM93hW6K/3dINVL/WD8bLbTldwE?= =?Windows-1252?Q?JBolJNZVrV/X27NdFLvOjHWp3vyyZTztk73?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3098; 6:2ojH/G4HyRC5btVlKIu2TfdWvNNsS1YFJsSmmEmeKMxqkkTruFhEdvumoyyybeZ6cGsFZ3JInQBItYNRb4xzK2v63l25HPMs3PlUFU8JjjLxdDj4MEEoxKWqFO3BRhi2JvJ3Rs+eDsEW9ChDMkfMLnHEFeDvY7mnNS646ei/DYbfCcGtrp9QMYAizge5iU26pIOWCOHqhV3NTwxBGuUrn1rH4UWgfX/AcQD4dJZDwv6lNljV/UcldCNy6/XzFe7SH5+DEW36xfSAeh3HXKPaTAIt5e73M/6tPAHwYdw12zXbpfAgB9Sp5rb3lKwD87HN6JNeARgXiQbW69ZPs6nSYQ==; 5:BkEc9MuOJm4VZziBBkBXZNHGB67IBidfbxcmguZ3zsQqG7GlUdh0HOXK/XeBnCZmxVtDkc2yjEObj7mVWxKeqI9hyVf7Td5S35+Vr1DDaV/Yn65YNIrF2jfuZjvrd7zPs2BZs4LzKhwBYcsZclF6PQ==; 24:hjdaHUMtupQhn2jqRJK75oYIM4JIwisFUbiZsboK4UeiMHvlla3e5YRkwkeodaN47DcqTabgEZAWgJtMcG/iWo3/MZ5mOlSDRPUnDflzfIM=; 7:yMdcICw3MGYYSWZLyuBGH+9c3NbKYxiUDLB9bEodvWaIWj3GyDBJ0M5F+vnHcPCos5WqI8Hj92iyhCljXM7ejygKMlWbNHYkgnvVZ/8PD63/zIjrrFKsvTPALwY4IO+RfqtffWi86+11M3fiyaYMHg9eAhapMNXrxKGccx1DtgUNxoPaq3bAlIanIKOTWsLgj7n0E03lsZEm1oJ8N71b3CZ9C2qvnwq0pzFdnvt07Yg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2017 14:34:17.4158 (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:34:22 -0000 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. > 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.