From patchwork Tue Sep 23 10:45:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 37728 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0CC4920792 for ; Tue, 23 Sep 2014 10:44:19 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id b57sf2743282eek.9 for ; Tue, 23 Sep 2014 03:44:18 -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=Qlcy7VOvHHzseywg4LLEDV6gXNxsGd1pMuEjXvS7N08=; b=B1bLUtyq5vRsYMxaL9ugiLm+frGhHkAZ57OikaqYPzfsX1PODt670Jcslp7UOUncyd hCLTsyMO7poYJijkZOmNI6dzjIFlMvRLS8TvyN7wboCDQ/AtU7vJRsZ8/6BF/K6DQAfU tiM0tC5ihS0vOw+Q8ZOVD9PDmZn7Rku5Qm6L5/bwOh6pN4dyXNNzJXWLlTOK1qXvwK6s Nyro8xZZfiM8DvujZDOe+1wD9TRIL8ZACt1XoGY2EqF6rm0PpwTVQ0eNIR9PV+iO/8sb fZ0lb4E1GUIP8FAW8aFSz/61DaRS6bXb0/TTSKW35/IRjQMMJQ3yJXb4qI/o1YScN7x9 Modw== X-Gm-Message-State: ALoCoQnwPHNeE3Plci0KIfsLDUCEll03Ix7U7ustwUTJ0T59fd1hBumI8yzfcULWOGimnGTfdjT3 X-Received: by 10.194.7.199 with SMTP id l7mr4955219wja.2.1411469058950; Tue, 23 Sep 2014 03:44:18 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.1.40 with SMTP id 8ls31007laj.65.gmail; Tue, 23 Sep 2014 03:44:18 -0700 (PDT) X-Received: by 10.152.198.204 with SMTP id je12mr32646714lac.52.1411469058703; Tue, 23 Sep 2014 03:44:18 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com [209.85.215.43]) by mx.google.com with ESMTPS id xt8si18080697lab.44.2014.09.23.03.44.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Sep 2014 03:44:18 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by mail-la0-f43.google.com with SMTP id gi9so8391191lab.2 for ; Tue, 23 Sep 2014 03:44:18 -0700 (PDT) X-Received: by 10.112.76.6 with SMTP id g6mr30180215lbw.22.1411469058604; Tue, 23 Sep 2014 03:44:18 -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 of9csp386752lbb; Tue, 23 Sep 2014 03:44:17 -0700 (PDT) X-Received: by 10.224.64.199 with SMTP id f7mr4546081qai.9.1411469057352; Tue, 23 Sep 2014 03:44:17 -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 s8si3214571qad.122.2014.09.23.03.44.16 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 23 Sep 2014 03:44:17 -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 1XWNZv-0001Mc-RT; Tue, 23 Sep 2014 10:44:15 +0000 Received: from mail-ie0-f180.google.com ([209.85.223.180]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XWNZl-0001KE-QC for lng-odp@lists.linaro.org; Tue, 23 Sep 2014 10:44:05 +0000 Received: by mail-ie0-f180.google.com with SMTP id ar1so6019682iec.25 for ; Tue, 23 Sep 2014 03:44:00 -0700 (PDT) X-Received: by 10.50.112.67 with SMTP id io3mr1916217igb.37.1411469040178; Tue, 23 Sep 2014 03:44:00 -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.57 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Sep 2014 03:43:59 -0700 (PDT) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Tue, 23 Sep 2014 13:45:33 +0300 Message-Id: <1411469133-5211-3-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 3/3] Use shm handle in linux-keystone2 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.215.43 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-keystone2/odp_crypto.c | 4 +++- platform/linux-keystone2/odp_packet_io.c | 10 +++++++--- platform/linux-keystone2/odp_queue.c | 9 ++++++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/platform/linux-keystone2/odp_crypto.c b/platform/linux-keystone2/odp_crypto.c index 8691fd6..7525bab 100644 --- a/platform/linux-keystone2/odp_crypto.c +++ b/platform/linux-keystone2/odp_crypto.c @@ -402,13 +402,15 @@ int odp_crypto_operation(odp_crypto_op_params_t *params, int odp_crypto_init_global(void) { size_t mem_size; + odp_shm_t shm; /* Calculate the memory size we need */ mem_size = sizeof(*global); mem_size += (MAX_SESSIONS * sizeof(struct odp_crypto_session_s)); /* Allocate our globally shared memory */ - global = odp_shm_reserve("crypto_pool", mem_size, ODP_CACHE_LINE_SIZE); + shm = odp_shm_reserve("crypto_pool", mem_size, ODP_CACHE_LINE_SIZE, 0); + global = odp_shm_addr(shm); /* Clear it out */ memset(global, 0, mem_size); diff --git a/platform/linux-keystone2/odp_packet_io.c b/platform/linux-keystone2/odp_packet_io.c index 9ba7d57..63a09ce 100644 --- a/platform/linux-keystone2/odp_packet_io.c +++ b/platform/linux-keystone2/odp_packet_io.c @@ -68,10 +68,14 @@ int odp_pktio_init_global(void) { pktio_entry_t *pktio_entry; 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-keystone2/odp_queue.c b/platform/linux-keystone2/odp_queue.c index b0dd4be..59e1e0b 100644 --- a/platform/linux-keystone2/odp_queue.c +++ b/platform/linux-keystone2/odp_queue.c @@ -109,12 +109,15 @@ static int queue_init(queue_entry_t *queue, const char *name, int odp_queue_init_global(void) { uint32_t i; + odp_shm_t shm; odp_pr_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;