From patchwork Fri Jan 30 02:46:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 43999 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BB4B624128 for ; Fri, 30 Jan 2015 02:47:27 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id l4sf25996893lbv.1 for ; Thu, 29 Jan 2015 18:47:26 -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=yT5vo+GJ/jzk6nkr/w1agrgh8ZERCSaz8peTpkbVUwk=; b=A+jrdgnfIkpSO/4zESFOq7uHeNKwfH3R134qFZ4yat1OhsR9edQemspZRxxOkEQFqE AvlM9HVnjpru4Vw8FWP47YZIVVrXF5FPTPV+dk+EAXsDhxeRBgW3pKukaio5kWLn6YRE Haf2U+r92sZZUl7JKRf/3aeFH+HfPX60cWwBJndAMz4AMx2FF5cHG2gZd6QLK0XkitK3 keqTMeu36MGR7Qu6I/D6F3lpw3dfgaR644tHG7DH+WpWNEEmpcVucjLz4vd3tC56c61G y5fXqBF8TpQq7/YWCg35V5cRXs9Ko8Gk7C8ENqR8GKggdka17y+SRCMte9amu9he/9Cn xPvA== X-Gm-Message-State: ALoCoQnqIs1/UTJDWQpEaoRtMxghdTrzXkiPOZaMSYdgYtbUY7Gp4YbWDZ8cb2eUAd78baGCEWT1 X-Received: by 10.112.161.201 with SMTP id xu9mr488925lbb.11.1422586046433; Thu, 29 Jan 2015 18:47:26 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.4.136 with SMTP id k8ls378324lak.21.gmail; Thu, 29 Jan 2015 18:47:25 -0800 (PST) X-Received: by 10.152.219.161 with SMTP id pp1mr4448036lac.30.1422586045867; Thu, 29 Jan 2015 18:47:25 -0800 (PST) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id f4si9065515lbc.110.2015.01.29.18.47.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 Jan 2015 18:47:25 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by mail-lb0-f180.google.com with SMTP id b6so34221372lbj.11 for ; Thu, 29 Jan 2015 18:47:25 -0800 (PST) X-Received: by 10.112.181.41 with SMTP id dt9mr4295226lbc.56.1422586045679; Thu, 29 Jan 2015 18:47:25 -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.35.133 with SMTP id h5csp140757lbj; Thu, 29 Jan 2015 18:47:25 -0800 (PST) X-Received: by 10.224.98.196 with SMTP id r4mr7955947qan.27.1422586044455; Thu, 29 Jan 2015 18:47:24 -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 y4si12618560qad.130.2015.01.29.18.47.23 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 29 Jan 2015 18:47:24 -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 1YH1c9-0002iF-C1; Fri, 30 Jan 2015 02:47:21 +0000 Received: from mail-qg0-f49.google.com ([209.85.192.49]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YH1by-0002gz-Qn for lng-odp@lists.linaro.org; Fri, 30 Jan 2015 02:47:10 +0000 Received: by mail-qg0-f49.google.com with SMTP id i50so36410131qgf.8 for ; Thu, 29 Jan 2015 18:47:05 -0800 (PST) X-Received: by 10.229.182.9 with SMTP id ca9mr8139827qcb.31.1422586025698; Thu, 29 Jan 2015 18:47:05 -0800 (PST) Received: from mike-desktop.?.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id n4sm8829452qas.20.2015.01.29.18.47.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Jan 2015 18:47:05 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Thu, 29 Jan 2015 21:46:47 -0500 Message-Id: <1422586015-29874-2-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1422586015-29874-1-git-send-email-mike.holmes@linaro.org> References: <1422586015-29874-1-git-send-email-mike.holmes@linaro.org> X-Topics: Classification patch Subject: [lng-odp] [PATCH 01/10] linux-generic: classification: add term_global 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: mike.holmes@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.180 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 From: Yan Sonming Signed-off-by: Yan Sonming Signed-off-by: Mike Holmes --- platform/linux-generic/include/odp_internal.h | 1 + platform/linux-generic/odp_classification.c | 25 +++++++++++++++++++++++++ platform/linux-generic/odp_init.c | 6 +++++- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index 608aafd..2bd4b83 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -39,6 +39,7 @@ int odp_pktio_init_global(void); int odp_pktio_init_local(void); int odp_classification_init_global(void); +int odp_classification_term_global(void); int odp_queue_init_global(void); diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index 78597ef..47df7c2 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -124,6 +124,31 @@ error: return -1; } +int odp_classification_term_global(void) +{ + odp_shm_t cos_shm; + odp_shm_t pmr_shm; + odp_shm_t pmr_set_shm; + int ret = 0; + + cos_shm = odp_shm_lookup("shm_odp_cos_tbl"); + if (cos_shm == ODP_SHM_INVALID) + return -1; + ret = odp_shm_free(cos_shm); + + pmr_shm = odp_shm_lookup("shm_odp_pmr_tbl"); + if (pmr_shm == ODP_SHM_INVALID) + return -1; + ret = odp_shm_free(pmr_shm); + + pmr_set_shm = odp_shm_lookup("shm_odp_pmr_set_tbl"); + if (pmr_set_shm == ODP_SHM_INVALID) + return -1; + ret = odp_shm_free(pmr_set_shm); + + return ret; +} + odp_cos_t odp_cos_create(const char *name) { int i; diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index 6db05b3..88a2578 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -72,7 +72,11 @@ int odp_init_global(odp_init_t *params ODP_UNUSED, int odp_term_global(void) { - ODP_UNIMPLEMENTED(); + if (odp_classification_term_global()) { + ODP_ERR("ODP classificatio term failed.\n"); + return -1; + } + return 0; }