From patchwork Tue Aug 18 11:01:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 52496 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 patches.linaro.org (Postfix) with ESMTPS id B323522DB1 for ; Tue, 18 Aug 2015 11:03:58 +0000 (UTC) Received: by lbck9 with SMTP id k9sf54406285lbc.0 for ; Tue, 18 Aug 2015 04:03:57 -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=dwzTz4QMXNESiddWUc4quIp3VIiCLRfrbx09gw30wSo=; b=jStfpjOiRt/j045BqY6j964F9junWaHcpLv+5va2ueWDwa7CGi/cCU461Lm6YJ/KXT UvJfG1/gFlpw+ivOTq6I40qSsm2Pjgi947WitPCAZ3F7w71qEGtezpPC/FThtelyBCdr XSwBjA/9tunaxyP8DQbrT62H/PyMg5w6wT+v6rYbw27BxAFtumAa3WvNjqcZhhxw3Wpu nrDqCZNrll+iH+GYmxk0xYI4PU2+b9PcGdA24YS8Fw9sjJxqfvLZEqZPpabeFJPoxUv+ 2yhpWqJOyeQiPdfl8fSWI1iIeYx1jNJqwASJgqESqC08xeiUWBS5iQqnYOO0Su5ejzAL Dh9A== X-Gm-Message-State: ALoCoQlHnuYeylBTFPs2Y9wBs2IN5Fg1m/Z2uU1LyY5YEOnk+FrVfhZTbeLAiItfD9AvDun9Yj6L X-Received: by 10.112.149.39 with SMTP id tx7mr1671502lbb.11.1439895837289; Tue, 18 Aug 2015 04:03:57 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.67 with SMTP id q3ls693691laq.78.gmail; Tue, 18 Aug 2015 04:03:57 -0700 (PDT) X-Received: by 10.152.234.75 with SMTP id uc11mr5712424lac.20.1439895837134; Tue, 18 Aug 2015 04:03:57 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id yo1si13841731lbb.167.2015.08.18.04.03.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Aug 2015 04:03:57 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbbpu9 with SMTP id pu9so100539361lbb.3 for ; Tue, 18 Aug 2015 04:03:57 -0700 (PDT) X-Received: by 10.152.164.130 with SMTP id yq2mr5210845lab.76.1439895837011; Tue, 18 Aug 2015 04:03:57 -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.162.200 with SMTP id yc8csp405090lbb; Tue, 18 Aug 2015 04:03:56 -0700 (PDT) X-Received: by 10.140.93.132 with SMTP id d4mr11371382qge.58.1439895835960; Tue, 18 Aug 2015 04:03:55 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id c33si19847093qga.59.2015.08.18.04.03.55; Tue, 18 Aug 2015 04:03:55 -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 E633761F9E; Tue, 18 Aug 2015 11:03:54 +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 5348361F78; Tue, 18 Aug 2015 11:02:05 +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 04CB661F72; Tue, 18 Aug 2015 11:02:00 +0000 (UTC) Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by lists.linaro.org (Postfix) with ESMTPS id 0D70761F60 for ; Tue, 18 Aug 2015 11:01:50 +0000 (UTC) Received: by wicja10 with SMTP id ja10so104921260wic.1 for ; Tue, 18 Aug 2015 04:01:49 -0700 (PDT) X-Received: by 10.194.120.230 with SMTP id lf6mr12887883wjb.41.1439895709288; Tue, 18 Aug 2015 04:01:49 -0700 (PDT) Received: from localhost.localdomain ([87.120.178.39]) by smtp.gmail.com with ESMTPSA id e8sm20892047wiz.0.2015.08.18.04.01.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 18 Aug 2015 04:01:48 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Tue, 18 Aug 2015 14:01:29 +0300 Message-Id: <1439895698-18597-4-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439895698-18597-1-git-send-email-maxim.uvarov@linaro.org> References: <1439895698-18597-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv8 03/12] 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.217.179 as permitted sender) smtp.mailfrom=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 | 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 dfdd2f5..711811f 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 e14e9d6..ee2fd16 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -129,8 +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", ¶ms); - + pool = _pool_create("odp_sched_pool", ¶ms, 0); if (pool == ODP_POOL_INVALID) { ODP_ERR("Schedule init: Pool create failed.\n"); return -1;