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 9AD97A0093 for ; Tue, 19 May 2020 15:14:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8EB851D921; Tue, 19 May 2020 15:14:42 +0200 (CEST) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id A0FBC1D921 for ; Tue, 19 May 2020 15:14:41 +0200 (CEST) Received: by mail-wr1-f65.google.com with SMTP id l18so15870170wrn.6 for ; Tue, 19 May 2020 06:14:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9hoT6VcBJt+0ZkMSjfebxkRSozT2xqWsxf8Qp8stVBw=; b=qRlD99sP7/CVouwvVKZfYV6w7yOjEK2Ou2eJ6ORh/HzHcNsA8Q6liaY8MSDAOU+pDe i4GT4SQFFytZ/2pys4Ja8yVg1mNrju+B0csrFiQUglLjZZPw2OdjWMn8rzp7dEQmabe5 3H7iZOnlLiGAqQp21qPHMeo6UH669ce29SgIHtMp/rLy4BPDV2fiayavcvz02KMU79Qb 6uVu2Y0S5wmBUEWM2DCsbJMIha8lhIONvLLSdjzLZ/6nM2cop+vc11O9Qs3QDdxt1zKF ni73KTvs4fwVcziHFpq4IE2fkteBuLQeO1HkJNNvr/tM7oBvB5QNkJriwxdEpk0+992K zC7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9hoT6VcBJt+0ZkMSjfebxkRSozT2xqWsxf8Qp8stVBw=; b=ONxfyA8Z7GHGHCqVBb4z5+j1JSl9BABywj52PDMiWBRo7UhkPMAL8NxN4c8WPkd0oV JlqPNXP1bkw6kv9R09cc+m6ZtUQRS9IeQSb6NmbVxZtf4bU5fjbsz/JeeyXjUMCFY3O2 syHx4crlIwjGiHKPldRuZY+0Op64sS2A/wkE+HD/LmH6L5bD1n9fu0gQdd0Qar8S/WB6 xsYpyIUe6IclY7ZUptVMkW8EpMnJsOKUgZluNyuEoGNSlZ7bd4/TlL1IGiuOqh3L/rdf chue3oD8w4J80nr6ldkYpZ45so2UFzu0zChAps+Mkj4avEe5p93YxwVcFq99YfijhAk9 a0qg== X-Gm-Message-State: AOAM532LrJwmZGH9heLPj11uEtKlawOV3UOVjiMr8AHp55S2oKehGm8A AQ8vgzzTC3hJTbPNfDeHgNS6kL+cAIADXfIP X-Google-Smtp-Source: ABdhPJzVQvS+LaieJnBLEI0owMm6H8c2OlisL/j9M4gjhQmH0RwLgdNXwC+KseXAln4HLGu+YlObKA== X-Received: by 2002:a5d:49ca:: with SMTP id t10mr24110585wrs.285.1589894081386; Tue, 19 May 2020 06:14:41 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id t22sm3742242wmj.37.2020.05.19.06.14.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:14:40 -0700 (PDT) From: luca.boccassi@gmail.com To: Harry van Haaren Cc: Jun W Zhou , dpdk stable Date: Tue, 19 May 2020 14:05:03 +0100 Message-Id: <20200519130549.112823-168-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'examples/eventdev: fix crash on exit' has been queued to stable release 19.11.3 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 stable release 19.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/21/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. Thanks. Luca Boccassi --- >From 2cb05361578d6ecb0b8517cb27e8d9974528b267 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 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c index d0da51b1c9..21958269f7 100644 --- a/examples/eventdev_pipeline/main.c +++ b/examples/eventdev_pipeline/main.c @@ -301,12 +301,6 @@ signal_handler(int signum) rte_eal_mp_wait_lcore(); - RTE_ETH_FOREACH_DEV(portid) { - rte_eth_dev_close(portid); - } - - rte_event_dev_stop(0); - rte_event_dev_close(0); } if (signum == SIGTSTP) rte_event_dev_dump(0, stdout); @@ -469,5 +463,14 @@ main(int argc, char **argv) } + RTE_ETH_FOREACH_DEV(portid) { + rte_eth_dev_close(portid); + } + + rte_event_dev_stop(0); + rte_event_dev_close(0); + + rte_eal_cleanup(); + return 0; } -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:51.359060969 +0100 +++ 0168-examples-eventdev-fix-crash-on-exit.patch 2020-05-19 14:04:44.512653738 +0100 @@ -1,8 +1,10 @@ -From 2c434431f47c55e63b91cd32e7476cb8c15f3328 Mon Sep 17 00:00:00 2001 +From 2cb05361578d6ecb0b8517cb27e8d9974528b267 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 @@ -15,7 +17,6 @@ it has returned from its worker() functionality. Fixes: 085edac2ca38 ("examples/eventdev_pipeline: support Tx adapter") -Cc: stable@dpdk.org Signed-off-by: Harry van Haaren Tested-by: Jun W Zhou