From patchwork Mon Feb 23 20:36:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robbie King X-Patchwork-Id: 44915 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4030821562 for ; Mon, 23 Feb 2015 20:37:25 +0000 (UTC) Received: by lbdu10 with SMTP id u10sf13954399lbd.3 for ; Mon, 23 Feb 2015 12:37:24 -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=AGfrSrD6NhWyHpyGos1yIWNAu/kLXJ/1BugaYoL5grE=; b=C9W9zKWBwKCwEGWTiWDETOrcs/9cePwKtgbIKmpPbSThPpfnAHG7YDpcs3s3Td+h/v D1ppYLTjoPVa7nwPfVRu3VQodvcwq2H9sbYMCfYu3Bgps1MlCHEHCvG7kEAwKKBfcom2 GdJrEoAoHDBnznfdJW6W5BVO86un9jz6bNTRU7R7ZQUSKmZn3sK3C959FPw9+HqmeT0Q UfhPfKe9ltbaiimJclwcnscs66PEB7gmkkRsAdFQGmFnbOF5Dbg7d/t40l1YR1gvc5iL Hx7QimwQ60YWI8S+cpc32T6V7SzczBQkLP0rqq/9tbtKNWYbxSaWmVZeIqorSAXZYJfr 3HMQ== X-Gm-Message-State: ALoCoQnRYq5IPraU5BAYBaMChUh0/0ks2FjEzz0b99FNWcHr3ZE+fKZpeBOXvVrtL3BlM4IFHkm9 X-Received: by 10.112.199.69 with SMTP id ji5mr1610247lbc.0.1424723844121; Mon, 23 Feb 2015 12:37:24 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.45.68 with SMTP id k4ls531872lam.85.gmail; Mon, 23 Feb 2015 12:37:23 -0800 (PST) X-Received: by 10.112.140.38 with SMTP id rd6mr11384980lbb.116.1424723843941; Mon, 23 Feb 2015 12:37:23 -0800 (PST) Received: from mail-lb0-x229.google.com (mail-lb0-x229.google.com. [2a00:1450:4010:c04::229]) by mx.google.com with ESMTPS id kv8si22344471lac.88.2015.02.23.12.37.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Feb 2015 12:37:23 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::229 as permitted sender) client-ip=2a00:1450:4010:c04::229; Received: by lbiz11 with SMTP id z11so21113111lbi.5 for ; Mon, 23 Feb 2015 12:37:23 -0800 (PST) X-Received: by 10.112.162.167 with SMTP id yb7mr11228012lbb.76.1424723843792; Mon, 23 Feb 2015 12:37:23 -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 h5csp1500345lbj; Mon, 23 Feb 2015 12:37:23 -0800 (PST) X-Received: by 10.229.197.134 with SMTP id ek6mr28965636qcb.21.1424723842513; Mon, 23 Feb 2015 12:37:22 -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 s7si24451787qgd.55.2015.02.23.12.37.20 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 23 Feb 2015 12:37:22 -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 1YPzkl-0002iL-Bw; Mon, 23 Feb 2015 20:37:19 +0000 Received: from alln-iport-7.cisco.com ([173.37.142.94]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YPzkI-0002cC-PO for lng-odp@lists.linaro.org; Mon, 23 Feb 2015 20:36:50 +0000 X-IronPort-AV: E=Sophos;i="5.09,633,1418083200"; d="scan'208";a="126182502" Received: from alln-core-2.cisco.com ([173.36.13.135]) by alln-iport-7.cisco.com with ESMTP; 23 Feb 2015 20:36:45 +0000 Received: from cpp-rtpbld-55.cisco.com (cpp-rtpbld-55.cisco.com [172.18.5.199]) by alln-core-2.cisco.com (8.14.5/8.14.5) with ESMTP id t1NKaimH002668 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 23 Feb 2015 20:36:45 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 t1NKaisS030602; Mon, 23 Feb 2015 15:36:44 -0500 Received: (from robking@localhost) by cpp-rtpbld-55.cisco.com (8.13.8/8.13.8/Submit) id t1NKahBd030601; Mon, 23 Feb 2015 15:36:43 -0500 From: Robbie King To: lng-odp@lists.linaro.org Date: Mon, 23 Feb 2015 15:36:00 -0500 Message-Id: <1424723769-8762-2-git-send-email-robking@cisco.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1424723769-8762-1-git-send-email-robking@cisco.com> References: <1424723769-8762-1-git-send-email-robking@cisco.com> X-Topics: Classification patch Subject: [lng-odp] [PATCHv3 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::229 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 b00506d..064deea 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 ODP_UNUSED, 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)