From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0042.outbound.protection.outlook.com [104.47.33.42]) by dpdk.org (Postfix) with ESMTP id 0A53E90F1 for ; Tue, 15 Aug 2017 08:08:34 +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=ncNSnWo7ppNrKgRplYlGdhwrnTOJ1rj68Dpe2eNrM64=; b=knxRETFlaQG63q0jPGS4yLtg8MgwCcs5aJbcZcDFKx5EZSW9v9G0xzajUPdZTG84I6riqj3Qa5DDlWXFH3SHQsOxM+zAWyKtoOYADsY4q6RDRerYpOJFJYrCaEmWSQK6ItS/UTFQNkfP//82qDODo0rD5N2AiwHCp4CqU3slEYw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from localhost.localdomain (14.140.2.178) by BN6PR07MB3089.namprd07.prod.outlook.com (10.172.105.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1341.17; Tue, 15 Aug 2017 06:08:31 +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: Tue, 15 Aug 2017 11:37:43 +0530 Message-Id: <20170815060743.21076-8-santosh.shukla@caviumnetworks.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170815060743.21076-1-santosh.shukla@caviumnetworks.com> References: <20170720134759.4680-1-santosh.shukla@caviumnetworks.com> <20170815060743.21076-1-santosh.shukla@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: BMXPR01CA0022.INDPRD01.PROD.OUTLOOK.COM (10.174.214.160) To BN6PR07MB3089.namprd07.prod.outlook.com (10.172.105.7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4aa9e5a1-6beb-47a1-7e6e-08d4e3a40f14 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BN6PR07MB3089; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3089; 3:2K+oi1wH+HQg1r1RfLrg+78xYhbrvPWOszWcWrk1sTG5HbVL0uj4XMMyWC1wf+3RJtQBa432ONwOvaJxFt9YxsojGcOPpBbWtw7x7UNwOpSJh1Fw+EUMheTPirheDC/KYV0E40geQgx97ZwnKaZMuVLntxRnrnrk5GqGWUPLIr8LA+LXLgkVP6Uqit+M36M9QRPYzsPlhezwtH7yOy27VNWebCtp+d80h3gVnJFTrvgNtppvHOmcR1cHBcfmTvMV; 25:i8/HyEIeGlxYbxHvsKpzAVhMok77FUWb1i+5rPSEAhTqMOMWRbyKQONKu8g0BmYZOp2Nh4hLx2GJQTUNnZoi6MItJ+oEc5qKnVEdV6WfgJv6TgEYzcna0O5LIPn8yLFOEysXjXruxVK4cWkhl0xo0iglYLXh9BAuH2Q3uelQ8uk6dIFzpiDoRV8qf3di6nvZmokpkpdLeTCgimJxEyqzIgYU5qJLWeiyi1ibcq9w9I0DSqQ4mO0ThrxOML9WzbzbYwqt7H/ZR8sH1peB/mlOIbaCwgdu6H11Jtcfo3NSRwmXM1Ri3xn1PwEMg2NPSNw7Jwk1ZfmolR1Ah53u6Mn3tQ==; 31:r3Nbn6LLN5NSb5pJH3wxhcJadIzV3KyibQ07HCe17gaS6Zr8kEtWPKED3VjT79A76hTEEM/n/cUbBIymmMkm6oUqovjZWlbk43n32GHnf4kQgDhuCmNoPqeqlXWJ73fgCsl82VozDBxJ8O6cFMJqNNhq3XJfviHzwyRf1c8Y7VX3z1pGgHsUsfKATT9PqmJlO1hdWifoZSNRIB+0BgKSUng+sOWpgGdDbbh4gZntgsw= X-MS-TrafficTypeDiagnostic: BN6PR07MB3089: X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3089; 20:2l2AaJQFY3iM9OF/kdDd6Scm8kpcM1Gxcg81iADy5WLlspdi02CpTGsH3JrnVLaeA0FHPMgYMGg0FvgrXCkkcOYoaU1LhX2tgIKTiV+dBc+bGSE2OrgI05poN+E+KL9vahG1zSifAplnxEAXAzPkJQzgj5qkdlm/wiKeCqSkUmsW0wjqZwwvLjIGE8M6/8V5WQTd3i5zNI6ZsbWgvcAe40+Y2m4PPtadxlMGQ7ovxTL88BNc++Qszz65NLrBjm0ZuGRVDshvq/Bc1pNPvcskNN1JDFT5JEIvvY5DN/TM74Ca8ClojR1nBpsxay1apiPS9bPC/XzmlA5u3J/xgLWRfT0lOyeoHpYX9l42srE0b8BibCYmJbWVSLDETNPXthRjDKHZINL53JPucCYmpOU+VbGXzZ3eirtiegJ6ZAl0ZI25+UdELSaua+3tqmrWUa1omWYnZznYShdTqGzExU2l1CL18mamKWG67lvrTLyPYLjiPRrItZkprwg0nDS4Kdghj4rwBpeZyjpNkyWn1lQt+QpO3F9Ee9XKOwiJv+XEdyv4FscTrHVIHOOEZr2vz8YTzQ6oaK7GTImssbEWAdK8zm12h1edC62o/eXZwuHoIGM=; 4:LsjM2bsgCGySGW5JjvLiNn+o9QWkVyWwyY5P5zJuXC8VgaWGQ/jyWOVpV97g+1raOitNbNBkaGpkJkM3iaSXYDMt9sE6QDdjiUIu1u74BevnjAOs/2yynTuS5ahij8oGzzt1NIR47xKp4l0ju3zKNRepebux4aZha/5raQ9Uy3vy/ht8WMwRC0O2152I0PiTT21Sxu6hdbQNz8psOyq/P7hZOILHq+fp5dJjcTUPnYF0YZNtVAlmdWqzU1u9Wzt3 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)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(20161123562025)(20161123564025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR07MB3089; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR07MB3089; X-Forefront-PRVS: 04004D94E2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(6069001)(199003)(189002)(6512007)(106356001)(72206003)(6486002)(42882006)(6506006)(66066001)(2950100002)(47776003)(6666003)(48376002)(4326008)(36756003)(15650500001)(50466002)(575784001)(68736007)(478600001)(25786009)(2906002)(105586002)(97736004)(5660300001)(7736002)(305945005)(50226002)(8656003)(189998001)(53936002)(8676002)(5003940100001)(7350300001)(42186005)(33646002)(5009440100003)(76176999)(6116002)(3846002)(107886003)(81156014)(81166006)(110136004)(101416001)(50986999)(1076002)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3089; 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; BN6PR07MB3089; 23:3rxehwCiSA20oUyDzWXhMYHAlIWN3sZJ4g3Hk/eZ6?= =?us-ascii?Q?oqYxookWcr3A+AOM3SS48RgLAEL+2I+acAkUoJMeb4z7zt8BhlvWbCMDmlyi?= =?us-ascii?Q?LI0yyLI1hKAhXwTEFfzXmoqzTfZJQBbjOe1/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okjpl9uGm2tbK4lVv4zScNNAP3ieaMSsuU93fCp5L+5z9Bp7KDSBo+9pKMpJxrsX3hzdsOHWmTJ5hnmgcKTdVfQUX0KS2BP6h9su2SA34uVSEuEUMcMWUDMteoglQ3pnot8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2017 06:08:31.0413 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3089 Subject: [dpdk-dev] [PATCH v4 7/7] mempool: update range info to pool 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: Tue, 15 Aug 2017 06:08:35 -0000 HW pool manager e.g. Octeontx SoC demands s/w to program start and end address of pool. Currently, there is no such handle in external mempool. Introducing rte_mempool_update_range handle which will let HW(pool manager) know when common layer selects hugepage: For each hugepage - update its start/end address to HW pool manager. Signed-off-by: Santosh Shukla Signed-off-by: Jerin Jacob --- lib/librte_mempool/rte_mempool.c | 3 +++ lib/librte_mempool/rte_mempool.h | 22 ++++++++++++++++++++++ lib/librte_mempool/rte_mempool_ops.c | 13 +++++++++++++ lib/librte_mempool/rte_mempool_version.map | 1 + 4 files changed, 39 insertions(+) diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c index 7610f0d1f..df7996df8 100644 --- a/lib/librte_mempool/rte_mempool.c +++ b/lib/librte_mempool/rte_mempool.c @@ -363,6 +363,9 @@ rte_mempool_populate_phys(struct rte_mempool *mp, char *vaddr, struct rte_mempool_memhdr *memhdr; int ret; + /* update range info to mempool */ + rte_mempool_ops_update_range(mp, vaddr, paddr, len); + /* create the internal ring if not already done */ if ((mp->flags & MEMPOOL_F_POOL_CREATED) == 0) { ret = rte_mempool_ops_alloc(mp); diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h index d7c2416f4..b59a522cd 100644 --- a/lib/librte_mempool/rte_mempool.h +++ b/lib/librte_mempool/rte_mempool.h @@ -396,6 +396,11 @@ typedef unsigned (*rte_mempool_get_count)(const struct rte_mempool *mp); */ typedef int (*rte_mempool_get_capabilities_t)(struct rte_mempool *mp); +/** + * Update range info to mempool. + */ +typedef void (*rte_mempool_update_range_t)(const struct rte_mempool *mp, + char *vaddr, phys_addr_t paddr, size_t len); /** Structure defining mempool operations structure */ struct rte_mempool_ops { @@ -406,6 +411,7 @@ struct rte_mempool_ops { rte_mempool_dequeue_t dequeue; /**< Dequeue an object. */ rte_mempool_get_count get_count; /**< Get qty of available objs. */ rte_mempool_get_capabilities_t get_capabilities; /**< Get capability */ + rte_mempool_update_range_t update_range; /**< Update range to mempool */ } __rte_cache_aligned; #define RTE_MEMPOOL_MAX_OPS_IDX 16 /**< Max registered ops structs */ @@ -531,6 +537,22 @@ int rte_mempool_ops_get_capabilities(struct rte_mempool *mp); /** + * @internal wrapper for mempool_ops update_range callback. + * + * @param mp + * Pointer to the memory pool. + * @param vaddr + * Pointer to the buffer virtual address + * @param paddr + * Pointer to the buffer physical address + * @param len + * Pool size + */ +void +rte_mempool_ops_update_range(const struct rte_mempool *mp, + char *vaddr, phys_addr_t paddr, size_t len); + +/** * @internal wrapper for mempool_ops free callback. * * @param mp diff --git a/lib/librte_mempool/rte_mempool_ops.c b/lib/librte_mempool/rte_mempool_ops.c index 31a73cc9a..7bb52b3ca 100644 --- a/lib/librte_mempool/rte_mempool_ops.c +++ b/lib/librte_mempool/rte_mempool_ops.c @@ -87,6 +87,7 @@ rte_mempool_register_ops(const struct rte_mempool_ops *h) ops->dequeue = h->dequeue; ops->get_count = h->get_count; ops->get_capabilities = h->get_capabilities; + ops->update_range = h->update_range; rte_spinlock_unlock(&rte_mempool_ops_table.sl); @@ -137,6 +138,18 @@ rte_mempool_ops_get_capabilities(struct rte_mempool *mp) return ops->get_capabilities(mp); } +/* wrapper to update range info to external mempool */ +void +rte_mempool_ops_update_range(const struct rte_mempool *mp, char *vaddr, + phys_addr_t paddr, size_t len) +{ + struct rte_mempool_ops *ops; + + ops = rte_mempool_get_ops(mp->ops_index); + RTE_FUNC_PTR_OR_RET(ops->update_range); + ops->update_range(mp, vaddr, paddr, len); +} + /* sets mempool ops previously registered by rte_mempool_register_ops. */ int rte_mempool_set_ops_byname(struct rte_mempool *mp, const char *name, diff --git a/lib/librte_mempool/rte_mempool_version.map b/lib/librte_mempool/rte_mempool_version.map index 3c3471507..2663001c3 100644 --- a/lib/librte_mempool/rte_mempool_version.map +++ b/lib/librte_mempool/rte_mempool_version.map @@ -46,5 +46,6 @@ DPDK_17.11 { global: rte_mempool_ops_get_capabilities; + rte_mempool_ops_update_range; } DPDK_16.07; -- 2.11.0