From patchwork Mon Feb 23 20:36:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robbie King X-Patchwork-Id: 44916 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 53E8D21562 for ; Mon, 23 Feb 2015 20:37:31 +0000 (UTC) Received: by lamq1 with SMTP id q1sf13704968lam.0 for ; Mon, 23 Feb 2015 12:37:29 -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=i7UYeCmxLWsJeuGlVDcPHS+Pw0w5zxZcANLmQrjHvyY=; b=IGP8ZRW6XoonjlvBTjRtcMVt5MzPU52e1zO1XgnCtG2X5oPKI+a0upCGhjrPFIZ3R/ fZeceSkDMVpWLGCZA0xLH2cZNkV5MOzSAc20vhKJOkDNXmP75O9p2r96LfwSzgXcUaeJ UixvgfyVtjYlJCh0ubLfsSTOn14RVnL+XmU+XZB7P/6iGmjQiKfVsxXTc85FLqn6GTw6 ct1ZQ4+JDW87gjrw8iWnYaNHNPeufiJZRrYMkj5p5Fz2NgS55hvDf7BJoLwDwzhiq3/f ugtj81hLdGJ3TCMHUavQ5P1syvomLcUhad5oQKcpbUMrqVJX0eQl6WWfPZD0Ef/GhYYE 8XVg== X-Gm-Message-State: ALoCoQnh0boom0824a7znSqG88LU3GECzNBk37n0zXhk8YsWlbRTRBGm6EHnvRv47ZORok/aBN28 X-Received: by 10.112.77.101 with SMTP id r5mr1678727lbw.4.1424723849843; Mon, 23 Feb 2015 12:37:29 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.169 with SMTP id x9ls161452lal.108.gmail; Mon, 23 Feb 2015 12:37:29 -0800 (PST) X-Received: by 10.152.1.170 with SMTP id 10mr11391951lan.89.1424723849536; Mon, 23 Feb 2015 12:37:29 -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 dq1si26845750lbc.161.2015.02.23.12.37.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Feb 2015 12:37:29 -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 z11so21113692lbi.5 for ; Mon, 23 Feb 2015 12:37:29 -0800 (PST) X-Received: by 10.112.185.66 with SMTP id fa2mr7581257lbc.117.1424723849257; Mon, 23 Feb 2015 12:37:29 -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 h5csp1500398lbj; Mon, 23 Feb 2015 12:37:28 -0800 (PST) X-Received: by 10.140.232.71 with SMTP id d68mr29192565qhc.52.1424723847804; Mon, 23 Feb 2015 12:37:27 -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 63si28796095qhw.118.2015.02.23.12.37.26 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 23 Feb 2015 12:37:27 -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 1YPzkp-0002ik-Q1; Mon, 23 Feb 2015 20:37:23 +0000 Received: from alln-iport-5.cisco.com ([173.37.142.92]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YPzkK-0002cD-V9 for lng-odp@lists.linaro.org; Mon, 23 Feb 2015 20:36:53 +0000 X-IronPort-AV: E=Sophos;i="5.09,633,1418083200"; d="scan'208";a="126187312" Received: from alln-core-4.cisco.com ([173.36.13.137]) by alln-iport-5.cisco.com with ESMTP; 23 Feb 2015 20:36:47 +0000 Received: from cpp-rtpbld-55.cisco.com (cpp-rtpbld-55.cisco.com [172.18.5.199]) by alln-core-4.cisco.com (8.14.5/8.14.5) with ESMTP id t1NKaluZ022994 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 23 Feb 2015 20:36:47 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 t1NKakDX030616; Mon, 23 Feb 2015 15:36:46 -0500 Received: (from robking@localhost) by cpp-rtpbld-55.cisco.com (8.13.8/8.13.8/Submit) id t1NKaj7B030615; Mon, 23 Feb 2015 15:36:45 -0500 From: Robbie King To: lng-odp@lists.linaro.org Date: Mon, 23 Feb 2015 15:36:02 -0500 Message-Id: <1424723769-8762-4-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: patch Subject: [lng-odp] [PATCHv3 03/10] linux-generic: packet_io: 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 Songming Signed-off-by: Mike Holmes Signed-off-by: Robbie King --- platform/linux-generic/include/odp_internal.h | 1 + platform/linux-generic/odp_init.c | 5 +++++ platform/linux-generic/odp_packet_io.c | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+) diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index 9ae8530..e43608d 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -41,6 +41,7 @@ int odp_shm_init_local(void); int odp_pool_init_global(void); int odp_pktio_init_global(void); +int odp_pktio_term_global(void); int odp_pktio_init_local(void); int odp_classification_init_global(void); diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index 645ac10..48bc9a2 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -88,6 +88,11 @@ int odp_term_global(void) rc = -1; } + if (odp_pktio_term_global()) { + ODP_ERR("ODP pktio term failed.\n"); + rc = -1; + } + return rc; } diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index c5d0569..a405bd7 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -79,6 +79,24 @@ int odp_pktio_init_global(void) return 0; } +int odp_pktio_term_global(void) +{ + pktio_entry_t *pktio_entry; + int ret = 0; + int id; + + for (id = 1; id <= ODP_CONFIG_PKTIO_ENTRIES; ++id) { + pktio_entry = &pktio_tbl->entries[id - 1]; + odp_queue_destroy(pktio_entry->s.outq_default); + } + + ret = odp_shm_free(odp_shm_lookup("odp_pktio_entries")); + if (ret < 0) + ODP_ERR("shm free failed for odp_pktio_entries"); + + return ret; +} + int odp_pktio_init_local(void) { return 0;