From patchwork Mon Feb 16 19:55:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 44726 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 83E3B21544 for ; Mon, 16 Feb 2015 19:56:10 +0000 (UTC) Received: by mail-wg0-f72.google.com with SMTP id l18sf20637305wgh.3 for ; Mon, 16 Feb 2015 11:56:09 -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=OghEKrh9SGcbprUDrj+PrjE+/OUIhAMUulv5TagUuVA=; b=CrnhaDwGB+N8Wow3Vb5Yk9P8Btru8dN0iQDAcOBsYyiWGTkdF1qAGDD1hrRxG0TBEM 8+GnA0Zz35LY65rvktLmaEqDHXTh9PPdGBuAI7W8Gj6TcI/mywcLLNd2Efd+1DIi5YHJ REcMsLo0khDwo4MqZQKy4mmHnFZlRm64WR+5ERa6ZfDFEAbUaxCp+Tv2V/iPnsLq/mYD MrJ0X8m5qBDiSFzyQklIr9o4+XIq38b1HFvT1xoz6XkVLXhMSzZg6smH0E8ZSpRYbQZ6 ocMuiHcoUqw9eiDZjcR8UMkmsV5JnERt8xB7hVCHZ33MTxcD8RJ/LH0kHrLztPtDKR9Q z4zA== X-Gm-Message-State: ALoCoQltq0PuYusJ6J/mTDldtaWJLqEw/EPxZKyklW4xRaLl1LkqQWOVthfGw+tqIHb8aqy62KAh X-Received: by 10.112.130.70 with SMTP id oc6mr3243275lbb.13.1424116569762; Mon, 16 Feb 2015 11:56:09 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.25.134 with SMTP id c6ls563517lag.103.gmail; Mon, 16 Feb 2015 11:56:09 -0800 (PST) X-Received: by 10.112.148.34 with SMTP id tp2mr25092523lbb.94.1424116569622; Mon, 16 Feb 2015 11:56:09 -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 rr6si9229397lbb.74.2015.02.16.11.56.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Feb 2015 11:56:09 -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 lbdu10 with SMTP id u10so578737lbd.7 for ; Mon, 16 Feb 2015 11:56:09 -0800 (PST) X-Received: by 10.112.40.201 with SMTP id z9mr24690316lbk.117.1424116569436; Mon, 16 Feb 2015 11:56:09 -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 h5csp1787852lbj; Mon, 16 Feb 2015 11:56:08 -0800 (PST) X-Received: by 10.140.236.73 with SMTP id h70mr438586qhc.41.1424116567858; Mon, 16 Feb 2015 11:56:07 -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 b200si4342583qhc.93.2015.02.16.11.56.06 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 16 Feb 2015 11:56:07 -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 1YNRm0-0007TC-Rj; Mon, 16 Feb 2015 19:56:04 +0000 Received: from mail-qc0-f179.google.com ([209.85.216.179]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YNRlq-0007R7-4d for lng-odp@lists.linaro.org; Mon, 16 Feb 2015 19:55:54 +0000 Received: by mail-qc0-f179.google.com with SMTP id r5so25704385qcx.10 for ; Mon, 16 Feb 2015 11:55:49 -0800 (PST) X-Received: by 10.229.83.196 with SMTP id g4mr22577qcl.18.1424116548955; Mon, 16 Feb 2015 11:55:48 -0800 (PST) Received: from mike-desktop.?.holmesfamily.ws (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by mx.google.com with ESMTPSA id o10sm4832854qag.9.2015.02.16.11.55.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Feb 2015 11:55:48 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Mon, 16 Feb 2015 14:55:11 -0500 Message-Id: <1424116520-20381-2-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1424116520-20381-1-git-send-email-mike.holmes@linaro.org> References: <1424116520-20381-1-git-send-email-mike.holmes@linaro.org> X-Topics: Classification patch Subject: [lng-odp] [PATCH v2 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 cd1adeb..40c040f 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 a7344f8..7d9f73a 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -128,6 +128,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 cd8dc46..91f4ee7 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -76,7 +76,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; }