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 B77E141D4F for ; Thu, 23 Feb 2023 10:40:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B314D431BA; Thu, 23 Feb 2023 10:40:35 +0100 (CET) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by mails.dpdk.org (Postfix) with ESMTP id 7FC264319C for ; Thu, 23 Feb 2023 10:40:34 +0100 (CET) Received: by mail-wm1-f45.google.com with SMTP id p18-20020a05600c359200b003dc57ea0dfeso9518339wmq.0 for ; Thu, 23 Feb 2023 01:40:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YXjU8pdKV5ZHXpOzWeaE1bJmtlPtzLMN5i0NU9ujsnQ=; b=G1/hJyg7ngCQ2u54kUDfx/LE9scgfdID9Mg5yusKIvWeVwaYO7yrSdAEkpxY1uk58Q iGzPjEoYvSBlHcr4n6ZZ9gBkS7yI/qVxNRMZQ3ygJUoCDNbPH5ew2qjoILwR/pwQO17P J8zYfjKiydrlnev/gWtdqy2GcvROj8+B2YkjsaEUXfrVdHjFqAfZ3iLh7g3Vr/fqYmXi mF49FUBaJMNbOdzwvkmYKGoXgAs/pTh6R81scJSVTUUWte4Nd7q6YaZtTrZT28yV9Ll5 84nsq+xqVejCsFrC+DGEpj3l05alu1MWR4/KCmbiPbrNLcYp+zcteuydIeuFzyUJU/UR i6YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YXjU8pdKV5ZHXpOzWeaE1bJmtlPtzLMN5i0NU9ujsnQ=; b=Z6PWr8pRAHs8c5csPnObr+m0BpS5oWejmlsQlbMRsjlVqTF5vtI6HlYooA0uYNqu3y RE1M2ShmtmZqo1mBAUFYIYYqQSGQHRIVSycqMEgrc4uHX+ElTOc2btYeNuCWIISBePHH m/iN3hdnwItZIO6MOAEPxqeHgyFk4F0MfSkagB+NQmVOw/iSQRA27qAGdxUa8aXp5jHe IkVnUYqqaZOYWg2Pbrlxn8M0q4gFjhfMBeaEoMMYDscCL86lVnstapVOtymYRImvVRes UzEFz0+DW6x4oA4jldv/03ySt7EfZgNx5zrNGa22fvwZTm6RpapHihPuEUzl6hJH7Y1p vgjA== X-Gm-Message-State: AO0yUKUeVF6HDGFVFeDGtuXkigjrEaoKZa/+jtFf6CVx9lHYhpZwDBWQ tQIl5dnJJw2T2biSbUCR34c= X-Google-Smtp-Source: AK7set9LUyKh/hTlII3slsy5/AD2lLy7K9gniyRE0KzIfJcl5vCz4j5s8GnDqf7XRW7Mbm6FuTJiRg== X-Received: by 2002:a05:600c:331b:b0:3e9:200:1f28 with SMTP id q27-20020a05600c331b00b003e902001f28mr3815855wmp.12.1677145234290; Thu, 23 Feb 2023 01:40:34 -0800 (PST) Received: from localhost ([137.220.119.58]) by smtp.gmail.com with ESMTPSA id 20-20020a05600c025400b003e71a6be279sm9154306wmj.37.2023.02.23.01.40.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 01:40:33 -0800 (PST) From: luca.boccassi@gmail.com To: David Marchand Cc: Aman Singh , dpdk stable Subject: patch 'app/testpmd: fix crash on cleanup' has been queued to stable release 20.11.8 Date: Thu, 23 Feb 2023 09:37:08 +0000 Message-Id: <20230223093715.3926893-64-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230223093715.3926893-1-luca.boccassi@gmail.com> References: <20230223093715.3926893-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Hi, FYI, your patch has been queued to stable release 20.11.8 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/25/23. 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/7dbf8ba3c72dca7b52e60796b5fb7a95258fb1a1 Thanks. Luca Boccassi --- >From 7dbf8ba3c72dca7b52e60796b5fb7a95258fb1a1 Mon Sep 17 00:00:00 2001 From: David Marchand Date: Mon, 6 Feb 2023 16:49:46 +0100 Subject: [PATCH] app/testpmd: fix crash on cleanup [ upstream commit 563fbd084b6b8de866d4fad9582f9eb071e6da0a ] If allocating the ports[] array fails, a crash will occur when shutting down testpmd since ethdev emits RTE_ETH_EVENT_DESTROY events. Move init_port() before registering ethdev event handler. Fixes: 85c6571c9103 ("app/testpmd: reset port status on close notification") Signed-off-by: David Marchand Acked-by: Aman Singh --- app/test-pmd/testpmd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 508f2c4268..f22c05920f 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -3898,6 +3898,9 @@ main(int argc, char** argv) rte_exit(EXIT_FAILURE, "Secondary process type not supported.\n"); + /* allocate port structures, and init them */ + init_port(); + ret = register_eth_event_callback(); if (ret != 0) rte_exit(EXIT_FAILURE, "Cannot register for ethdev events"); @@ -3916,9 +3919,6 @@ main(int argc, char** argv) if (nb_ports == 0) TESTPMD_LOG(WARNING, "No probed ethernet devices\n"); - /* allocate port structures, and init them */ - init_port(); - set_def_fwd_config(); if (nb_lcores == 0) rte_exit(EXIT_FAILURE, "No cores defined for forwarding\n" -- 2.39.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-02-23 09:36:30.831910081 +0000 +++ 0064-app-testpmd-fix-crash-on-cleanup.patch 2023-02-23 09:36:28.350172224 +0000 @@ -1 +1 @@ -From 563fbd084b6b8de866d4fad9582f9eb071e6da0a Mon Sep 17 00:00:00 2001 +From 7dbf8ba3c72dca7b52e60796b5fb7a95258fb1a1 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 563fbd084b6b8de866d4fad9582f9eb071e6da0a ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -20 +21 @@ -index a6c5dec4c0..0c14325b8d 100644 +index 508f2c4268..f22c05920f 100644 @@ -23,3 +24,3 @@ -@@ -4429,6 +4429,9 @@ main(int argc, char** argv) - rte_exit(EXIT_FAILURE, "Cannot init EAL: %s\n", - rte_strerror(rte_errno)); +@@ -3898,6 +3898,9 @@ main(int argc, char** argv) + rte_exit(EXIT_FAILURE, + "Secondary process type not supported.\n"); @@ -33 +34 @@ -@@ -4447,9 +4450,6 @@ main(int argc, char** argv) +@@ -3916,9 +3919,6 @@ main(int argc, char** argv)