From patchwork Tue Sep 23 10:45:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 37727 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4DED220792 for ; Tue, 23 Sep 2014 10:44:15 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id n3sf2380803wiv.5 for ; Tue, 23 Sep 2014 03:44: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: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=ecHz1ZqsNKMFnXuXk+ta0XkI+UGmogQRr1TekZgnBUo=; b=IfeZ6QboVFdY2c1ivE6CFAk+61jEF4M3l8MDnnvTlHIpiCnRz9F9lW2OfVvyrOaW4o ZdzLjQOxs0vYa01kNNrt0gdN+l6FTPy2hjK60T2A8pTEfcKmxTnEnuhPSEFDyDceUyHq UH6RiI8cdMYSbEVhAm54xtUBJCq2lVW1sNnCliPgDk2lUDB2Z19fmq86YO0dxmIqSbLC /naYHWuWvTlB6nQ4Om4L86VhIAOpgpSwHPkoLtpW8nTps7PbNchBTSWu4fSDpUlT3Vqw 16lffQuD9YuAYlHAsChVcGhEiet+q7J6UoGDSKlDzXmhRydo3QFHykHEnCdyaFLo3w7M IHow== X-Gm-Message-State: ALoCoQmaO4kRc5Wybd0Srr7QKM6722vbesebo+orMJXg3AdeEhbBePkUeaX9bbprJjcTQmS1KCM6 X-Received: by 10.180.109.194 with SMTP id hu2mr314775wib.1.1411469054515; Tue, 23 Sep 2014 03:44:14 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.201 with SMTP id u9ls31986lau.107.gmail; Tue, 23 Sep 2014 03:44:14 -0700 (PDT) X-Received: by 10.112.156.138 with SMTP id we10mr30684650lbb.68.1411469054268; Tue, 23 Sep 2014 03:44:14 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx.google.com with ESMTPS id li6si13319798lbc.87.2014.09.23.03.44.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Sep 2014 03:44:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id u10so8227835lbd.41 for ; Tue, 23 Sep 2014 03:44:14 -0700 (PDT) X-Received: by 10.112.200.134 with SMTP id js6mr29924894lbc.0.1411469054163; Tue, 23 Sep 2014 03:44: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.130.169 with SMTP id of9csp386748lbb; Tue, 23 Sep 2014 03:44:13 -0700 (PDT) X-Received: by 10.229.231.68 with SMTP id jp4mr37986511qcb.4.1411469052958; Tue, 23 Sep 2014 03:44:12 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id i49si11845724qgd.114.2014.09.23.03.44.12 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 23 Sep 2014 03:44:12 -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-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XWNZr-0001Kx-AI; Tue, 23 Sep 2014 10:44:11 +0000 Received: from mail-ig0-f176.google.com ([209.85.213.176]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XWNZj-0001Ir-4e for lng-odp@lists.linaro.org; Tue, 23 Sep 2014 10:44:03 +0000 Received: by mail-ig0-f176.google.com with SMTP id hn15so4326760igb.3 for ; Tue, 23 Sep 2014 03:43:57 -0700 (PDT) X-Received: by 10.50.253.193 with SMTP id ac1mr1892208igd.49.1411469037603; Tue, 23 Sep 2014 03:43:57 -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 m9sm1383715igd.14.2014.09.23.03.43.55 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Sep 2014 03:43:56 -0700 (PDT) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Tue, 23 Sep 2014 13:45:32 +0300 Message-Id: <1411469133-5211-2-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1411469133-5211-1-git-send-email-petri.savolainen@linaro.org> References: <1411469133-5211-1-git-send-email-petri.savolainen@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v2 2/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.217.182 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 | 10 ++++++---- platform/linux-dpdk/odp_packet_io.c | 9 ++++++--- platform/linux-dpdk/odp_queue.c | 8 +++++--- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/platform/linux-dpdk/odp_buffer_pool.c b/platform/linux-dpdk/odp_buffer_pool.c index 894f8dd..7f28f9d 100644 --- a/platform/linux-dpdk/odp_buffer_pool.c +++ b/platform/linux-dpdk/odp_buffer_pool.c @@ -69,11 +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), - 0); + 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 ea06520..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), 0); if (pktio_tbl == NULL) return -1; diff --git a/platform/linux-dpdk/odp_queue.c b/platform/linux-dpdk/odp_queue.c index 5d4522a..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), 0); + 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;