From patchwork Wed Sep 10 13:22:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 37205 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2C29A20491 for ; Wed, 10 Sep 2014 13:21:27 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id w7sf52846588qcr.3 for ; Wed, 10 Sep 2014 06:21: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=X/P8h5ptPBmWRBN1TWekl8++6dYQDnKbhB7bQ/fr+iw=; b=mUChqyeJ3OsFIMf26nliCZBz88bzB+KUMruKCKn8vqyEZL3D6Cs9Bp9P9cc+Rp2PnT iUYoNXnHpH85KXdO0BseR+baWut+mG+vMX04ePtyKDM4vnrxYzn4/ljWuGkhFnW3KxOF S7beFEBSJHhI2465AX541DgheseXC2SIUdVOtVMD7oLhqndMMBnLgkfSwfixigKO17xq 42eQg1ZmPVc+s9qMEISIbOnqFVywYLK6iGOk+JDIdlXx1NcbbQIRjQaQmGD9JcplhQ+U bEZM1oJeecGR+WnqXlAMnmvYUvDfQHZTLCkp3dX6i7rjWzU0lHaGJ7iKZ5iPZlHt0K5w mksQ== X-Gm-Message-State: ALoCoQloj9t17Wf4N9d2RrYiU5GF3tYuQBYvIub0noCLIF4kZaJzF9CFg8xdpIBmy4o6GFO946sb X-Received: by 10.236.34.233 with SMTP id s69mr616374yha.57.1410355286931; Wed, 10 Sep 2014 06:21:26 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.86.170 with SMTP id p39ls334093qgd.57.gmail; Wed, 10 Sep 2014 06:21:26 -0700 (PDT) X-Received: by 10.221.64.205 with SMTP id xj13mr27440222vcb.18.1410355286867; Wed, 10 Sep 2014 06:21:26 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id ty1si6278870vcb.101.2014.09.10.06.21.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Sep 2014 06:21:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.170 as permitted sender) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id hy4so3929041vcb.29 for ; Wed, 10 Sep 2014 06:21:26 -0700 (PDT) X-Received: by 10.52.120.51 with SMTP id kz19mr99726vdb.95.1410355286762; Wed, 10 Sep 2014 06:21: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 uj3csp436551vcb; Wed, 10 Sep 2014 06:21:26 -0700 (PDT) X-Received: by 10.224.79.139 with SMTP id p11mr27093498qak.93.1410355286295; Wed, 10 Sep 2014 06:21:26 -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 u6si18723444qap.12.2014.09.10.06.21.25 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 10 Sep 2014 06:21:26 -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 1XRhps-0002OW-Ip; Wed, 10 Sep 2014 13:21:24 +0000 Received: from mail-qg0-f47.google.com ([209.85.192.47]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XRhpj-0002NU-RO for lng-odp@lists.linaro.org; Wed, 10 Sep 2014 13:21:15 +0000 Received: by mail-qg0-f47.google.com with SMTP id i50so4583017qgf.6 for ; Wed, 10 Sep 2014 06:21:10 -0700 (PDT) X-Received: by 10.224.129.68 with SMTP id n4mr58436434qas.86.1410355269624; Wed, 10 Sep 2014 06:21: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 i110sm12285306qgf.29.2014.09.10.06.21.07 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Sep 2014 06:21:08 -0700 (PDT) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Wed, 10 Sep 2014 16:22:24 +0300 Message-Id: <1410355344-2938-3-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1410355344-2938-1-git-send-email-petri.savolainen@linaro.org> References: <1410355344-2938-1-git-send-email-petri.savolainen@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 3/3] Use shm handle in linux-dpdk 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.170 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 Latest shm API updates. Not tested. Signed-off-by: Petri Savolainen --- platform/linux-dpdk/odp_buffer_pool.c | 9 ++++++--- platform/linux-dpdk/odp_packet_io.c | 9 ++++++--- platform/linux-dpdk/odp_queue.c | 8 +++++--- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/platform/linux-dpdk/odp_buffer_pool.c b/platform/linux-dpdk/odp_buffer_pool.c index 805ce68..7f28f9d 100644 --- a/platform/linux-dpdk/odp_buffer_pool.c +++ b/platform/linux-dpdk/odp_buffer_pool.c @@ -69,10 +69,13 @@ void *pool_entry_ptr[ODP_CONFIG_BUFFER_POOLS]; int odp_buffer_pool_init_global(void) { odp_buffer_pool_t i; + odp_shm_t shm; - pool_tbl = odp_shm_reserve("odp_buffer_pools", - sizeof(pool_table_t), - sizeof(pool_entry_t)); + shm = odp_shm_reserve("odp_buffer_pools", + sizeof(pool_table_t), + sizeof(pool_entry_t), 0); + + pool_tbl = odp_shm_addr(shm); if (pool_tbl == NULL) return -1; diff --git a/platform/linux-dpdk/odp_packet_io.c b/platform/linux-dpdk/odp_packet_io.c index 3124175..18635de 100644 --- a/platform/linux-dpdk/odp_packet_io.c +++ b/platform/linux-dpdk/odp_packet_io.c @@ -52,10 +52,13 @@ int odp_pktio_init_global(void) queue_entry_t *queue_entry; odp_queue_t qid; int id; + odp_shm_t shm; + + shm = odp_shm_reserve("odp_pktio_entries", + sizeof(pktio_table_t), + sizeof(pktio_entry_t), 0); + pktio_tbl = odp_shm_addr(shm); - pktio_tbl = odp_shm_reserve("odp_pktio_entries", - sizeof(pktio_table_t), - sizeof(pktio_entry_t)); if (pktio_tbl == NULL) return -1; diff --git a/platform/linux-dpdk/odp_queue.c b/platform/linux-dpdk/odp_queue.c index 554b8ea..7cc8116 100644 --- a/platform/linux-dpdk/odp_queue.c +++ b/platform/linux-dpdk/odp_queue.c @@ -93,12 +93,14 @@ static void queue_init(queue_entry_t *queue, const char *name, int odp_queue_init_global(void) { uint32_t i; + odp_shm_t shm; ODP_DBG("Queue init ... "); - queue_tbl = odp_shm_reserve("odp_queues", - sizeof(queue_table_t), - sizeof(queue_entry_t)); + shm = odp_shm_reserve("odp_queues", + sizeof(queue_table_t), + sizeof(queue_entry_t), 0); + queue_tbl = odp_shm_addr(shm); if (queue_tbl == NULL) return -1;