From patchwork Mon Sep 1 11:53:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 36350 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E318320792 for ; Mon, 1 Sep 2014 11:52:26 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id hq11sf16801528vcb.7 for ; Mon, 01 Sep 2014 04:52:26 -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: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:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=9vbCo/IDo0GERq+W0h6epIV8epaxRIBF1t4Rbb5mPvk=; b=Hiqdi4h9wbNbmVNJi9A+2sk/GAG975z+wOd9VUIIPch4qfDld24JosfWswHtOpe4LJ Nhs21KfJjFKFzK9V5JUnE1CdRDHMKjVFubbcp+0V7P3IoFkDqbbNqu2SR7Bp/NHvl2Us 1iwOK40636zXRowJ7MEPD633MIpG1YbFnmujlVwZHEqN5x6Rn35L9UEnO6O6wWTWQQEp GF1nV+t+L1uLcXhYpZDL8Dziwv5Xsj5dvcAx+RArq4huQNlxD++8TJYbXcH6gVdAZrpj BqcBGJvavsnFpPUxltGBEuiIT6ToxIJMoGDh2zRD1nj58TLBq1R2Gm1/fMJDccxWFYjk s88A== X-Gm-Message-State: ALoCoQnmYwOOupxQBfRxUngmYehcsYvaUZ66FuR8JPfscSdnARpyaCXBH8yQ7m0Jn0IovPA5pQqp X-Received: by 10.236.230.106 with SMTP id i100mr13421725yhq.27.1409572346718; Mon, 01 Sep 2014 04:52:26 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.90.17 with SMTP id w17ls1951030qgd.70.gmail; Mon, 01 Sep 2014 04:52:26 -0700 (PDT) X-Received: by 10.221.21.201 with SMTP id qt9mr112223vcb.39.1409572346653; Mon, 01 Sep 2014 04:52:26 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id f2si199912vdf.74.2014.09.01.04.52.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Sep 2014 04:52:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hy4so5341879vcb.38 for ; Mon, 01 Sep 2014 04:52:26 -0700 (PDT) X-Received: by 10.52.141.76 with SMTP id rm12mr67425vdb.71.1409572346546; Mon, 01 Sep 2014 04:52:26 -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.221.45.67 with SMTP id uj3csp375778vcb; Mon, 1 Sep 2014 04:52:26 -0700 (PDT) X-Received: by 10.140.87.5 with SMTP id q5mr42237459qgd.94.1409572345951; Mon, 01 Sep 2014 04:52:25 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id 45si628310qgj.47.2014.09.01.04.52.25 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 01 Sep 2014 04:52:25 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XOQ9n-00045Z-3M; Mon, 01 Sep 2014 11:52:23 +0000 Received: from mail-qa0-f45.google.com ([209.85.216.45]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XOQ9e-0003yO-8r for lng-odp@lists.linaro.org; Mon, 01 Sep 2014 11:52:14 +0000 Received: by mail-qa0-f45.google.com with SMTP id f12so4791576qad.4 for ; Mon, 01 Sep 2014 04:52:09 -0700 (PDT) X-Received: by 10.224.137.65 with SMTP id v1mr43770683qat.53.1409572329039; Mon, 01 Sep 2014 04:52:09 -0700 (PDT) Received: from localhost.localdomain (ec2-23-23-178-99.compute-1.amazonaws.com. [23.23.178.99]) by mx.google.com with ESMTPSA id b8sm1538663qat.21.2014.09.01.04.52.06 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Sep 2014 04:52:07 -0700 (PDT) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Mon, 1 Sep 2014 14:53:05 +0300 Message-Id: <1409572385-6169-2-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1409572385-6169-1-git-send-email-petri.savolainen@linaro.org> References: <1409572385-6169-1-git-send-email-petri.savolainen@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 2/2] Shared memory flag default value X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 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-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: petri.savolainen@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.220.179 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 Flags default value is zero (share memory within ODP, include HW accelerators). Signed-off-by: Petri Savolainen --- example/generator/odp_generator.c | 5 +++-- example/l2fwd/odp_l2fwd.c | 5 +++-- example/odp_example/odp_example.c | 2 +- example/packet/odp_pktio.c | 5 +++-- example/timer/odp_timer_test.c | 2 +- platform/linux-generic/odp_buffer_pool.c | 2 +- platform/linux-generic/odp_crypto.c | 3 ++- platform/linux-generic/odp_packet_io.c | 2 +- platform/linux-generic/odp_queue.c | 2 +- platform/linux-generic/odp_ring.c | 2 +- platform/linux-generic/odp_schedule.c | 10 +++++++--- test/api_test/odp_shm_test.c | 2 +- test/api_test/odp_timer_ping.c | 2 +- 13 files changed, 26 insertions(+), 18 deletions(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 9fa9b37..39e3fcc 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -537,7 +537,8 @@ int main(int argc, char *argv[]) odp_atomic_init_u64(&counters.icmp); /* Reserve memory for args from shared mem */ - args = odp_shm_reserve("shm_args", sizeof(args_t), ODP_CACHE_LINE_SIZE); + args = odp_shm_reserve("shm_args", sizeof(args_t), + ODP_CACHE_LINE_SIZE, 0); if (args == NULL) { ODP_ERR("Error: shared mem alloc failed.\n"); exit(EXIT_FAILURE); @@ -582,7 +583,7 @@ int main(int argc, char *argv[]) /* Create packet pool */ pool_base = odp_shm_reserve("shm_packet_pool", - SHM_PKT_POOL_SIZE, ODP_CACHE_LINE_SIZE); + SHM_PKT_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0); if (pool_base == NULL) { ODP_ERR("Error: packet pool mem alloc failed.\n"); exit(EXIT_FAILURE); diff --git a/example/l2fwd/odp_l2fwd.c b/example/l2fwd/odp_l2fwd.c index d74449a..230c4ff 100644 --- a/example/l2fwd/odp_l2fwd.c +++ b/example/l2fwd/odp_l2fwd.c @@ -329,7 +329,8 @@ int main(int argc, char *argv[]) } /* Reserve memory for args from shared mem */ - gbl_args = odp_shm_reserve("shm_args", sizeof(args_t), ODP_CACHE_LINE_SIZE); + gbl_args = odp_shm_reserve("shm_args", sizeof(args_t), + ODP_CACHE_LINE_SIZE, 0); if (gbl_args == NULL) { ODP_ERR("Error: shared mem alloc failed.\n"); exit(EXIT_FAILURE); @@ -380,7 +381,7 @@ int main(int argc, char *argv[]) /* Create packet pool */ pool_base = odp_shm_reserve("shm_packet_pool", - SHM_PKT_POOL_SIZE, ODP_CACHE_LINE_SIZE); + SHM_PKT_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0); if (pool_base == NULL) { ODP_ERR("Error: packet pool mem alloc failed.\n"); exit(EXIT_FAILURE); diff --git a/example/odp_example/odp_example.c b/example/odp_example/odp_example.c index f0bdf29..fa599f2 100644 --- a/example/odp_example/odp_example.c +++ b/example/odp_example/odp_example.c @@ -1004,7 +1004,7 @@ int main(int argc, char *argv[]) * Create message pool */ pool_base = odp_shm_reserve("msg_pool", - MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE); + MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0); pool = odp_buffer_pool_create("msg_pool", pool_base, MSG_POOL_SIZE, sizeof(test_message_t), diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c index f247bd0..e019f18 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -317,7 +317,8 @@ int main(int argc, char *argv[]) } /* Reserve memory for args from shared mem */ - args = odp_shm_reserve("shm_args", sizeof(args_t), ODP_CACHE_LINE_SIZE); + args = odp_shm_reserve("shm_args", sizeof(args_t), + ODP_CACHE_LINE_SIZE, 0); if (args == NULL) { ODP_ERR("Error: shared mem alloc failed.\n"); exit(EXIT_FAILURE); @@ -358,7 +359,7 @@ int main(int argc, char *argv[]) /* Create packet pool */ pool_base = odp_shm_reserve("shm_packet_pool", - SHM_PKT_POOL_SIZE, ODP_CACHE_LINE_SIZE); + SHM_PKT_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0); if (pool_base == NULL) { ODP_ERR("Error: packet pool mem alloc failed.\n"); exit(EXIT_FAILURE); diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index bf1d7df..f97c2ec 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -315,7 +315,7 @@ int main(int argc, char *argv[]) * Create message pool */ pool_base = odp_shm_reserve("msg_pool", - MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE); + MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0); pool = odp_buffer_pool_create("msg_pool", pool_base, MSG_POOL_SIZE, 0, diff --git a/platform/linux-generic/odp_buffer_pool.c b/platform/linux-generic/odp_buffer_pool.c index e538f04..f54a0c4 100644 --- a/platform/linux-generic/odp_buffer_pool.c +++ b/platform/linux-generic/odp_buffer_pool.c @@ -117,7 +117,7 @@ int odp_buffer_pool_init_global(void) pool_tbl = odp_shm_reserve("odp_buffer_pools", sizeof(pool_table_t), - sizeof(pool_entry_t)); + sizeof(pool_entry_t), 0); if (pool_tbl == NULL) return -1; diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index bdd4694..0a6b1fd 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -409,7 +409,8 @@ odp_crypto_init_global(void) mem_size += (MAX_SESSIONS * sizeof(odp_crypto_generic_session_t)); /* Allocate our globally shared memory */ - global = odp_shm_reserve("crypto_pool", mem_size, ODP_CACHE_LINE_SIZE); + global = odp_shm_reserve("crypto_pool", mem_size, + ODP_CACHE_LINE_SIZE, 0); /* Clear it out */ memset(global, 0, mem_size); diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 33ade10..944c1d4 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -55,7 +55,7 @@ int odp_pktio_init_global(void) pktio_tbl = odp_shm_reserve("odp_pktio_entries", sizeof(pktio_table_t), - sizeof(pktio_entry_t)); + sizeof(pktio_entry_t), 0); if (pktio_tbl == NULL) return -1; diff --git a/platform/linux-generic/odp_queue.c b/platform/linux-generic/odp_queue.c index c637bdf..9852598 100644 --- a/platform/linux-generic/odp_queue.c +++ b/platform/linux-generic/odp_queue.c @@ -99,7 +99,7 @@ int odp_queue_init_global(void) queue_tbl = odp_shm_reserve("odp_queues", sizeof(queue_table_t), - sizeof(queue_entry_t)); + sizeof(queue_entry_t), 0); if (queue_tbl == NULL) return -1; diff --git a/platform/linux-generic/odp_ring.c b/platform/linux-generic/odp_ring.c index 25ff66a..733f941 100644 --- a/platform/linux-generic/odp_ring.c +++ b/platform/linux-generic/odp_ring.c @@ -171,7 +171,7 @@ odp_ring_create(const char *name, unsigned count, unsigned flags) odp_rwlock_write_lock(&qlock); /* reserve a memory zone for this ring.*/ - r = odp_shm_reserve(ring_name, ring_size, ODP_CACHE_LINE_SIZE); + r = odp_shm_reserve(ring_name, ring_size, ODP_CACHE_LINE_SIZE, 0); if (r != NULL) { /* init the ring structure */ diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index 9e399f1..16ae4af 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -89,16 +89,20 @@ int odp_schedule_init_global(void) sched = odp_shm_reserve("odp_scheduler", sizeof(sched_t), - ODP_CACHE_LINE_SIZE); + ODP_CACHE_LINE_SIZE, 0); if (sched == NULL) { ODP_ERR("Schedule init: Shm reserve failed.\n"); return -1; } - pool_base = odp_shm_reserve("odp_sched_pool", - SCHED_POOL_SIZE, ODP_CACHE_LINE_SIZE); + SCHED_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0); + + if (pool_base == NULL) { + ODP_ERR("Schedule init: Shm reserve failed.\n"); + return -1; + } pool = odp_buffer_pool_create("odp_sched_pool", pool_base, SCHED_POOL_SIZE, sizeof(queue_desc_t), diff --git a/test/api_test/odp_shm_test.c b/test/api_test/odp_shm_test.c index 318d662..376b06f 100644 --- a/test/api_test/odp_shm_test.c +++ b/test/api_test/odp_shm_test.c @@ -47,7 +47,7 @@ int main(int argc ODP_UNUSED, char *argv[] ODP_UNUSED) odp_print_system_info(); test_shared_data = odp_shm_reserve("test_shared_data", - sizeof(test_shared_data_t), 128); + sizeof(test_shared_data_t), 128, 0); memset(test_shared_data, 0, sizeof(test_shared_data_t)); printf("test shared data at %p\n\n", test_shared_data); diff --git a/test/api_test/odp_timer_ping.c b/test/api_test/odp_timer_ping.c index c1cc255..d9127c4 100644 --- a/test/api_test/odp_timer_ping.c +++ b/test/api_test/odp_timer_ping.c @@ -328,7 +328,7 @@ int main(int argc ODP_UNUSED, char *argv[] ODP_UNUSED) * Create message pool */ pool_base = odp_shm_reserve("msg_pool", - MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE); + MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0); pool = odp_buffer_pool_create("msg_pool", pool_base, MSG_POOL_SIZE, BUF_SIZE,