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 646CD4301E for ; Thu, 10 Aug 2023 01:52:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5BBEE40DD8; Thu, 10 Aug 2023 01:52:57 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2063.outbound.protection.outlook.com [40.107.93.63]) by mails.dpdk.org (Postfix) with ESMTP id CA13740DD8 for ; Thu, 10 Aug 2023 01:52:55 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LzljGqulXSrGKNmZR8HD/JouOdbHhJS9wD9Vg0vRFR/08AfWy2nRFHUaVmkfRRhKUKD++ApWNHdY7A2tqYQo19ZKr9T2yv7dhZkHjyvdh3WKxy1lOSqG4hy6JcXMDRg5HQQQdeIXyBwx+rLfY7vu6mcB0occKzl5h4416nqxGYRo4c1ppKXe/IZC4IaA8D/jqo706U2XY9NeTxhYdPbOG/Cag1G/Al3WPqiR4OnnV1M8QA7/y9hJlWEYjcSZY3BzfhOHEvCC7sJrCRNEne9gQsSqjrsQGzRZFPe4GNhFJkmn9LO6hqx48ia+NeSijxT3MFCViWNFIAYY8os7G9TKRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FXkCbitD9LQ+mtWABqd9N9YYV6tH1olf+dowVkJ/y7s=; b=LfHakQU6bjmhcjFAUKeW0yCDtRwaCLZZTDWRNSiivnfztWymsddQVz+iBgFbUgwZ6zrICUsfvIP23oSzH1FjdZJANxugY0qN+D8eu8KdJtJyBFDBlnfXtnK0he6BNhWb2v6Lf0HVs5cATMQaBwCg5mS/NqKjAOjqL07xFznoCS/W7PW8I8gayoOhXB7Mjwfgk31SvCmnryr+fx+BDKYdTjorCu31kVHXzjdxtRFryz23wtxM6ueEyAE2zEB4DaV4d4wGn9MCaTLQHnuZFOI4YghYPKuyCE4JPkFoSbnptcrOELkgPlceoyacj0GFrdai1RYAu/boxtBTXmuuUaWkQQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=huawei.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FXkCbitD9LQ+mtWABqd9N9YYV6tH1olf+dowVkJ/y7s=; b=IY36Jb9YETmoACVHd9eplcF1CkjzfD/h33scQjSySZYLunhciWU5PmYul0/z3qpFKrIw7mEsu9lhEWjnoSw+Fzbmy3GUIQbtfqwUr2Kv/owpTDRqYkOiKUWbuBvT/T6t3K4bbA1L15+6lAKZir08X/rTzxBTjcXXpyzmQTmAw8xM/nkhTSYRc+/drslWfb+GPK+6NudfdWAtB28ws7bc8OIyV95PrXShgTmwd2wlVIc8vMHEwfJfR5t1SqvdazctBGQo94ebzBzYYUXoJWRIB4r6pi4D+aK+S18gHdGpXt4fsEaotWWQBiC5+74Wbj8RmvOdvPg57cO9vNK9GrWM/g== Received: from CYZPR14CA0002.namprd14.prod.outlook.com (2603:10b6:930:8f::8) by CY5PR12MB6527.namprd12.prod.outlook.com (2603:10b6:930:30::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.30; Wed, 9 Aug 2023 23:52:54 +0000 Received: from CY4PEPF0000E9DB.namprd05.prod.outlook.com (2603:10b6:930:8f:cafe::fa) by CYZPR14CA0002.outlook.office365.com (2603:10b6:930:8f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.28 via Frontend Transport; Wed, 9 Aug 2023 23:52:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CY4PEPF0000E9DB.mail.protection.outlook.com (10.167.241.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.19 via Frontend Transport; Wed, 9 Aug 2023 23:52:53 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Wed, 9 Aug 2023 16:52:45 -0700 Received: from nvidia.com (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Wed, 9 Aug 2023 16:52:43 -0700 From: Xueming Li To: Jie Hai CC: Ferruh Yigit , dpdk stable Subject: patch 'app/testpmd: fix primary process not polling all queues' has been queued to stable release 22.11.3 Date: Thu, 10 Aug 2023 07:47:53 +0800 Message-ID: <20230809234930.32424-32-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230809234930.32424-1-xuemingl@nvidia.com> References: <20230625063544.11183-1-xuemingl@nvidia.com> <20230809234930.32424-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9DB:EE_|CY5PR12MB6527:EE_ X-MS-Office365-Filtering-Correlation-Id: 21137263-6eb1-4f45-5032-08db9933bf82 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xUrg0byIUdrMIQ9a3MK8MIfUWNHhBypcmFJcfsJGG5ktVaaaqigWeuzVqY/k7SW+YeqDqwqrUmnbdiDdeEMPH1U9R8vmBnRon4SH4H0hu7yVHb1BIGC7F5SqCMuPi3RzGmtI1B33zY91d3US1hac7QUBHsphY3IaY9hh7MgVu88ZsQwVoCOq5OA+KTQcXAsqwVz2CIZaaUsSyca/TwVm/eDr2z0ALjjbK64dkwDfHd0I6FsCrrWabpjJjo5i2VmZiuI1VVKrtvwwD3cxX1qSk9k5qwYmId/QW6FjU7Ra1B8DF/znlGU0Ky9FyeA3Uyu/qw7PSTgEDxkDHzrj3vBUt0zNjAkyfJU28O+X4/9yvj4Xk3hJfR0kvlRXBrBy+GuJPmx5Hr9ufpPYxDqKl0SiivfiwWm5hD18eGf5CVyRvdGOiC9B3bjpsCsP2zDMlHUktTwsMp6CwwY06DeZolv1IdRgHooD9DHjZUmKBcbXXcGJ/tWatdUAkR4SIEqiSVlfCUioJzUgLxU9ocGoGgPZAMAbMk4zMq1WJFfRY/4Iv7FpaQApXtffX7Na0UIxwD9KLTVageqLnFyQQO5Ko+Q4Q4HX3j2bvp1CluNwHzhS8sAl1mLHySr48jU7oR5At/9U384YQY8T/lKrGVn4DyvFh8Jfw551TYkbwSswXZU2+fb5nErlCUj+b28GPuqqggAU9WEpkKSZONzx8zs8chMeRkwL6Nt4Bm5BH+ZS2BkWF6uc6x/N3xBh5/EYuhJvEyZSqFL4IRp+WbSHvWzEwE/8hA== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(396003)(346002)(376002)(136003)(186006)(1800799006)(451199021)(82310400008)(46966006)(36840700001)(40470700004)(40480700001)(55016003)(40460700003)(426003)(83380400001)(47076005)(1076003)(336012)(6286002)(16526019)(2616005)(53546011)(26005)(36860700001)(4326008)(6916009)(54906003)(2906002)(41300700001)(478600001)(70206006)(70586007)(316002)(8936002)(6666004)(5660300002)(966005)(7696005)(8676002)(82740400003)(7636003)(36756003)(356005)(40140700001)(86362001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2023 23:52:53.7489 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 21137263-6eb1-4f45-5032-08db9933bf82 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000E9DB.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6527 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 22.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 08/11/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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=16a82d0d1a7bcea2a3bd5d51e6a8700702571b8d Thanks. Xueming Li --- >From 16a82d0d1a7bcea2a3bd5d51e6a8700702571b8d Mon Sep 17 00:00:00 2001 From: Jie Hai Date: Fri, 9 Jun 2023 17:03:40 +0800 Subject: [PATCH] app/testpmd: fix primary process not polling all queues Cc: Xueming Li [ upstream commit 141a520b35f789f37dc06557bc724bf7f0e0a52d ] Here's how the problem arises. step1: Start the app. dpdk-testpmd -a 0000:35:00.0 -l 0-3 -- -i --rxq=10 --txq=10 step2: Perform the following steps and send traffic. As expected, queue 7 does not send or receive packets, and other queues do. port 0 rxq 7 stop port 0 txq 7 stop set fwd mac start step3: Perform the following steps and send traffic. All queues are expected to send and receive packets normally, but that's not the case for queue 7. stop port stop all port start all start show port xstats all In fact, only the value of rx_q7_packets for queue 7 is not zero, which means queue 7 is enabled for the driver but is not involved in packet receiving and forwarding by software. If we check queue state by command 'show rxq info 0 7' and 'show txq info 0 7', we see queue 7 is started as other queues are. Rx queue state: started Tx queue state: started The queue 7 is started but cannot forward. That's the problem. We know that each stream has a read-only "disabled" field that control if this stream should be used to forward. This field depends on testpmd local queue state, please see commit 3c4426db54fc ("app/testpmd: do not poll stopped queues"). DPDK framework maintains ethdev queue state that drivers reported, which indicates the real state of queues. There are commands that update these two kind queue state such as 'port X rxq|txq start|stop'. But these operations take effect only in one stop-start round. In the following stop-start round, the preceding operations do not take effect anymore. However, only the ethdev queue state is updated, causing the testpmd and ethdev state information to diverge and causing unexpected side effects as above problem. There was a similar problem for the secondary process, please see commit 5028f207a4fa ("app/testpmd: fix secondary process packet forwarding"). This patch applies its workaround with some difference to the primary process. Not all PMDs implement rte_eth_rx_queue_info_get and rte_eth_tx_queue_info_get, however they may support deferred_start with primary process. To not break their behavior, retain the original testpmd local queue state for those PMDs. Fixes: 3c4426db54fc ("app/testpmd: do not poll stopped queues") Signed-off-by: Jie Hai Acked-by: Ferruh Yigit --- app/test-pmd/testpmd.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index b69b248e47..5c1388a8c0 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2355,6 +2355,13 @@ update_rx_queue_state(uint16_t port_id, uint16_t queue_id) ports[port_id].rxq[queue_id].state = rx_qinfo.queue_state; } else if (rc == -ENOTSUP) { + /* + * Do not change the rxq state for primary process + * to ensure that the PMDs do not implement + * rte_eth_rx_queue_info_get can forward as before. + */ + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + return; /* * Set the rxq state to RTE_ETH_QUEUE_STATE_STARTED * to ensure that the PMDs do not implement @@ -2380,6 +2387,13 @@ update_tx_queue_state(uint16_t port_id, uint16_t queue_id) ports[port_id].txq[queue_id].state = tx_qinfo.queue_state; } else if (rc == -ENOTSUP) { + /* + * Do not change the txq state for primary process + * to ensure that the PMDs do not implement + * rte_eth_tx_queue_info_get can forward as before. + */ + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + return; /* * Set the txq state to RTE_ETH_QUEUE_STATE_STARTED * to ensure that the PMDs do not implement @@ -2447,8 +2461,7 @@ start_packet_forwarding(int with_tx_first) return; if (stream_init != NULL) { - if (rte_eal_process_type() == RTE_PROC_SECONDARY) - update_queue_state(); + update_queue_state(); for (i = 0; i < cur_fwd_config.nb_fwd_streams; i++) stream_init(fwd_streams[i]); } @@ -3211,8 +3224,7 @@ start_port(portid_t pid) pl[cfg_pi++] = pi; } - if (rte_eal_process_type() == RTE_PROC_SECONDARY) - update_queue_state(); + update_queue_state(); if (at_least_one_port_successfully_started && !no_link_check) check_all_ports_link_status(RTE_PORT_ALL); -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-08-09 21:51:19.067969500 +0800 +++ 0031-app-testpmd-fix-primary-process-not-polling-all-queu.patch 2023-08-09 21:51:18.164352000 +0800 @@ -1 +1 @@ -From 141a520b35f789f37dc06557bc724bf7f0e0a52d Mon Sep 17 00:00:00 2001 +From 16a82d0d1a7bcea2a3bd5d51e6a8700702571b8d Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 141a520b35f789f37dc06557bc724bf7f0e0a52d ] @@ -61 +63,0 @@ -Cc: stable@dpdk.org @@ -70 +72 @@ -index c6ad9b18bf..1fc70650e0 100644 +index b69b248e47..5c1388a8c0 100644 @@ -73 +75 @@ -@@ -2424,6 +2424,13 @@ update_rx_queue_state(uint16_t port_id, uint16_t queue_id) +@@ -2355,6 +2355,13 @@ update_rx_queue_state(uint16_t port_id, uint16_t queue_id) @@ -87 +89 @@ -@@ -2449,6 +2456,13 @@ update_tx_queue_state(uint16_t port_id, uint16_t queue_id) +@@ -2380,6 +2387,13 @@ update_tx_queue_state(uint16_t port_id, uint16_t queue_id) @@ -101 +103 @@ -@@ -2516,8 +2530,7 @@ start_packet_forwarding(int with_tx_first) +@@ -2447,8 +2461,7 @@ start_packet_forwarding(int with_tx_first) @@ -111 +113 @@ -@@ -3280,8 +3293,7 @@ start_port(portid_t pid) +@@ -3211,8 +3224,7 @@ start_port(portid_t pid)