From patchwork Thu Jul 9 13:46:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 50969 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BC43C228E5 for ; Thu, 9 Jul 2015 13:56:00 +0000 (UTC) Received: by lagc2 with SMTP id c2sf30569479lag.0 for ; Thu, 09 Jul 2015 06:55:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=4tMD+SNSa0GDwesxOMceL6/7XIvscqS4q/cAZxexA5c=; b=VtaYhCovnchVacxHQqWhNmDtRzwueUVCwCbB4eVohGWo0GUCpzwRkRdUPd9A9B7baU DpRlBSyLaP/v6hR/C0u3SZBQRslur77PEygWui6mUQgOzHgMfl/kv6uvFrZciLqwSLMO LorNjyLmR6McE14Vn+J6wvzSS8PvXm+UhZwZbszwV+qy6SqBLsO6BNnK2nAIJWATUGdK OQD/F6vHPLSckfASvn7ihJGUt7HABWanYn9E3AD9F0h2Cgj2OfKQNhx6j9qsvCBetp5u BVHbb7mDeyuSmwqPjeql03Cl9CjTNds/mmJopbTUDbKhRRGV5RZBPwzX98YR5tDyhIik qofw== X-Gm-Message-State: ALoCoQmPx9mJmIA6YPtq+bRFilnbo/rymQ0kJmABDUgFnjlYjAF+sMWD8HHY/bkxdxlVqHubmg4J X-Received: by 10.181.13.202 with SMTP id fa10mr2860406wid.4.1436450159750; Thu, 09 Jul 2015 06:55:59 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.227 with SMTP id lf3ls1103604lab.93.gmail; Thu, 09 Jul 2015 06:55:59 -0700 (PDT) X-Received: by 10.112.171.68 with SMTP id as4mr15030012lbc.64.1436450159558; Thu, 09 Jul 2015 06:55:59 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id ev1si4900868lbc.0.2015.07.09.06.55.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 06:55:59 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbnk3 with SMTP id k3so75587542lbn.1 for ; Thu, 09 Jul 2015 06:55:59 -0700 (PDT) X-Received: by 10.112.166.106 with SMTP id zf10mr14967088lbb.36.1436450159388; Thu, 09 Jul 2015 06:55:59 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp685098lbb; Thu, 9 Jul 2015 06:55:57 -0700 (PDT) X-Received: by 10.140.82.72 with SMTP id g66mr24476345qgd.41.1436450156618; Thu, 09 Jul 2015 06:55:56 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 76si6680849qhb.19.2015.07.09.06.55.55; Thu, 09 Jul 2015 06:55:56 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id CE40361CF6; Thu, 9 Jul 2015 13:55:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id B9C5761FEE; Thu, 9 Jul 2015 13:48:41 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 2582561F9E; Thu, 9 Jul 2015 13:48:33 +0000 (UTC) Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by lists.linaro.org (Postfix) with ESMTPS id 1846E61F9E for ; Thu, 9 Jul 2015 13:46:50 +0000 (UTC) Received: by wicmv11 with SMTP id mv11so1739409wic.1 for ; Thu, 09 Jul 2015 06:46:49 -0700 (PDT) X-Received: by 10.194.238.193 with SMTP id vm1mr29992250wjc.57.1436449609324; Thu, 09 Jul 2015 06:46:49 -0700 (PDT) Received: from localhost.localdomain ([87.120.178.39]) by smtp.gmail.com with ESMTPSA id df1sm8414627wib.12.2015.07.09.06.46.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Jul 2015 06:46:48 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 9 Jul 2015 16:46:24 +0300 Message-Id: <1436449585-23252-11-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1436449585-23252-1-git-send-email-maxim.uvarov@linaro.org> References: <1436449585-23252-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 10/11] api: pool: remove shm paramter from odp_pool_create() X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: maxim.uvarov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Bill Fischofer This patch removes the 2nd parameter to odp_pool_create() because it has two major issues: 1. Applications have no way to know how big a shm area is required for a given pool since that information is implementation specific. So there's no portable means of using this parameter. 2. Some implementations (e.g., odp-dpdk) cannot accept an external memory area for pool creation since they need to control the memory themselves. Signed-off-by: Bill Fischofer Reviewed-by: Petri Savolainen Signed-off-by: Maxim Uvarov Conflicts: test/validation/pktio/pktio.c test/validation/pool/pool.c helper/test/odp_chksum.c --- example/classifier/odp_classifier.c | 2 +- example/generator/odp_generator.c | 4 +- example/ipsec/odp_ipsec.c | 8 ++-- example/packet/odp_pktio.c | 2 +- example/timer/odp_timer_test.c | 2 +- helper/test/odp_chksum.c | 2 +- include/odp/api/pool.h | 35 ++++---------- platform/linux-generic/odp_pool.c | 54 +++++----------------- platform/linux-generic/odp_schedule.c | 2 +- test/performance/odp_l2fwd.c | 2 +- test/performance/odp_pktio_perf.c | 5 +- test/performance/odp_scheduling.c | 2 +- test/validation/buffer/buffer.c | 6 +-- .../classification/odp_classification_tests.c | 3 +- test/validation/crypto/crypto.c | 2 +- test/validation/packet/packet.c | 4 +- test/validation/pktio/pktio.c | 5 +- test/validation/pool/pool.c | 32 +------------ test/validation/queue/queue.c | 2 +- test/validation/scheduler/scheduler.c | 4 +- test/validation/timer/timer.c | 8 ++-- 21 files changed, 54 insertions(+), 132 deletions(-) diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c index 7b1a1c4..409f016 100644 --- a/example/classifier/odp_classifier.c +++ b/example/classifier/odp_classifier.c @@ -432,7 +432,7 @@ int main(int argc, char *argv[]) params.pkt.num = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE; params.type = ODP_POOL_PACKET; - pool = odp_pool_create("packet_pool", ODP_SHM_NULL, ¶ms); + pool = odp_pool_create("packet_pool", ¶ms); if (pool == ODP_POOL_INVALID) { EXAMPLE_ERR("Error: packet pool create failed.\n"); diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 36219a0..b7ffa07 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -651,7 +651,7 @@ int main(int argc, char *argv[]) params.pkt.num = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE; params.type = ODP_POOL_PACKET; - pool = odp_pool_create("packet_pool", ODP_SHM_NULL, ¶ms); + pool = odp_pool_create("packet_pool", ¶ms); if (pool == ODP_POOL_INVALID) { EXAMPLE_ERR("Error: packet pool create failed.\n"); @@ -678,7 +678,7 @@ int main(int argc, char *argv[]) params.tmo.num = tparams.num_timers; /* One timeout per timer */ params.type = ODP_POOL_TIMEOUT; - tmop = odp_pool_create("timeout_pool", ODP_SHM_NULL, ¶ms); + tmop = odp_pool_create("timeout_pool", ¶ms); if (pool == ODP_POOL_INVALID) { EXAMPLE_ERR("Error: packet pool create failed.\n"); diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index 0206d93..04ae35e 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -354,7 +354,7 @@ void ipsec_init_pre(void) params.pkt.num = SHM_PKT_POOL_BUF_COUNT; params.type = ODP_POOL_PACKET; - out_pool = odp_pool_create("out_pool", ODP_SHM_NULL, ¶ms); + out_pool = odp_pool_create("out_pool", ¶ms); if (ODP_POOL_INVALID == out_pool) { EXAMPLE_ERR("Error: message pool create failed.\n"); @@ -1291,8 +1291,7 @@ main(int argc, char *argv[]) params.pkt.num = SHM_PKT_POOL_BUF_COUNT; params.type = ODP_POOL_PACKET; - pkt_pool = odp_pool_create("packet_pool", ODP_SHM_NULL, - ¶ms); + pkt_pool = odp_pool_create("packet_pool", ¶ms); if (ODP_POOL_INVALID == pkt_pool) { EXAMPLE_ERR("Error: packet pool create failed.\n"); @@ -1305,8 +1304,7 @@ main(int argc, char *argv[]) params.buf.num = SHM_CTX_POOL_BUF_COUNT; params.type = ODP_POOL_BUFFER; - ctx_pool = odp_pool_create("ctx_pool", ODP_SHM_NULL, - ¶ms); + ctx_pool = odp_pool_create("ctx_pool", ¶ms); if (ODP_POOL_INVALID == ctx_pool) { EXAMPLE_ERR("Error: context pool create failed.\n"); diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c index 865996c..b27865b 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -373,7 +373,7 @@ int main(int argc, char *argv[]) params.pkt.num = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE; params.type = ODP_POOL_PACKET; - pool = odp_pool_create("packet_pool", ODP_SHM_NULL, ¶ms); + pool = odp_pool_create("packet_pool", ¶ms); if (pool == ODP_POOL_INVALID) { EXAMPLE_ERR("Error: packet pool create failed.\n"); diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index f7b1a3f..da7b208 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -415,7 +415,7 @@ int main(int argc, char *argv[]) params.tmo.num = NUM_TMOS; params.type = ODP_POOL_TIMEOUT; - gbls->pool = odp_pool_create("msg_pool", ODP_SHM_NULL, ¶ms); + gbls->pool = odp_pool_create("msg_pool", ¶ms); if (gbls->pool == ODP_POOL_INVALID) { EXAMPLE_ERR("Pool create failed.\n"); diff --git a/helper/test/odp_chksum.c b/helper/test/odp_chksum.c index 830ffe8..dfd578f 100644 --- a/helper/test/odp_chksum.c +++ b/helper/test/odp_chksum.c @@ -131,7 +131,7 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) exit(EXIT_FAILURE); } - packet_pool = odp_pool_create("packet_pool", ODP_SHM_INVALID, ¶ms); + packet_pool = odp_pool_create("packet_pool", ¶ms); if (packet_pool == ODP_POOL_INVALID) return -1; diff --git a/include/odp/api/pool.h b/include/odp/api/pool.h index e5061ab..c679781 100644 --- a/include/odp/api/pool.h +++ b/include/odp/api/pool.h @@ -99,28 +99,22 @@ typedef struct odp_pool_param_t { /** * Create a pool - * This routine is used to create a pool. It take three - * arguments: the optional name of the pool to be created, an optional shared - * memory handle, and a parameter struct that describes the pool to be - * created. If a name is not specified the result is an anonymous pool that - * cannot be referenced by odp_pool_lookup(). + * + * This routine is used to create a pool. It take two arguments: the optional + * name of the pool to be created and a parameter struct that describes the + * pool to be created. If a name is not specified the result is an anonymous + * pool that cannot be referenced by odp_pool_lookup(). * * @param name Name of the pool, max ODP_POOL_NAME_LEN-1 chars. * May be specified as NULL for anonymous pools. * - * @param shm The shared memory object in which to create the pool. - * Use ODP_SHM_NULL to reserve default memory type - * for the pool type. - * * @param params Pool parameters. * * @return Handle of the created pool * @retval ODP_POOL_INVALID Pool could not be created */ -odp_pool_t odp_pool_create(const char *name, - odp_shm_t shm, - odp_pool_param_t *params); +odp_pool_t odp_pool_create(const char *name, odp_pool_param_t *params); /** * Destroy a pool previously created by odp_pool_create() @@ -130,14 +124,10 @@ odp_pool_t odp_pool_create(const char *name, * @retval 0 Success * @retval -1 Failure * - * @note This routine destroys a previously created pool. This call - * does not destroy any shared memory object passed to - * odp_pool_create() used to store the pool contents. The caller - * takes responsibility for that. If no shared memory object was passed as - * part of the create call, then this routine will destroy any internal shared - * memory objects associated with the pool. Results are undefined if - * an attempt is made to destroy a pool that contains allocated or - * otherwise active buffers. + * @note This routine destroys a previously created pool, and will destroy any + * internal shared memory objects associated with the pool. Results are + * undefined if an attempt is made to destroy a pool that contains allocated + * or otherwise active buffers. */ int odp_pool_destroy(odp_pool_t pool); @@ -160,11 +150,6 @@ odp_pool_t odp_pool_lookup(const char *name); */ typedef struct odp_pool_info_t { const char *name; /**< pool name */ - odp_shm_t shm; /**< handle of shared memory area - supplied by application to - contain pool, or - ODP_SHM_INVALID if this pool is - managed by ODP */ odp_pool_param_t params; /**< pool parameters */ } odp_pool_info_t; diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index dcbdf07..26ee06f 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -144,13 +144,12 @@ int odp_pool_term_local(void) * Pool creation */ -odp_pool_t odp_pool_create(const char *name, - odp_shm_t shm, - odp_pool_param_t *params) +odp_pool_t odp_pool_create(const char *name, odp_pool_param_t *params) { odp_pool_t pool_hdl = ODP_POOL_INVALID; pool_entry_t *pool; uint32_t i, headroom = 0, tailroom = 0; + odp_shm_t shm; if (params == NULL) return ODP_POOL_INVALID; @@ -289,38 +288,14 @@ odp_pool_t odp_pool_create(const char *name, mdata_size + udata_size); - if (shm == ODP_SHM_NULL) { - shm = odp_shm_reserve(pool->s.name, - pool->s.pool_size, - ODP_PAGE_SIZE, 0); - if (shm == ODP_SHM_INVALID) { - POOL_UNLOCK(&pool->s.lock); - return ODP_POOL_INVALID; - } - pool->s.pool_base_addr = odp_shm_addr(shm); - } else { - odp_shm_info_t info; - if (odp_shm_info(shm, &info) != 0 || - info.size < pool->s.pool_size) { - POOL_UNLOCK(&pool->s.lock); - return ODP_POOL_INVALID; - } - pool->s.pool_base_addr = odp_shm_addr(shm); - void *page_addr = - ODP_ALIGN_ROUNDUP_PTR(pool->s.pool_base_addr, - ODP_PAGE_SIZE); - if (pool->s.pool_base_addr != page_addr) { - if (info.size < pool->s.pool_size + - ((size_t)page_addr - - (size_t)pool->s.pool_base_addr)) { - POOL_UNLOCK(&pool->s.lock); - return ODP_POOL_INVALID; - } - pool->s.pool_base_addr = page_addr; - } - pool->s.flags.user_supplied_shm = 1; + shm = odp_shm_reserve(pool->s.name, + pool->s.pool_size, + ODP_PAGE_SIZE, 0); + if (shm == ODP_SHM_INVALID) { + POOL_UNLOCK(&pool->s.lock); + return ODP_POOL_INVALID; } - + pool->s.pool_base_addr = odp_shm_addr(shm); pool->s.pool_shm = shm; /* Now safe to unlock since pool entry has been allocated */ @@ -458,8 +433,6 @@ int odp_pool_info(odp_pool_t pool_hdl, odp_pool_info_t *info) return -1; info->name = pool->s.name; - info->shm = pool->s.flags.user_supplied_shm ? - pool->s.pool_shm : ODP_SHM_INVALID; info->params = pool->s.params; return 0; @@ -491,9 +464,7 @@ int odp_pool_destroy(odp_pool_t pool_hdl) return -1; } - if (!pool->s.flags.user_supplied_shm) - odp_shm_free(pool->s.pool_shm); - + odp_shm_free(pool->s.pool_shm); pool->s.pool_shm = ODP_SHM_INVALID; POOL_UNLOCK(&pool->s.lock); @@ -608,9 +579,8 @@ void odp_pool_print(odp_pool_t pool_hdl) (pool->s.params.type == ODP_POOL_PACKET ? "packet" : (pool->s.params.type == ODP_POOL_TIMEOUT ? "timeout" : "unknown"))); - ODP_DBG(" pool storage %sODP managed\n", - pool->s.flags.user_supplied_shm ? - "application provided, " : ""); + ODP_DBG(" pool storage ODP managed shm handle %" PRIu64 "\n", + odp_shm_to_u64(pool->s.pool_shm)); ODP_DBG(" pool status %s\n", pool->s.quiesced ? "quiesced" : "active"); ODP_DBG(" pool opts %s, %s, %s\n", diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index 087ee67..e1b91d3 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -128,7 +128,7 @@ int odp_schedule_init_global(void) params.buf.num = NUM_SCHED_CMD; params.type = ODP_POOL_BUFFER; - pool = odp_pool_create("odp_sched_pool", ODP_SHM_NULL, ¶ms); + pool = odp_pool_create("odp_sched_pool", ¶ms); if (pool == ODP_POOL_INVALID) { ODP_ERR("Schedule init: Pool create failed.\n"); diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c index f1a5683..fa37156 100644 --- a/test/performance/odp_l2fwd.c +++ b/test/performance/odp_l2fwd.c @@ -420,7 +420,7 @@ int main(int argc, char *argv[]) params.pkt.num = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE; params.type = ODP_POOL_PACKET; - pool = odp_pool_create("packet pool", ODP_SHM_NULL, ¶ms); + pool = odp_pool_create("packet pool", ¶ms); if (pool == ODP_POOL_INVALID) { LOG_ERR("Error: packet pool create failed.\n"); diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c index 77cb88c..53a4481 100644 --- a/test/performance/odp_pktio_perf.c +++ b/test/performance/odp_pktio_perf.c @@ -681,7 +681,7 @@ static odp_pktio_t create_pktio(const char *iface) params.type = ODP_POOL_PACKET; snprintf(pool_name, sizeof(pool_name), "pkt_pool_%s", iface); - pool = odp_pool_create(pool_name, ODP_SHM_NULL, ¶ms); + pool = odp_pool_create(pool_name, ¶ms); if (pool == ODP_POOL_INVALID) return ODP_PKTIO_INVALID; @@ -703,8 +703,7 @@ static int test_init(void) params.pkt.num = PKT_BUF_NUM; params.type = ODP_POOL_PACKET; - transmit_pkt_pool = odp_pool_create("pkt_pool_transmit", - ODP_SHM_NULL, ¶ms); + transmit_pkt_pool = odp_pool_create("pkt_pool_transmit", ¶ms); if (transmit_pkt_pool == ODP_POOL_INVALID) LOG_ABORT("Failed to create transmit pool\n"); diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c index f3a4f93..1fbeb94 100644 --- a/test/performance/odp_scheduling.c +++ b/test/performance/odp_scheduling.c @@ -913,7 +913,7 @@ int main(int argc, char *argv[]) params.buf.num = MSG_POOL_SIZE/sizeof(test_message_t); params.type = ODP_POOL_BUFFER; - pool = odp_pool_create("msg_pool", ODP_SHM_NULL, ¶ms); + pool = odp_pool_create("msg_pool", ¶ms); if (pool == ODP_POOL_INVALID) { LOG_ERR("Pool create failed.\n"); diff --git a/test/validation/buffer/buffer.c b/test/validation/buffer/buffer.c index d0fd510..f67c55f 100644 --- a/test/validation/buffer/buffer.c +++ b/test/validation/buffer/buffer.c @@ -26,7 +26,7 @@ static int buffer_suite_init(void) .type = ODP_POOL_BUFFER, }; - raw_pool = odp_pool_create("raw_pool", ODP_SHM_INVALID, ¶ms); + raw_pool = odp_pool_create("raw_pool", ¶ms); if (raw_pool == ODP_POOL_INVALID) return -1; raw_buffer = odp_buffer_alloc(raw_pool); @@ -61,7 +61,7 @@ static void buffer_test_pool_alloc(void) .type = ODP_POOL_BUFFER, }; - pool = odp_pool_create("buffer_pool_alloc", ODP_SHM_INVALID, ¶ms); + pool = odp_pool_create("buffer_pool_alloc", ¶ms); odp_pool_print(pool); /* Try to allocate num items from the pool */ @@ -108,7 +108,7 @@ static void buffer_test_pool_free(void) .type = ODP_POOL_BUFFER, }; - pool = odp_pool_create("buffer_pool_free", ODP_SHM_INVALID, ¶ms); + pool = odp_pool_create("buffer_pool_free", ¶ms); /* Allocate the only buffer from the pool */ buffer = odp_buffer_alloc(pool); diff --git a/test/validation/classification/odp_classification_tests.c b/test/validation/classification/odp_classification_tests.c index 502105e..1268ddc 100644 --- a/test/validation/classification/odp_classification_tests.c +++ b/test/validation/classification/odp_classification_tests.c @@ -283,8 +283,7 @@ int classification_suite_init(void) param.pkt.num = SHM_PKT_NUM_BUFS; param.type = ODP_POOL_PACKET; - pool = odp_pool_create("classification_pool", - ODP_SHM_NULL, ¶m); + pool = odp_pool_create("classification_pool", ¶m); if (ODP_POOL_INVALID == pool) { fprintf(stderr, "Packet pool creation failed.\n"); return -1; diff --git a/test/validation/crypto/crypto.c b/test/validation/crypto/crypto.c index 9d8a02b..395fda3 100644 --- a/test/validation/crypto/crypto.c +++ b/test/validation/crypto/crypto.c @@ -44,7 +44,7 @@ int tests_global_init(void) params.pkt.num = SHM_PKT_POOL_SIZE / SHM_PKT_POOL_BUF_SIZE; params.type = ODP_POOL_PACKET; - pool = odp_pool_create("packet_pool", ODP_SHM_NULL, ¶ms); + pool = odp_pool_create("packet_pool", ¶ms); if (ODP_POOL_INVALID == pool) { fprintf(stderr, "Packet pool creation failed.\n"); diff --git a/test/validation/packet/packet.c b/test/validation/packet/packet.c index 0bd1666..e6fb18a 100644 --- a/test/validation/packet/packet.c +++ b/test/validation/packet/packet.c @@ -53,7 +53,7 @@ static int packet_suite_init(void) struct udata_struct *udat; uint32_t udat_size; - packet_pool = odp_pool_create("packet_pool", ODP_SHM_INVALID, ¶ms); + packet_pool = odp_pool_create("packet_pool", ¶ms); if (packet_pool == ODP_POOL_INVALID) return -1; @@ -103,7 +103,7 @@ static void packet_test_alloc_free(void) .type = ODP_POOL_PACKET, }; - pool = odp_pool_create("packet_pool_alloc", ODP_SHM_INVALID, ¶ms); + pool = odp_pool_create("packet_pool_alloc", ¶ms); /* Allocate the only buffer from the pool */ packet = odp_packet_alloc(pool, packet_len); diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c index 82ced5c..79c6427 100644 --- a/test/validation/pktio/pktio.c +++ b/test/validation/pktio/pktio.c @@ -213,8 +213,7 @@ static int default_pool_create(void) params.pkt.num = PKT_BUF_NUM; params.type = ODP_POOL_PACKET; - default_pkt_pool = odp_pool_create("pkt_pool_default", - ODP_SHM_NULL, ¶ms); + default_pkt_pool = odp_pool_create("pkt_pool_default", ¶ms); if (default_pkt_pool == ODP_POOL_INVALID) return -1; @@ -614,7 +613,7 @@ static int create_pool(const char *iface, int num) snprintf(pool_name, sizeof(pool_name), "pkt_pool_%s", iface); - pool[num] = odp_pool_create(pool_name, ODP_SHM_NULL, ¶ms); + pool[num] = odp_pool_create(pool_name, ¶ms); if (ODP_POOL_INVALID == pool[num]) { CU_FAIL("unable to create pool"); return -1; diff --git a/test/validation/pool/pool.c b/test/validation/pool/pool.c index 1b54033..a888b68 100644 --- a/test/validation/pool/pool.c +++ b/test/validation/pool/pool.c @@ -20,7 +20,7 @@ static void pool_create_destroy(odp_pool_param_t *params) snprintf(pool_name, sizeof(pool_name), "test_pool-%d", pool_name_number++); - pool = odp_pool_create(pool_name, ODP_SHM_INVALID, params); + pool = odp_pool_create(pool_name, params); CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); CU_ASSERT(odp_pool_to_u64(pool) != odp_pool_to_u64(ODP_POOL_INVALID)); @@ -67,32 +67,6 @@ static void pool_test_create_destroy_timeout(void) pool_create_destroy(¶ms); } -static void pool_test_create_destroy_buffer_shm(void) -{ - odp_pool_t pool; - odp_shm_t test_shm; - odp_pool_param_t params = { - .buf = { - .size = 1500, - .align = ODP_CACHE_LINE_SIZE, - .num = 10, - }, - .type = ODP_POOL_BUFFER, - }; - - test_shm = odp_shm_reserve("test_shm", - params.buf.size * params.buf.num * 2, - ODP_CACHE_LINE_SIZE, - 0); - CU_ASSERT_FATAL(test_shm != ODP_SHM_INVALID); - - pool = odp_pool_create("test_shm_pool", test_shm, ¶ms); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - CU_ASSERT(odp_pool_destroy(pool) == 0); - CU_ASSERT(odp_shm_free(test_shm) == 0); -} - static void pool_test_lookup_info_print(void) { odp_pool_t pool; @@ -107,7 +81,7 @@ static void pool_test_lookup_info_print(void) .type = ODP_POOL_BUFFER, }; - pool = odp_pool_create(pool_name, ODP_SHM_INVALID, ¶ms); + pool = odp_pool_create(pool_name, ¶ms); CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); pool = odp_pool_lookup(pool_name); @@ -115,7 +89,6 @@ static void pool_test_lookup_info_print(void) CU_ASSERT_FATAL(odp_pool_info(pool, &info) == 0); CU_ASSERT(strncmp(pool_name, info.name, sizeof(pool_name)) == 0); - CU_ASSERT(info.shm == ODP_SHM_INVALID); CU_ASSERT(params.buf.size <= info.params.buf.size); CU_ASSERT(params.buf.align <= info.params.buf.align); CU_ASSERT(params.buf.num <= info.params.buf.num); @@ -132,7 +105,6 @@ static CU_TestInfo pool_suite[] = { _CU_TEST_INFO(pool_test_create_destroy_buffer), _CU_TEST_INFO(pool_test_create_destroy_packet), _CU_TEST_INFO(pool_test_create_destroy_timeout), - _CU_TEST_INFO(pool_test_create_destroy_buffer_shm), _CU_TEST_INFO(pool_test_lookup_info_print), CU_TEST_INFO_NULL, }; diff --git a/test/validation/queue/queue.c b/test/validation/queue/queue.c index f686b71..ea8cc5c 100644 --- a/test/validation/queue/queue.c +++ b/test/validation/queue/queue.c @@ -24,7 +24,7 @@ static int queue_suite_init(void) params.buf.num = 1024 * 10; params.type = ODP_POOL_BUFFER; - pool = odp_pool_create("msg_pool", ODP_SHM_NULL, ¶ms); + pool = odp_pool_create("msg_pool", ¶ms); if (ODP_POOL_INVALID == pool) { printf("Pool create failed.\n"); diff --git a/test/validation/scheduler/scheduler.c b/test/validation/scheduler/scheduler.c index e03af13..0440093 100644 --- a/test/validation/scheduler/scheduler.c +++ b/test/validation/scheduler/scheduler.c @@ -120,7 +120,7 @@ static void scheduler_test_queue_destroy(void) params.buf.num = 1; params.type = ODP_POOL_BUFFER; - p = odp_pool_create("sched_destroy_pool", ODP_SHM_NULL, ¶ms); + p = odp_pool_create("sched_destroy_pool", ¶ms); CU_ASSERT_FATAL(p != ODP_POOL_INVALID); @@ -676,7 +676,7 @@ static int scheduler_suite_init(void) params.buf.num = MSG_POOL_SIZE / BUF_SIZE; params.type = ODP_POOL_BUFFER; - pool = odp_pool_create(MSG_POOL_NAME, ODP_SHM_NULL, ¶ms); + pool = odp_pool_create(MSG_POOL_NAME, ¶ms); if (pool == ODP_POOL_INVALID) { printf("Pool creation failed (msg).\n"); diff --git a/test/validation/timer/timer.c b/test/validation/timer/timer.c index 492d52f..ecca785 100644 --- a/test/validation/timer/timer.c +++ b/test/validation/timer/timer.c @@ -65,7 +65,7 @@ static void timer_test_timeout_pool_alloc(void) .type = ODP_POOL_TIMEOUT, }; - pool = odp_pool_create("timeout_pool_alloc", ODP_SHM_NULL, ¶ms); + pool = odp_pool_create("timeout_pool_alloc", ¶ms); odp_pool_print(pool); /* Try to allocate num items from the pool */ @@ -105,7 +105,7 @@ static void timer_test_timeout_pool_free(void) .type = ODP_POOL_TIMEOUT, }; - pool = odp_pool_create("timeout_pool_free", ODP_SHM_NULL, ¶ms); + pool = odp_pool_create("timeout_pool_free", ¶ms); odp_pool_print(pool); /* Allocate the only timeout from the pool */ @@ -140,7 +140,7 @@ static void timer_test_odp_timer_cancel(void) params.tmo.num = 1; params.type = ODP_POOL_TIMEOUT; - pool = odp_pool_create("tmo_pool_for_cancel", ODP_SHM_NULL, ¶ms); + pool = odp_pool_create("tmo_pool_for_cancel", ¶ms); if (pool == ODP_POOL_INVALID) CU_FAIL_FATAL("Timeout pool create failed"); @@ -452,7 +452,7 @@ static void timer_test_odp_timer_all(void) /* Create timeout pools */ params.tmo.num = (NTIMERS + 1) * num_workers; params.type = ODP_POOL_TIMEOUT; - tbp = odp_pool_create("tmo_pool", ODP_SHM_NULL, ¶ms); + tbp = odp_pool_create("tmo_pool", ¶ms); if (tbp == ODP_POOL_INVALID) CU_FAIL_FATAL("Timeout pool create failed");