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 68251431D5 for ; Sun, 22 Oct 2023 16:35:07 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 61273427E3; Sun, 22 Oct 2023 16:35:07 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2060.outbound.protection.outlook.com [40.107.243.60]) by mails.dpdk.org (Postfix) with ESMTP id 8B56F4114B for ; Sun, 22 Oct 2023 16:35:05 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S1mf0V6J3Tlqi3gEOBxwhAxdi6XQDkioHOXiuvXyTI6Xu+79cgYO1YpQsEXA4x2MYaPrNOEA9ER8jBtltdfUUrG+jFadMHDeKOlS08+dePh+n+SdmVeh29UPNx9Ti3fmV9c1zMm15x9Z9SxCogWjBh23jPNmHx/IAHXHF8VYDieu/XWsgwbLnXCfkaONFz0FEt2Xj7bkkv81dwfjtl3QC1QdkNwgt/RQ5NTdC/29IUu/uaK+To46tJn4jFLr53YY8FHor847fjw3fyu7tk0/LG4eJQ4rA0GNPwzOSWeCBJdVDlR3ya1hs7onN5msN3DbcZFyLfW8jOfubBV12C1pLg== 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=thkltRwaShpR68l/w69QW8WZ6KDVVkgfckazqc8fBVg=; b=WU358X0Prj8oxrssF5H5GP/k40A0TlTr9WNRctdRjpsFhi+YFrpOwbLvf0cJfNdTKevX04RPvkjwlevpIy3N8HRQk0x2AKRR2cOoJx3Q+LIxn/lD9hgII7qenOxKenSgX0MGmVUe3lOf01yww8SJy9snQksAmHzDwxtZ7kp6lzXRg0YfeEG51W50wuYQL1C9aatzQJD+lhhE++Q3wHXjy3eFiZEGgiZnOyZiczDts0EAsZ3ROK46PVMp62GCfE0t9FMQMR32o9kRV77lU96QBKXu1Eosr1MG0UJSPi0ac11sM33X3/pt62UVYBEW5AaUbcY48kCp5kTim8peaI/MsA== 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=thkltRwaShpR68l/w69QW8WZ6KDVVkgfckazqc8fBVg=; b=Ktzytih4wtJ3B8f489zjjZygERtkS5cyKHlDrbSvenHWlV8PGUA67HJJW83S2eKssz9jEiLosx4iFoJKdLM/N0YQcn9sCGM+AhmYsmvbrpBl0DLYfJFpg3kuw/ZcZEai0OWjW6Da/N5c0jYyM+Q6ycoRMjQ4+218jlQAIRmvC/JzpXac8D7DJ3xsXxIb7gWhEcnayewUrS3oR1k1cTOuXrUNUxl1dZCT3q5LfAYG+FTKYjONQ8KpCz6ZE3Cj1VBq0d/CyAyEPihQi+LRzLdcNQmL20cZMrFq9wZ6yGFlVCO2a3Pjjr2eoBoEm5Q6TQxJLHaFdWo7j6+pMJdZbMcSKQ== Received: from BL1PR13CA0108.namprd13.prod.outlook.com (2603:10b6:208:2b9::23) by PH0PR12MB5679.namprd12.prod.outlook.com (2603:10b6:510:14f::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26; Sun, 22 Oct 2023 14:35:03 +0000 Received: from BL02EPF0001A0FC.namprd03.prod.outlook.com (2603:10b6:208:2b9:cafe::e8) by BL1PR13CA0108.outlook.office365.com (2603:10b6:208:2b9::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.15 via Frontend Transport; Sun, 22 Oct 2023 14:35:02 +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 BL02EPF0001A0FC.mail.protection.outlook.com (10.167.242.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.15 via Frontend Transport; Sun, 22 Oct 2023 14:35:02 +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.41; Sun, 22 Oct 2023 07:34:54 -0700 Received: from nvidia.com (10.126.231.35) 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.41; Sun, 22 Oct 2023 07:34:52 -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.4 Date: Sun, 22 Oct 2023 22:22:47 +0800 Message-ID: <20231022142250.10324-139-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231022142250.10324-1-xuemingl@nvidia.com> References: <20231022142250.10324-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A0FC:EE_|PH0PR12MB5679:EE_ X-MS-Office365-Filtering-Correlation-Id: 86675172-2c5b-40a4-78b6-08dbd30c139b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cUPqGQn7R3amRNk8EvO8G3Ajx/b/gG33ZvuVJA883AWxMHoj17DDrBtBxsZ0ozSxiLV2aCPghgG8z87YSm+4s2/gink4ed/HKOdg545RzGTMT3tNg++2E1c268FQPP5D/NyKTTiNjiEo+bwC+AFv+yLZ5RjSKPQgYscaA6gTlBicnoOe9QK3Q/uf1gL6cZCVX+SZHfYtOdOFxA6IuxQ43pbI3QBhh2vRXQSlCrQuwyKQXOvGcxGviRorAEVzwhNtiYcuzSLNPkKItRSiXQ9vhG2SftxOdk5en3Bj56Md7a7dGyhBKQnGAlg7tSGnves6gs3KhbKE9hAAYjEXzgNHR3dvajosj1LQFOEJxyzU2IiGVUB8gR9RqkSymfsdhXJymr+PLiE40h7LgFrlTSG9H+jwGF0lFsrYG+Nl5tY6+BdSjAM3thbcIQLZza1WxnFTN+j0H3/PXozYCULoT4tpr983X5I0+O0ARP0ue7WLLhUW5IkeGqOQQR2GLBTZA6kJTiYL64UVhfNrxs+7K2Ga7hVcbOr8Y2CYYWu/9kG7FzZqn3eH30QEn6AtGIklI7E2XVmnwzJrT91FOwVzoYdHfle1GzZV6pfDLF+ouDkx99qUGVB5juX9tsXBxK3ovgqJklIpt7Szx9DcMTGApQjrJBjf6bTp1rNh4CvFabT1hVNhvrGOL5+VcVedIYebw48qNoTDd5LY8J5pr5X123BSpdhGdkE6hJJ+vOni++BpZbxT+NA/EbXIpAtsU8cy8jJSzKL8PuYCoaGPzVjdM2Hfjnc+sjsVQaXla83/xcnG5xI= 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:(13230031)(4636009)(136003)(376002)(39850400004)(396003)(346002)(230922051799003)(82310400011)(1800799009)(186009)(451199024)(64100799003)(36840700001)(46966006)(40470700004)(26005)(6286002)(16526019)(4001150100001)(2906002)(55016003)(41300700001)(40460700003)(86362001)(40140700001)(5660300002)(36756003)(36860700001)(8676002)(8936002)(4326008)(7696005)(478600001)(6666004)(7636003)(1076003)(2616005)(356005)(82740400003)(6916009)(316002)(54906003)(70206006)(70586007)(83380400001)(966005)(40480700001)(53546011)(426003)(336012)(47076005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2023 14:35:02.3206 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 86675172-2c5b-40a4-78b6-08dbd30c139b 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: BL02EPF0001A0FC.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB5679 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.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/15/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=d316924b1f2a91808c9333f9480fbd21fc5d0f32 Thanks. Xueming Li --- >From d316924b1f2a91808c9333f9480fbd21fc5d0f32 Mon Sep 17 00:00:00 2001 From: Jie Hai Date: Fri, 8 Sep 2023 19:29:01 +0800 Subject: [PATCH] app/testpmd: fix primary process not polling all queues Cc: Xueming Li [ upstream commit 37b68fa1445cb6fe287178607bac6fa3d90b835f ] 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 | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index b69b248e47..33c9888740 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 @@ -2394,12 +2408,15 @@ update_tx_queue_state(uint16_t port_id, uint16_t queue_id) } static void -update_queue_state(void) +update_queue_state(portid_t pid) { portid_t pi; queueid_t qi; RTE_ETH_FOREACH_DEV(pi) { + if (pid != pi && pid != (portid_t)RTE_PORT_ALL) + continue; + for (qi = 0; qi < nb_rxq; qi++) update_rx_queue_state(pi, qi); for (qi = 0; qi < nb_txq; qi++) @@ -2447,8 +2464,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(RTE_PORT_ALL); for (i = 0; i < cur_fwd_config.nb_fwd_streams; i++) stream_init(fwd_streams[i]); } @@ -3211,8 +3227,7 @@ start_port(portid_t pid) pl[cfg_pi++] = pi; } - if (rte_eal_process_type() == RTE_PROC_SECONDARY) - update_queue_state(); + update_queue_state(pi); 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-10-22 22:17:39.280415000 +0800 +++ 0138-app-testpmd-fix-primary-process-not-polling-all-queu.patch 2023-10-22 22:17:34.426723700 +0800 @@ -1 +1 @@ -From 37b68fa1445cb6fe287178607bac6fa3d90b835f Mon Sep 17 00:00:00 2001 +From d316924b1f2a91808c9333f9480fbd21fc5d0f32 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 37b68fa1445cb6fe287178607bac6fa3d90b835f ] @@ -61 +63,0 @@ -Cc: stable@dpdk.org @@ -70 +72 @@ -index b3d6ce7127..595b77748c 100644 +index b69b248e47..33c9888740 100644 @@ -73 +75 @@ -@@ -2425,6 +2425,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 @@ -@@ -2450,6 +2457,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 @@ -@@ -2464,12 +2478,15 @@ update_tx_queue_state(uint16_t port_id, uint16_t queue_id) +@@ -2394,12 +2408,15 @@ update_tx_queue_state(uint16_t port_id, uint16_t queue_id) @@ -118 +120 @@ -@@ -2517,8 +2534,7 @@ start_packet_forwarding(int with_tx_first) +@@ -2447,8 +2464,7 @@ start_packet_forwarding(int with_tx_first) @@ -128 +130 @@ -@@ -3281,8 +3297,7 @@ start_port(portid_t pid) +@@ -3211,8 +3227,7 @@ start_port(portid_t pid)