From patchwork Fri Jan 30 02:46:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 44001 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DF3F824128 for ; Fri, 30 Jan 2015 02:47:43 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id fb4sf205411wid.3 for ; Thu, 29 Jan 2015 18:47:43 -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=MDE21EWJmDCk0/r3ocgU10cFeQTDskBLYIXKbTgm3M0=; b=KK+7GbnMeSuaxwqb5DwxB9gGdSksM4HHIFU7joq5aemQVtmJIGBxO7oUs5V0zRftzT qwArrGqjPA8dI1V1DrJLe5ysTaxs7DQzx2YVSgDHPYaWy5QeeiXlgP00q5EWTvyI13D5 lp/fmnyvHFkY4df5ZVn+X5/djRUhgnyDzTfj0KNi7UQgDL5qgAAVO12U+vihyuA+2CIp p9RpWd94acyAFEY53GKK3FfjDoQrKEqpesVn36//b4Vl7O9RTEmQ13zD6ZIw4CH3qgv0 hXXcjKyFXmKau3gjXMaXe+3L8HoKlaPIYVsLVt5mwNg725LcPEcmkYB+03WCB3XbPX2Z OQ+A== X-Gm-Message-State: ALoCoQlayZ801Ib/i3it3y39qqVVfksWgI9HMOeNfPUtumJcs3d46u1YJHhJkP3k7lZyDgp8iyHp X-Received: by 10.180.93.165 with SMTP id cv5mr21344wib.6.1422586063225; Thu, 29 Jan 2015 18:47:43 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.2.99 with SMTP id 3ls389250lat.107.gmail; Thu, 29 Jan 2015 18:47:42 -0800 (PST) X-Received: by 10.112.166.73 with SMTP id ze9mr4348776lbb.38.1422586062857; Thu, 29 Jan 2015 18:47:42 -0800 (PST) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id r5si9057196lah.125.2015.01.29.18.47.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 Jan 2015 18:47:42 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by mail-la0-f48.google.com with SMTP id pv20so21382253lab.7 for ; Thu, 29 Jan 2015 18:47:42 -0800 (PST) X-Received: by 10.152.182.235 with SMTP id eh11mr4360348lac.9.1422586062393; Thu, 29 Jan 2015 18:47:42 -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 h5csp140804lbj; Thu, 29 Jan 2015 18:47:41 -0800 (PST) X-Received: by 10.229.27.73 with SMTP id h9mr8194792qcc.3.1422586061181; Thu, 29 Jan 2015 18:47:41 -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 n78si8839760qgd.59.2015.01.29.18.47.40 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 29 Jan 2015 18:47:41 -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 1YH1cQ-0002j9-HS; Fri, 30 Jan 2015 02:47:38 +0000 Received: from mail-qg0-f51.google.com ([209.85.192.51]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YH1c0-0002h3-A8 for lng-odp@lists.linaro.org; Fri, 30 Jan 2015 02:47:12 +0000 Received: by mail-qg0-f51.google.com with SMTP id z107so36363766qgd.10 for ; Thu, 29 Jan 2015 18:47:07 -0800 (PST) X-Received: by 10.224.88.196 with SMTP id b4mr8203035qam.14.1422586027169; Thu, 29 Jan 2015 18:47:07 -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.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Jan 2015 18:47:06 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Thu, 29 Jan 2015 21:46:49 -0500 Message-Id: <1422586015-29874-4-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: patch Subject: [lng-odp] [PATCH 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-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.215.48 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 Songming Signed-off-by: Mike Holmes --- platform/linux-generic/include/odp_internal.h | 1 + platform/linux-generic/odp_init.c | 5 +++++ platform/linux-generic/odp_packet_io.c | 20 ++++++++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index 56dc377..b2b595c 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -36,6 +36,7 @@ int odp_shm_init_local(void); int odp_buffer_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 d4a475f..97b4665 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -82,6 +82,11 @@ int odp_term_global(void) return -1; } + if (odp_pktio_term_global()) { + ODP_ERR("ODP pktio term failed.\n"); + return -1; + } + return 0; } diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index bdb690e..b3b51c8 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -79,6 +79,26 @@ int odp_pktio_init_global(void) return 0; } +int odp_pktio_term_global(void) +{ + odp_shm_t shm; + 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); + } + + shm = odp_shm_lookup("odp_pktio_entries"); + if (shm == ODP_SHM_INVALID) + return -1; + ret = odp_shm_free(shm); + + return ret; +} + int odp_pktio_init_local(void) { return 0;