From patchwork Thu Oct 22 09:50:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 55431 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id 7BC8F2304B for ; Thu, 22 Oct 2015 09:59:15 +0000 (UTC) Received: by wicfg8 with SMTP id fg8sf17796281wic.0 for ; Thu, 22 Oct 2015 02:59:14 -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=W+ZVKTryDFCyYbz6ocLQzxVI4norulOol9tCURpKtGc=; b=Nb/0Eob2eeDdbYOi/xHoAT2ssh06EjLC8T7imv4ay5cI39XUgaLbeuiLcXmpDG56pl 9r0PY2I5a14GiTN3Po6kIAFq6HW2eldHYon27o+lSDQQaPX5X/HRzMvjyWlQMIrMIUHX dhxWve7WCRV6/XsOrWYsu5crnH6SsK0+ti76AuE2BPkCf2ZOuuf1mK5zkmDwExkyZGoH LQ+Mjd4oL+ceJAIBo20+PDkwHxkc3qXCMJ7AjDAwrH7hZKNxQGJjfwa8RFGD2ByqZTgq xVbcD8CpJtVmaMaBmOZMQ4vtzAeCWDU8+98iqxNQuNkxVKbPNTqbGaME0jdgQiOXj6Fg cKzg== X-Gm-Message-State: ALoCoQlVDWQP3ijIXWLfqhQ057OSFW/czt3rMuCtO3/dYZxjAgTV54NgcWcKfIsN9JHxkgUNE1mE X-Received: by 10.112.159.4 with SMTP id wy4mr3382703lbb.15.1445507954707; Thu, 22 Oct 2015 02:59:14 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.166.200 with SMTP id p191ls277342lfe.37.gmail; Thu, 22 Oct 2015 02:59:14 -0700 (PDT) X-Received: by 10.25.28.131 with SMTP id c125mr4186202lfc.99.1445507954292; Thu, 22 Oct 2015 02:59:14 -0700 (PDT) Received: from mail-lf0-x236.google.com (mail-lf0-x236.google.com. [2a00:1450:4010:c07::236]) by mx.google.com with ESMTPS id rm8si9104172lbb.16.2015.10.22.02.59.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Oct 2015 02:59:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c07::236 as permitted sender) client-ip=2a00:1450:4010:c07::236; Received: by lffv3 with SMTP id v3so41654282lff.0 for ; Thu, 22 Oct 2015 02:59:14 -0700 (PDT) X-Received: by 10.112.139.201 with SMTP id ra9mr7965858lbb.29.1445507954176; Thu, 22 Oct 2015 02:59:14 -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.59.35 with SMTP id w3csp493795lbq; Thu, 22 Oct 2015 02:59:13 -0700 (PDT) X-Received: by 10.107.162.197 with SMTP id l188mr14906960ioe.57.1445507506973; Thu, 22 Oct 2015 02:51:46 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id b19si4312736igr.56.2015.10.22.02.51.46; Thu, 22 Oct 2015 02:51:46 -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 65D3D61D9E; Thu, 22 Oct 2015 09:51:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 20BAD62BF2; Thu, 22 Oct 2015 09:50:29 +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 1ECBC61D8A; Thu, 22 Oct 2015 09:50:24 +0000 (UTC) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) by lists.linaro.org (Postfix) with ESMTPS id 6EEC461D3A for ; Thu, 22 Oct 2015 09:50:22 +0000 (UTC) Received: by lffz202 with SMTP id z202so41517220lff.3 for ; Thu, 22 Oct 2015 02:50:21 -0700 (PDT) X-Received: by 10.25.157.15 with SMTP id g15mr5099650lfe.113.1445507421391; Thu, 22 Oct 2015 02:50:21 -0700 (PDT) Received: from localhost.localdomain (ppp91-76-161-180.pppoe.mtu-net.ru. [91.76.161.180]) by smtp.gmail.com with ESMTPSA id nb1sm2207849lbb.9.2015.10.22.02.50.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Oct 2015 02:50:20 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 22 Oct 2015 12:50:06 +0300 Message-Id: <1445507411-20556-3-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1445507411-20556-1-git-send-email-maxim.uvarov@linaro.org> References: <1445507411-20556-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv11 2/7] 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-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 2a00:1450:4010:c07::236 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com 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 | 4 ++++ platform/linux-generic/odp_pool.c | 11 +++++++++-- platform/linux-generic/odp_schedule.c | 3 +-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/platform/linux-generic/include/odp_pool_internal.h b/platform/linux-generic/include/odp_pool_internal.h index 136db2c..6781703 100644 --- a/platform/linux-generic/include/odp_pool_internal.h +++ b/platform/linux-generic/include/odp_pool_internal.h @@ -347,6 +347,10 @@ 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_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 30d4b2b..2036c2a 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -144,7 +144,9 @@ int odp_pool_term_local(void) * Pool creation */ -odp_pool_t odp_pool_create(const char *name, odp_pool_param_t *params) +odp_pool_t _pool_create(const char *name, + odp_pool_param_t *params, + uint32_t shmflags) { odp_pool_t pool_hdl = ODP_POOL_INVALID; pool_entry_t *pool; @@ -290,7 +292,7 @@ odp_pool_t odp_pool_create(const char *name, odp_pool_param_t *params) 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; @@ -403,6 +405,11 @@ odp_pool_t odp_pool_create(const char *name, odp_pool_param_t *params) return pool_hdl; } +odp_pool_t odp_pool_create(const char *name, + odp_pool_param_t *params) +{ + return _pool_create(name, 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 827fcf0..c66c177 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -140,8 +140,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", ¶ms); - + pool = _pool_create("odp_sched_pool", ¶ms, 0); if (pool == ODP_POOL_INVALID) { ODP_ERR("Schedule init: Pool create failed.\n"); return -1;