From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D864EA0524 for ; Fri, 5 Feb 2021 12:36:32 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC17E4067B; Fri, 5 Feb 2021 12:36:32 +0100 (CET) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by mails.dpdk.org (Postfix) with ESMTP id 5101E4067B for ; Fri, 5 Feb 2021 12:36:31 +0100 (CET) Received: by mail-wr1-f54.google.com with SMTP id l12so7354741wry.2 for ; Fri, 05 Feb 2021 03:36:31 -0800 (PST) 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=4a47TMV78+5CKbh63bBYh2Vb6cu4X/WxGdlqN0Uy0lg=; b=Oz2TrDKQ6KZPlb9Iws1QwCnBz92NndzTZdkQdOYSo+NDET+URNCOFBu8cva4AFWfql 9b7W/D+ItFP8JLlU3UcJ/3HzIeHlG5yE2urrNq424JK0PHI6XiBPTr8nlVyTAwLpqAzE YkHMLKdwgTbDJaGtvFe+qtaY8o+ikUs3HfnMRxnSOq61Ig47mw7nnf/VyR6p7wyxqCHF HZi0DIBcHqbrZQuQuEuz19DYzahYCgIHDpSrSC9FywdkMW2nU9zcS9XugN7ZvQkGj6+Q t7Rr+Uvhc/S5d/gPkIsA30YkzLnpa15RhjyOvUB0HUSl3YMtp9XYBiaitKnQ+p42yq3f E4kA== 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=4a47TMV78+5CKbh63bBYh2Vb6cu4X/WxGdlqN0Uy0lg=; b=lwGzu/9hfOHOTPAuY5t8jxT/lYpntSuQPc7DpDvfc7+Bc1+lpnGaN/lYyTAtaB+0P0 QFiuhUFCxnxbTxkceQgDygM99twb26v8Ec2brzWzUmg+rVz7oUDW0LrepPTyjQikcYbc 9Dx3qlOi5wPz0NxHlRzLQXsPTLrK29RUAoWoqfbIat/xJLfxQXQt4i58ZZthRZX2TuRG D+/V66KEx8Rulrnd8HWgGpVqsNViOnepf9bA77s8uOj60hgEzSzZ1ROk45iiBUKpFLq1 4nXTNzWXZWsjvgEcIhM2UhtfJOAxDG8OX4HuOyBPzLtWGFvRqV2RukGuLN8SPYtzXskD DeXw== X-Gm-Message-State: AOAM533I9flUsRsBYTkGhP5oxZNsx9kSs73u9yjxUAIbn9+avFnJFh+w 9R1Pf622hauen4uW4TnBXRo= X-Google-Smtp-Source: ABdhPJyHhmwDFekeSKoI87fltRH9+pQw5srdxuYqeLIezPytknYf3FIm4qHHZhVWZ0KqMBNqFUFs2g== X-Received: by 2002:adf:b60f:: with SMTP id f15mr4568510wre.83.1612524991138; Fri, 05 Feb 2021 03:36:31 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id l2sm8730004wmf.15.2021.02.05.03.36.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:36:30 -0800 (PST) From: luca.boccassi@gmail.com To: Feifei Wang Cc: Ruifeng Wang , Honnappa Nagarahalli , Harry van Haaren , Pavan Nikhilesh , dpdk stable Date: Fri, 5 Feb 2021 11:18:17 +0000 Message-Id: <20210205111920.1272063-211-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205111920.1272063-1-luca.boccassi@gmail.com> References: <20210205111920.1272063-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'examples/eventdev: move ethdev stop to the end' has been queued to stable release 20.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 20.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/07/21. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/bc0bca0bd70fc9ca376ff91055c90bf6d3e5811b Thanks. Luca Boccassi --- >From bc0bca0bd70fc9ca376ff91055c90bf6d3e5811b Mon Sep 17 00:00:00 2001 From: Feifei Wang Date: Thu, 14 Jan 2021 18:31:01 +0800 Subject: [PATCH] examples/eventdev: move ethdev stop to the end [ upstream commit f3527e0b97ae4adf2e1871e6f67b17968b4a9486 ] Move eth stop code from "signal_handler" function to the end of "main" function. There are two reasons for this: First, this improves code maintenance and makes code look simple and clear. Based on this change, after receiving the interrupt signal, "fdata->done" is set as 1. Then the main thread will wait all worker lcores to jump out of the loop. Finally, the main thread will stop and then close eth dev port. Second, for older version, the main thread first stops eth dev port and then waits the end of worker lcore. This may cause errors because it may stop the eth dev port which worker lcores are using. This moving change can fix this by waiting all worker threads to exit and then stop the eth dev port. In the meanwhile, remove wmb in signal_handler. This is because when the main lcore receive the stop signal, it stores 1 into fdata->done. And then the worker lcores load "fdata->done" and jump out of the loop to stop running. Nothing should be stored after updating fdata->done, so the wmb is unnecessary. Fixes: 085edac2ca38 ("examples/eventdev_pipeline: support Tx adapter") Suggested-by: Ruifeng Wang Signed-off-by: Feifei Wang Reviewed-by: Ruifeng Wang Reviewed-by: Honnappa Nagarahalli Acked-by: Harry van Haaren Acked-by: Pavan Nikhilesh --- examples/eventdev_pipeline/main.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c index 9982d5bfb0..3dbef6ed45 100644 --- a/examples/eventdev_pipeline/main.c +++ b/examples/eventdev_pipeline/main.c @@ -313,7 +313,6 @@ static void signal_handler(int signum) { static uint8_t once; - uint16_t portid; if (fdata->done) rte_exit(1, "Exiting on signal %d\n", signum); @@ -324,17 +323,6 @@ signal_handler(int signum) rte_event_dev_dump(0, stdout); once = 1; fdata->done = 1; - rte_smp_wmb(); - - RTE_ETH_FOREACH_DEV(portid) { - rte_event_eth_rx_adapter_stop(portid); - rte_event_eth_tx_adapter_stop(portid); - if (rte_eth_dev_stop(portid) < 0) - printf("Failed to stop port %u", portid); - } - - rte_eal_mp_wait_lcore(); - } if (signum == SIGTSTP) rte_event_dev_dump(0, stdout); @@ -485,6 +473,10 @@ main(int argc, char **argv) } RTE_ETH_FOREACH_DEV(portid) { + rte_event_eth_rx_adapter_stop(portid); + rte_event_eth_tx_adapter_stop(portid); + if (rte_eth_dev_stop(portid) < 0) + printf("Failed to stop port %u", portid); rte_eth_dev_close(portid); } -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:38.538992401 +0000 +++ 0211-examples-eventdev-move-ethdev-stop-to-the-end.patch 2021-02-05 11:18:29.166697965 +0000 @@ -1 +1 @@ -From f3527e0b97ae4adf2e1871e6f67b17968b4a9486 Mon Sep 17 00:00:00 2001 +From bc0bca0bd70fc9ca376ff91055c90bf6d3e5811b Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit f3527e0b97ae4adf2e1871e6f67b17968b4a9486 ] + @@ -29 +30,0 @@ -Cc: stable@dpdk.org