From patchwork Mon Feb 16 19:55:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 44728 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f199.google.com (mail-we0-f199.google.com [74.125.82.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 69D0B21544 for ; Mon, 16 Feb 2015 19:56:19 +0000 (UTC) Received: by mail-we0-f199.google.com with SMTP id q59sf20779889wes.2 for ; Mon, 16 Feb 2015 11:56:18 -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=r1tAHbZXv1IzSsYiJX+3YWDQoEoerZaQe0Zq1WbOd3A=; b=GYbluIMbKj36PWI79yR7RJ+5ljoXWgcYUPJdG8r2CZl4/tGTDFDANlVQEl19m+fIaq 4RJdQugY8fOZrNmZozFfOTR5hS2DwCT1RBtHlUU+esUjZYrzlkdKo6PabSd29QfLTKgv HUglvEaHLXvU/5u5tk5jcGlrCZSsPOd7QqdpQXrDYr4rt15du0LZwdQ9xA+M16sXzieJ MwSa6/r4ods/RhL3aWmIXqc89U60G6ESlzB1kKCXAlgR5513iwpPtkx66u5Cfpnl9h4n dyZvIKwOtbcf4ZIJvb1Yf/cs4GhbgyLQQVbLPr/5hQ4lUzJlNQr9+Ktn3Ioqnx4yWDeI XiNg== X-Gm-Message-State: ALoCoQlCJnqcSb/El0vE+plO2Qw/iu5NBb4kNChYmNHg07y+OGrFAKBWzEpcY/QvXRmjnWVJrAWD X-Received: by 10.112.124.142 with SMTP id mi14mr3102542lbb.1.1424116578698; Mon, 16 Feb 2015 11:56:18 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.130 with SMTP id v2ls497395lae.98.gmail; Mon, 16 Feb 2015 11:56:18 -0800 (PST) X-Received: by 10.152.23.73 with SMTP id k9mr25646025laf.54.1424116578460; Mon, 16 Feb 2015 11:56:18 -0800 (PST) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id la5si9239798lac.113.2015.02.16.11.56.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Feb 2015 11:56:18 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbvp9 with SMTP id p9so595461lbv.3 for ; Mon, 16 Feb 2015 11:56:18 -0800 (PST) X-Received: by 10.152.116.18 with SMTP id js18mr24511553lab.106.1424116578321; Mon, 16 Feb 2015 11:56:18 -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 h5csp1787918lbj; Mon, 16 Feb 2015 11:56:17 -0800 (PST) X-Received: by 10.140.131.195 with SMTP id 186mr592169qhd.31.1424116577010; Mon, 16 Feb 2015 11:56:17 -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 e34si15348335qgf.109.2015.02.16.11.56.15 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 16 Feb 2015 11:56:16 -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 1YNRm9-0007Zs-Mc; Mon, 16 Feb 2015 19:56:13 +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 1YNRlr-0007R9-JC for lng-odp@lists.linaro.org; Mon, 16 Feb 2015 19:55:55 +0000 Received: by mail-qc0-f179.google.com with SMTP id r5so25704488qcx.10 for ; Mon, 16 Feb 2015 11:55:50 -0800 (PST) X-Received: by 10.229.65.8 with SMTP id g8mr64916qci.15.1424116550435; Mon, 16 Feb 2015 11:55:50 -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.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Feb 2015 11:55:49 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Mon, 16 Feb 2015 14:55:13 -0500 Message-Id: <1424116520-20381-4-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: patch Subject: [lng-odp] [PATCH v2 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.217.170 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 430d2fb..0120c53 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_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 9c2f9e7..cdce239 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -86,6 +86,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 559b230..ddd2342 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;