From patchwork Tue Feb 24 16:00:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robbie King X-Patchwork-Id: 44943 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f197.google.com (mail-we0-f197.google.com [74.125.82.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 073762029F for ; Tue, 24 Feb 2015 16:01:37 +0000 (UTC) Received: by wesu56 with SMTP id u56sf17829390wes.1 for ; Tue, 24 Feb 2015 08:01: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=PHwp8rZLi+0x1cCCo3tjhs+uBy53k5el+Tl3CaaCdTw=; b=MIvfOeXWQ5s9nV+IXCBSW3PmcQ1tAQc1BGX3yJ9ypDZ4NM2BME/Y7u5gXULVXyd0Gd 9oPIbWQoZF0W5mp5fjyaJY+hdWWPSzK04YuUMQwhijuHF9riz2iAZy2AGeEmJ6mfX1DO M+IoF5YS3M9S+68i/M9PvDQ7TbLykPPgPctgINawSokUrxbokLwHnH1tsTBvBABZvTGI 7RTT7t3zjTpt5kWSattL7QdyOOKE4AyRt8alPPQK7kO9F2BQrs1yi0GZOGjQJDqqPjxV SVNZB8IcnmsYvr97dvA0NmnEJUGN8Km1NG5TvbdlTmu7BUsAjE3DTWO4BGmwZ2o5/TIL G0kA== X-Gm-Message-State: ALoCoQlsMixGsgxH9Zm1ZfOmUS8ND/thbzyaQa4VbDEUACnR+tZyW0Qk/5ZBdJyWko53sxBWesuH X-Received: by 10.112.9.65 with SMTP id x1mr2048826lba.16.1424793696343; Tue, 24 Feb 2015 08:01:36 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.36 with SMTP id n4ls575215laj.27.gmail; Tue, 24 Feb 2015 08:01:36 -0800 (PST) X-Received: by 10.152.23.195 with SMTP id o3mr14454669laf.11.1424793696125; Tue, 24 Feb 2015 08:01:36 -0800 (PST) Received: from mail-lb0-x232.google.com (mail-lb0-x232.google.com. [2a00:1450:4010:c04::232]) by mx.google.com with ESMTPS id p8si28734539laf.50.2015.02.24.08.01.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Feb 2015 08:01:36 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::232 as permitted sender) client-ip=2a00:1450:4010:c04::232; Received: by lbiz11 with SMTP id z11so25915444lbi.5 for ; Tue, 24 Feb 2015 08:01:36 -0800 (PST) X-Received: by 10.112.204.197 with SMTP id la5mr293888lbc.29.1424793695995; Tue, 24 Feb 2015 08:01: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.35.133 with SMTP id h5csp2000464lbj; Tue, 24 Feb 2015 08:01:35 -0800 (PST) X-Received: by 10.236.15.66 with SMTP id e42mr14868021yhe.96.1424793694338; Tue, 24 Feb 2015 08:01: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 x9si15478335qam.95.2015.02.24.08.01.32 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 24 Feb 2015 08:01: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 1YQHvP-0006ac-9B; Tue, 24 Feb 2015 16:01:31 +0000 Received: from alln-iport-1.cisco.com ([173.37.142.88]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YQHvG-0006Zu-Q1 for lng-odp@lists.linaro.org; Tue, 24 Feb 2015 16:01:22 +0000 X-IronPort-AV: E=Sophos;i="5.09,639,1418083200"; d="scan'208";a="126417042" Received: from alln-core-7.cisco.com ([173.36.13.140]) by alln-iport-1.cisco.com with ESMTP; 24 Feb 2015 16:01:18 +0000 Received: from cpp-rtpbld-55.cisco.com (cpp-rtpbld-55.cisco.com [172.18.5.199]) by alln-core-7.cisco.com (8.14.5/8.14.5) with ESMTP id t1OG1HGp009517 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 24 Feb 2015 16:01:17 GMT Received: from cpp-rtpbld-55.cisco.com (localhost.localdomain [127.0.0.1]) by cpp-rtpbld-55.cisco.com (8.13.8/8.13.8) with ESMTP id t1OG1GYM028832; Tue, 24 Feb 2015 11:01:16 -0500 Received: (from robking@localhost) by cpp-rtpbld-55.cisco.com (8.13.8/8.13.8/Submit) id t1OG1AYs028735; Tue, 24 Feb 2015 11:01:10 -0500 From: Robbie King To: lng-odp@lists.linaro.org Date: Tue, 24 Feb 2015 11:00:38 -0500 Message-Id: <1424793647-28572-2-git-send-email-robking@cisco.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1424793647-28572-1-git-send-email-robking@cisco.com> References: <1424793647-28572-1-git-send-email-robking@cisco.com> X-Topics: Classification patch Subject: [lng-odp] [PATCHv4 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-Original-Sender: robking@cisco.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::232 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=fail header.i=@cisco.com 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 Signed-off-by: Robbie King --- platform/linux-generic/include/odp_internal.h | 1 + platform/linux-generic/odp_classification.c | 26 ++++++++++++++++++++++++++ platform/linux-generic/odp_init.c | 10 ++++++++-- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index b250ed6..fd684d1 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -44,6 +44,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 cd9ad9e..9fb034f 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -128,6 +128,32 @@ error: return -1; } +int odp_classification_term_global(void) +{ + int ret = 0; + int rc = 0; + + ret = odp_shm_free(odp_shm_lookup("shm_odp_cos_tbl")); + if (ret < 0) { + ODP_ERR("shm free failed for shm_odp_cos_tbl"); + rc = -1; + } + + ret = odp_shm_free(odp_shm_lookup("shm_odp_pmr_tbl")); + if (ret < 0) { + ODP_ERR("shm free failed for shm_odp_pmr_tbl"); + rc = -1; + } + + ret = odp_shm_free(odp_shm_lookup("shm_odp_pmr_set_tbl")); + if (ret < 0) { + ODP_ERR("shm free failed for shm_odp_pmr_tbl"); + rc = -1; + } + + return rc; +} + 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 2d91744..58e1ab6 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -76,8 +76,14 @@ int odp_init_global(odp_init_t *params, int odp_term_global(void) { - ODP_UNIMPLEMENTED(); - return 0; + int rc = 0; + + if (odp_classification_term_global()) { + ODP_ERR("ODP classificatio term failed.\n"); + rc = -1; + } + + return rc; } int odp_init_local(void)