From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B2328A04A3 for ; Fri, 5 Jun 2020 20:26:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AA9101D510; Fri, 5 Jun 2020 20:26:50 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 95A7D1D51F for ; Fri, 5 Jun 2020 20:26:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591381608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cc1AeJl09ZS9oNUnm4tZFiOCnwqRb4EnB0s8P/HrSiU=; b=Hcc4VhRJFyfXZRRVWN7/Pj7TGyRzHBp4taEFgLqWSFyHgmPOxgCTnk3I0YvW7mdbKbLba0 Or6MIcL76oKbsTuBcenTkqR0QrHIYbMm7ykP0ZOuGKMEa4ah3+JoEf0kLiv61Wwu/kngNs v1TLPTZIrDVQ6ql9UbX1ccYbylyoU1M= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-163-Osi0JWk8Nd29sfg9kRN16w-1; Fri, 05 Jun 2020 14:26:45 -0400 X-MC-Unique: Osi0JWk8Nd29sfg9kRN16w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5E14D106C05D; Fri, 5 Jun 2020 18:26:41 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7977819063; Fri, 5 Jun 2020 18:26:40 +0000 (UTC) From: Kevin Traynor To: Harry van Haaren Cc: Jun W Zhou , dpdk stable Date: Fri, 5 Jun 2020 19:24:22 +0100 Message-Id: <20200605182525.22483-25-ktraynor@redhat.com> In-Reply-To: <20200605182525.22483-1-ktraynor@redhat.com> References: <20200605182525.22483-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'examples/eventdev: fix crash on exit' has been queued to LTS release 18.11.9 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/10/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/14d8bcafdcf1323ff19995ee09fa48da52a03beb Thanks. Kevin. --- >From 14d8bcafdcf1323ff19995ee09fa48da52a03beb Mon Sep 17 00:00:00 2001 From: Harry van Haaren Date: Tue, 5 May 2020 10:39:04 +0100 Subject: [PATCH] examples/eventdev: fix crash on exit [ upstream commit 2c434431f47c55e63b91cd32e7476cb8c15f3328 ] This commit fixes a segfault on exit by using Ctrl^C if the master lcore was also being used as a worker core. The root cause of the issue was that the interrupt handler was cleaning up resources such as the ethdev and eventdev ports, and once the interrupt handler would return, that thread would continue working as an eventdev worker, and dereference the memory which just had free() called on it. Fixed by moving the cleanup code from the interrupt handler to the cleanup stage of main(), which the master thread will execute once it has returned from its worker() functionality. Fixes: 085edac2ca38 ("examples/eventdev_pipeline: support Tx adapter") Signed-off-by: Harry van Haaren Tested-by: Jun W Zhou --- examples/eventdev_pipeline/main.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c index 04b30cf6ea..85d8a624bc 100644 --- a/examples/eventdev_pipeline/main.c +++ b/examples/eventdev_pipeline/main.c @@ -420,9 +420,4 @@ signal_handler(int signum) rte_eal_mp_wait_lcore(); - RTE_ETH_FOREACH_DEV(portid) { - rte_eth_dev_close(portid); - } - - rte_event_dev_close(0); } if (signum == SIGTSTP) @@ -442,4 +437,5 @@ main(int argc, char **argv) { struct worker_data *worker_data; + uint16_t portid; uint16_t num_ports; int lcore_id; @@ -579,4 +575,12 @@ main(int argc, char **argv) } + RTE_ETH_FOREACH_DEV(portid) { + rte_eth_dev_close(portid); + } + + rte_event_dev_close(0); + + rte_eal_cleanup(); + return 0; } -- 2.21.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-06-05 19:20:52.265707234 +0100 +++ 0025-examples-eventdev-fix-crash-on-exit.patch 2020-06-05 19:20:50.751042154 +0100 @@ -1 +1 @@ -From 2c434431f47c55e63b91cd32e7476cb8c15f3328 Mon Sep 17 00:00:00 2001 +From 14d8bcafdcf1323ff19995ee09fa48da52a03beb Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 2c434431f47c55e63b91cd32e7476cb8c15f3328 ] + @@ -18 +19,0 @@ -Cc: stable@dpdk.org @@ -23,2 +24,2 @@ - examples/eventdev_pipeline/main.c | 15 +++++++++------ - 1 file changed, 9 insertions(+), 6 deletions(-) + examples/eventdev_pipeline/main.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) @@ -27 +28 @@ -index d0da51b1c9..21958269f7 100644 +index 04b30cf6ea..85d8a624bc 100644 @@ -30 +31 @@ -@@ -302,10 +302,4 @@ signal_handler(int signum) +@@ -420,9 +420,4 @@ signal_handler(int signum) @@ -37 +37,0 @@ -- rte_event_dev_stop(0); @@ -41 +41,7 @@ -@@ -470,4 +464,13 @@ main(int argc, char **argv) +@@ -442,4 +437,5 @@ main(int argc, char **argv) + { + struct worker_data *worker_data; ++ uint16_t portid; + uint16_t num_ports; + int lcore_id; +@@ -579,4 +575,12 @@ main(int argc, char **argv) @@ -48 +53,0 @@ -+ rte_event_dev_stop(0);