From patchwork Fri Nov 25 17:14:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 84182 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp179402qgi; Fri, 25 Nov 2016 08:15:31 -0800 (PST) X-Received: by 10.55.17.206 with SMTP id 75mr7137496qkr.10.1480090531314; Fri, 25 Nov 2016 08:15:31 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id r24si18367562qtb.183.2016.11.25.08.15.29; Fri, 25 Nov 2016 08:15:31 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 722F260AB9; Fri, 25 Nov 2016 16:15:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 58C5460B0C; Fri, 25 Nov 2016 16:15:22 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 3B2B160CFA; Fri, 25 Nov 2016 16:15:19 +0000 (UTC) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) by lists.linaro.org (Postfix) with ESMTPS id 32AE460AB8 for ; Fri, 25 Nov 2016 16:15:04 +0000 (UTC) Received: by mail-lf0-f48.google.com with SMTP id t196so53962643lff.3 for ; Fri, 25 Nov 2016 08:15:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Q73BPQ/ID8nwhOiygI0XdBYc04CrxDKQmtyhHouZ62k=; b=V+y/4Lm6emQ3FY7viaHmkMfhTzGplDTCbnRfKRhCDxj7Jf+2YxPh5ctog8+aHc+bK5 CPQyw/olbFJNcQcVt5qgdE8bQwOBF4NyG2kpjdTqWi5xs1byLcypXPfo2FKpOQ1Pt1Pb aJ8BkISj8jXpT39MHY4RBNElz71Du/hZhYGwjY862rwH/JxLjJ2se8diCF43JV9f0VIc OUyLyxvGX2vCLeYr47qL4tn4pMDPza3oN8N/vQEZ61ErO8tkKyzi4ls9hqsZtk6TB3Y7 qL5S/3Lk3qqLgv+e897iC7/U4ymCnLvnGLuckTQr6WTqRdiRiN7X9Y+3bsq3p8qibFaJ HE0A== X-Gm-Message-State: AKaTC01BSTHAR5eQjLPtn437zvr7LMhBCLMW4JVG+h+T2SkRNGcqcBQtuh1383bAfM1v0FKNTjo= X-Received: by 10.25.43.69 with SMTP id r66mr3256382lfr.158.1480090502928; Fri, 25 Nov 2016 08:15:02 -0800 (PST) Received: from erachmi-ericsson.ki.sw.ericsson.se (c-83-233-76-66.cust.bredband2.com. [83.233.76.66]) by smtp.gmail.com with ESMTPSA id v17sm9443947lja.43.2016.11.25.08.15.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 Nov 2016 08:15:02 -0800 (PST) From: Christophe Milard To: maxim.uvarov@linaro.com, mike.holmes@linaro.org, bill.fischofer@linaro.org, lng-odp@lists.linaro.org Date: Fri, 25 Nov 2016 18:14:35 +0100 Message-Id: <1480094076-20199-2-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1480094076-20199-1-git-send-email-christophe.milard@linaro.org> References: <1480094076-20199-1-git-send-email-christophe.milard@linaro.org> Subject: [lng-odp] [PATCH 1/2] linux-gen: packet_io: handling term_global while in CLOSE_PENDING X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" If odp_pktio_term_global() is called while a pktio in in state PKTIO_STATE_CLOSE_PENDING, a new close() is attempted on a already closed pktio, resulting as an abort. This patch fixes this. Signed-off-by: Christophe Milard --- platform/linux-generic/odp_packet_io.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 0b9939b..3524ff8 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -1054,7 +1054,7 @@ void odp_pktio_print(odp_pktio_t hdl) int odp_pktio_term_global(void) { - int ret; + int ret = 0; int i; int pktio_if; @@ -1073,7 +1073,9 @@ int odp_pktio_term_global(void) ODP_ABORT("unable to stop pktio %s\n", pktio_entry->s.name); } - ret = _pktio_close(pktio_entry); + + if (pktio_entry->s.state != PKTIO_STATE_CLOSE_PENDING) + ret = _pktio_close(pktio_entry); if (ret) ODP_ABORT("unable to close pktio %s\n", pktio_entry->s.name);