From patchwork Mon Jun 1 10:41:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 49291 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5C01021580 for ; Mon, 1 Jun 2015 10:43:24 +0000 (UTC) Received: by lbbqq2 with SMTP id qq2sf33428618lbb.0 for ; Mon, 01 Jun 2015 03:43:23 -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=Bp8bVMmwYhkBnI67pBfVPTgjYJnkuOy204GVywpUN4M=; b=GH4nFheG1x9xsRzzN4W4mChruDT2nAAPAYFYNBhleJ9wMnLfYg7/RYMnsbBXyOjtpY lXKeD29U5ww57qhLyS4BXD48Ysbm9DcyQXO4UiGd/93i20KLUZWBSOY3zgdxysHVTn0M mlNrEmXpGJDLO3S8vigJ5y/5ROYfnBVqGlphiupJcg1nH9k82uH1U0WtmqD8RplnkVae Bw12qnNyPSvkrGQV9dkE8IoKZ/+v5FVjESiEeBxunX4L1HhDSel3Sfi2e4JpLKZ1zt9n /6SKGnBbVYOvr1o1vTCCum7lzrx/fwcfkq0BCjOnkpTUv/FZF1BBI2ertZjjsfHS7K3u U2jA== X-Gm-Message-State: ALoCoQmiv9C5j4Q7MsE/rqR+ioffkWTx1NCBs7IFXJWkuTeqbMWrj3LpsaY0Z8VjZmNwQ8IoVBWU X-Received: by 10.112.28.111 with SMTP id a15mr20110290lbh.21.1433155403240; Mon, 01 Jun 2015 03:43:23 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.195 with SMTP id g3ls634216lam.0.gmail; Mon, 01 Jun 2015 03:43:22 -0700 (PDT) X-Received: by 10.152.42.200 with SMTP id q8mr9178582lal.53.1433155402895; Mon, 01 Jun 2015 03:43:22 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id l1si11955960lbj.175.2015.06.01.03.43.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Jun 2015 03:43:22 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by laew7 with SMTP id w7so6022240lae.1 for ; Mon, 01 Jun 2015 03:43:22 -0700 (PDT) X-Received: by 10.112.97.194 with SMTP id ec2mr3984412lbb.88.1433155402613; Mon, 01 Jun 2015 03:43:22 -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 hn6csp2216860lbb; Mon, 1 Jun 2015 03:43:21 -0700 (PDT) X-Received: by 10.55.15.209 with SMTP id 78mr37358452qkp.53.1433155401382; Mon, 01 Jun 2015 03:43:21 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 11si12697816qkr.34.2015.06.01.03.43.20; Mon, 01 Jun 2015 03:43:21 -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 03ADE61D39; Mon, 1 Jun 2015 10:43:20 +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 BCD4E61D17; Mon, 1 Jun 2015 10:42:31 +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 17E9861D15; Mon, 1 Jun 2015 10:42:27 +0000 (UTC) Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by lists.linaro.org (Postfix) with ESMTPS id C0D5461CE5 for ; Mon, 1 Jun 2015 10:41:58 +0000 (UTC) Received: by wicmx19 with SMTP id mx19so71157568wic.0 for ; Mon, 01 Jun 2015 03:41:57 -0700 (PDT) X-Received: by 10.194.83.39 with SMTP id n7mr38675605wjy.65.1433155317618; Mon, 01 Jun 2015 03:41:57 -0700 (PDT) Received: from localhost.localdomain ([87.120.178.39]) by mx.google.com with ESMTPSA id fb3sm16014528wib.21.2015.06.01.03.41.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Jun 2015 03:41:56 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Mon, 1 Jun 2015 13:41:42 +0300 Message-Id: <1433155304-24149-4-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1433155304-24149-1-git-send-email-maxim.uvarov@linaro.org> References: <1433155304-24149-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv7 3/5] linux-generic: create internal pool create function with shm flags 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.215.53 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 On init odp creates odp_sched_pool. We can not modify API to add new parameter to odp_pool_param_t and this pool should not be shared between different processes. To do that implemented internal linux-generic function with parameters to created shm. Note: create shm before and then provide it to the pool does not work because shm argument likely will be dropped from odp_pool_create() (patch already posted.). Signed-off-by: Maxim Uvarov --- platform/linux-generic/include/odp_pool_internal.h | 5 +++++ platform/linux-generic/odp_pool.c | 15 +++++++++++---- platform/linux-generic/odp_schedule.c | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/platform/linux-generic/include/odp_pool_internal.h b/platform/linux-generic/include/odp_pool_internal.h index 247a75a..1599ad9 100644 --- a/platform/linux-generic/include/odp_pool_internal.h +++ b/platform/linux-generic/include/odp_pool_internal.h @@ -339,6 +339,11 @@ static inline uint32_t odp_buffer_pool_tailroom(odp_pool_t pool) return odp_pool_to_entry(pool)->s.tailroom; } +odp_pool_t _pool_create(const char *name, + odp_shm_t shm, + odp_pool_param_t *params, + uint32_t shmflags); + #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index cd2c449..536436a 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -144,9 +144,10 @@ 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 _pool_create(const char *name, + odp_shm_t shm, + odp_pool_param_t *params, + uint32_t shmflags) { odp_pool_t pool_hdl = ODP_POOL_INVALID; pool_entry_t *pool; @@ -292,7 +293,7 @@ odp_pool_t odp_pool_create(const char *name, if (shm == ODP_SHM_NULL) { shm = odp_shm_reserve(pool->s.name, pool->s.pool_size, - ODP_PAGE_SIZE, 0); + ODP_PAGE_SIZE, shmflags); if (shm == ODP_SHM_INVALID) { POOL_UNLOCK(&pool->s.lock); return ODP_POOL_INVALID; @@ -428,6 +429,12 @@ odp_pool_t odp_pool_create(const char *name, return pool_hdl; } +odp_pool_t odp_pool_create(const char *name, + odp_shm_t shm, + odp_pool_param_t *params) +{ + return _pool_create(name, shm, params, ODP_SHM_PROC); +} odp_pool_t odp_pool_lookup(const char *name) { diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index a63f97a..78890fe 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -129,7 +129,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 = _pool_create("odp_sched_pool", ODP_SHM_NULL, ¶ms, 0); if (pool == ODP_POOL_INVALID) { ODP_ERR("Schedule init: Pool create failed.\n");