From patchwork Tue Dec 2 19:17:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 41830 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1228525E3D for ; Tue, 2 Dec 2014 19:17:37 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id f15sf8682518lbj.7 for ; Tue, 02 Dec 2014 11:17:36 -0800 (PST) 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:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=JzwZ+w9U9dBnvMiViCepKqnyXtzVXRim0x/+gGxXQW8=; b=VGuwlLhUD/ia55P6qA6Cxh4RjE++VCaPYWbqshvQsOzcQ6JKiKlM1/sMpIhcGokpkQ XIfrXCZ1BD2txzsoEabuktevgUjgMIzfM63oOQnYUKMX4bCMEUrdednIxAPyxBxgIAOu CJ+1hm+FUfAW6T6pCkYVaWCrhkR2h1qEF7zFT9n+qgaBvFsHOYVkjAp8bQ6D6V1UWDi3 CmwWt3y0O/6XYi2DkEdTo0kf9LNrZoeWwjESEcyBZvWYGzDHpR2X2u8C5fFwEBuCuVbg VT8wW9ikM/sk8U0T6ezC5lw1P1kKkCPYydd948c9/LuzVcKBsd2+5y7UpJ5WMmOelY7d PqTQ== X-Gm-Message-State: ALoCoQn0kDhY+garpMZqeCvNm9A5/xbYirUXFOsOIliZy9pyHfsKcK0LMd0NIYmRBQBEM6wfFMwu X-Received: by 10.152.44.195 with SMTP id g3mr197743lam.2.1417547856026; Tue, 02 Dec 2014 11:17:36 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.200 with SMTP id h8ls68619lae.76.gmail; Tue, 02 Dec 2014 11:17:35 -0800 (PST) X-Received: by 10.112.173.39 with SMTP id bh7mr739476lbc.53.1417547855784; Tue, 02 Dec 2014 11:17:35 -0800 (PST) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id m2si12865077lbs.81.2014.12.02.11.17.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Dec 2014 11:17:35 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id gq15so11396126lab.18 for ; Tue, 02 Dec 2014 11:17:35 -0800 (PST) X-Received: by 10.112.235.196 with SMTP id uo4mr804021lbc.66.1417547855663; Tue, 02 Dec 2014 11:17:35 -0800 (PST) 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.184.201 with SMTP id ew9csp546188lbc; Tue, 2 Dec 2014 11:17:35 -0800 (PST) X-Received: by 10.229.248.132 with SMTP id mg4mr1228472qcb.29.1417547854423; Tue, 02 Dec 2014 11:17:34 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id 5si6205637qao.63.2014.12.02.11.17.33 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 02 Dec 2014 11:17:34 -0800 (PST) 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-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xvsx2-0002xE-Fe; Tue, 02 Dec 2014 19:17:32 +0000 Received: from mail-ob0-f174.google.com ([209.85.214.174]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xvswo-0002wl-Ag for lng-odp@lists.linaro.org; Tue, 02 Dec 2014 19:17:18 +0000 Received: by mail-ob0-f174.google.com with SMTP id nt9so3343913obb.19 for ; Tue, 02 Dec 2014 11:17:13 -0800 (PST) X-Received: by 10.202.209.200 with SMTP id i191mr545430oig.134.1417547833066; Tue, 02 Dec 2014 11:17:13 -0800 (PST) Received: from localhost.localdomain (cpe-24-28-70-239.austin.res.rr.com. [24.28.70.239]) by mx.google.com with ESMTPSA id v73sm10216102oie.19.2014.12.02.11.17.12 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Dec 2014 11:17:12 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Tue, 2 Dec 2014 13:17:02 -0600 Message-Id: <1417547823-16522-2-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1417547823-16522-1-git-send-email-bill.fischofer@linaro.org> References: <1417547823-16522-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv2 2/3] Add odp_buffer_pool_info() implementation 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: bill.fischofer@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.45 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 Signed-off-by: Bill Fischofer --- platform/linux-generic/odp_buffer_pool.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/platform/linux-generic/odp_buffer_pool.c b/platform/linux-generic/odp_buffer_pool.c index f545090..fa72972 100644 --- a/platform/linux-generic/odp_buffer_pool.c +++ b/platform/linux-generic/odp_buffer_pool.c @@ -353,6 +353,27 @@ odp_buffer_pool_t odp_buffer_pool_lookup(const char *name) return ODP_BUFFER_POOL_INVALID; } +int odp_buffer_pool_info(odp_buffer_pool_t pool_hdl, + odp_shm_t *shm, + odp_buffer_pool_info_t *info) +{ + uint32_t pool_id = pool_handle_to_index(pool_hdl); + pool_entry_t *pool = get_pool_entry(pool_id); + + if (pool == NULL || info == NULL) + return -1; + + *shm = pool->s.flags.user_supplied_shm ? + pool->s.pool_shm : ODP_SHM_NULL; + info->name = pool->s.name; + info->params.buf_size = pool->s.params.buf_size; + info->params.buf_align = pool->s.params.buf_align; + info->params.num_bufs = pool->s.params.num_bufs; + info->params.buf_type = pool->s.params.buf_type; + + return 0; +} + odp_buffer_t buffer_alloc(odp_buffer_pool_t pool_hdl, size_t size) { pool_entry_t *pool = odp_pool_to_entry(pool_hdl);