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 5BD92428F8 for ; Sun, 9 Apr 2023 17:29:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 50C5B410EF; Sun, 9 Apr 2023 17:29:47 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2045.outbound.protection.outlook.com [40.107.237.45]) by mails.dpdk.org (Postfix) with ESMTP id 2F1C140141 for ; Sun, 9 Apr 2023 17:29:46 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GVlHH+kMN+6VNDpgQhofbzMxzPdwz9Seu5fP6h0K0gj1NDCg3p+rSJ6BTnfppNkLi9OkC9hCgq1KHXecjfubArHJ8JJo2AvfqauoByPax4ldIpywvAxSzd4rMyMt+v53HXamYlXgaUpo187fZEZdHboPMqR9Mi1fohq9FTewbkUozDfd47ninWWI8B5N1oef+77vV7bnFRypZ84Y0YM1G+0NiQ6Le4QNHYOxex/aVm5KV0G8YcOZt3cx3lg9oPpG55cvkp/ximmGKwCrJOulI+BoECPCfSWmLuVAzfr1SWMj/1+BneK1zl54xVAr4pkUVMdjXbfsSJz7dCSo4hvaWA== 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=zrxeASAkS5dTIbdGnk1ffoI5XyDBoW2zg8bpNrK0uyA=; b=kd318bnsBREmZnMH6OqCX3ZaGxoNbjzGIP/TDr8KFhy2L/EO0FBP3Ydjnbk6EiGlNikfi15CwvFWSIwnrcVZzlaEuvWAlzcu65MBw57ebSBUn6Mwqo6SCsWAGuqa2b64Vi1Es+b0DS4YDkDnIUyCNY96PCvb/SSEVzZX1MQtB01x61KwAS6LL5xziT5A5lq/3Jo7qhU4MwvZFK1+1kjwA5eJJ8L2LXeEvDgTxjuTRNFu6C0MyXt9Efkl+xU9ojJMSNe9pBsOjZir9qoRgPVHXfqOPZvK140eViarXYwJZwuXwvqblmU1JXPo1vIVpovkBhaxAclLTJybgAzftCN+FA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=intel.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=zrxeASAkS5dTIbdGnk1ffoI5XyDBoW2zg8bpNrK0uyA=; b=GqStOHXialRcsjcVrZUeeU6hqegvK/J81UKgpCuH2Stiicd2PPs/xJSS+m4rSUuvfD0EIsr41Jlgafxpk8F1D9lZsPi1Dn+0ycVETcllA9J8ghdsNVQ2Tne9J3MuM4cIK1IFAusgob1W6fS8kOCjQODUAt60P5HG1HXAMlj0DULoXXvqxSd1ErcxuT5MmmBg4NHC8GhrWKBdyOl602l3UPkWwZ8TKxXNx4+wNL2Sb9bNsGW7CjMCUEQgE0CSyaX6UEKohtMlqhKuF/C4M5K8jeuK8B2H5qchDSsH+fViN0VEXy0xnPZRMJB3OHt+iOzF6WVRXCq2ISzw+9S++JSJ1g== Received: from DM6PR06CA0098.namprd06.prod.outlook.com (2603:10b6:5:336::31) by PH0PR12MB7814.namprd12.prod.outlook.com (2603:10b6:510:288::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.36; Sun, 9 Apr 2023 15:29:42 +0000 Received: from DM6NAM11FT084.eop-nam11.prod.protection.outlook.com (2603:10b6:5:336:cafe::a3) by DM6PR06CA0098.outlook.office365.com (2603:10b6:5:336::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.35 via Frontend Transport; Sun, 9 Apr 2023 15:29:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DM6NAM11FT084.mail.protection.outlook.com (10.13.172.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.25 via Frontend Transport; Sun, 9 Apr 2023 15:29:42 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Sun, 9 Apr 2023 08:29:37 -0700 Received: from nvidia.com (10.126.231.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; Sun, 9 Apr 2023 08:29:36 -0700 From: Xueming Li To: Shiyang He CC: Ferruh Yigit , dpdk stable Subject: patch 'app/testpmd: fix secondary process packet forwarding' has been queued to stable release 22.11.2 Date: Sun, 9 Apr 2023 23:23:54 +0800 Message-ID: <20230409152529.5308-47-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230409152529.5308-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230409152529.5308-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT084:EE_|PH0PR12MB7814:EE_ X-MS-Office365-Filtering-Correlation-Id: d0502407-dc7f-4633-a14f-08db390f3d8d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tqWS91td4S6QeAtRPVUNNid02xp6fCOK5n9xopI5V7HWOaANKEx628JNmLrFKDoitOGADF7YqMenUpy8Z8ofV+Z2Urs6YOjpUWVpnWYKLsVuEATIBrj2MEndvqiHn372xL+47uRYUYmVlI8JpIW7jM5oDKks5ZqxP+UbJmJZhvQs3FnR8QooCV3S8eit7UBK8nG41MfQX12hpk+qU9AjcT0hbnh2IUrqXAp7g9gO+N9dt1WgyyMs+FMDMltblZUijjhbhisJD99zxlVDGSYYYCoUyWALRQZdF3X+dPd/+zD1fcDJ9uMNuoh4n0sFrum6eMZ245AcDc8H8+IkE8sHdoGz4R2OrB0FvA/xO2m2mRb4He12OxiQwgFVB27aHzbFt/rSX0Ab/onF1qe+RPCdNEsYjqMK9kRU7ZeqMXkJOfocC1owuND7YsJ3di6ubu/s6aVyRaP/ghOfmPSYCbtxX74/CQYo+QKZnB8LgkU/azO4idAHSK00xC1I3yp9g9IzNMsh8luIbNjpn9+bOLHDdnkAHO4IFWIGxftolBaBWuqeJNtrXY3E7AqSEPQPdRBJV1TXHV0Bjg0GRTTwQDZEQixhBx4SCfrLgTRvMkwoLWKYV8nd8+F3ZHxorHks1ZMIOLstq/4WpY9ZdnjmrFmGTNORNYDInazptPmip1M4n5QqoYgUVDkxLo+yBdBatxBeEmdWTUueSPBDKh9orLDJkoyWXG9T9sh6dGzn8i0GxwQvln4c4dF96IqqsWm7/lwIeVt67tw+6aZyo1eusDO+N9gbh4NneCgosweQwbbHdm9WMWBsM5NlOPDcZJzGQYECFR8BxHzjP+V3iSmYr+oYUQ== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(136003)(346002)(396003)(376002)(451199021)(36840700001)(40470700004)(46966006)(7696005)(478600001)(86362001)(55016003)(40480700001)(83380400001)(47076005)(36756003)(40460700003)(40140700001)(82740400003)(7636003)(356005)(2616005)(36860700001)(426003)(336012)(6666004)(966005)(2906002)(54906003)(316002)(16526019)(6286002)(186003)(1076003)(53546011)(26005)(8676002)(6916009)(41300700001)(8936002)(5660300002)(82310400005)(4326008)(70586007)(70206006); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2023 15:29:42.1635 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d0502407-dc7f-4633-a14f-08db390f3d8d 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.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT084.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7814 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.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/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/log/?h=22.11-staging/commit/b0901e6d5b88bb3ec324e02b2dd2337a04faa387 Thanks. Xueming Li --- >From b0901e6d5b88bb3ec324e02b2dd2337a04faa387 Mon Sep 17 00:00:00 2001 From: Shiyang He Date: Wed, 8 Mar 2023 16:19:47 +0000 Subject: [PATCH] app/testpmd: fix secondary process packet forwarding Cc: Xueming Li [ upstream commit 5028f207a4fa6d5cdd86019e43d2e2d80fa21ced ] Under multi-process scenario, the secondary process gets queue state from the wrong location (the global variable 'ports'). Therefore, the secondary process can not forward since "stream_init" is not called. This commit fixes the issue by calling 'rte_eth_rx/tx_queue_info_get' to get queue state from shared memory. Fixes: 3c4426db54fc ("app/testpmd: do not poll stopped queues") Signed-off-by: Shiyang He Reviewed-by: Ferruh Yigit --- app/test-pmd/testpmd.c | 72 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index adf19cfb9e..60b5942d80 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2342,6 +2342,70 @@ launch_packet_forwarding(lcore_function_t *pkt_fwd_on_lcore) } } +static void +update_rx_queue_state(uint16_t port_id, uint16_t queue_id) +{ + struct rte_eth_rxq_info rx_qinfo; + int32_t rc; + + rc = rte_eth_rx_queue_info_get(port_id, + queue_id, &rx_qinfo); + if (rc == 0) { + ports[port_id].rxq[queue_id].state = + rx_qinfo.queue_state; + } else if (rc == -ENOTSUP) { + /* + * Set the rxq state to RTE_ETH_QUEUE_STATE_STARTED + * to ensure that the PMDs do not implement + * rte_eth_rx_queue_info_get can forward. + */ + ports[port_id].rxq[queue_id].state = + RTE_ETH_QUEUE_STATE_STARTED; + } else { + TESTPMD_LOG(WARNING, + "Failed to get rx queue info\n"); + } +} + +static void +update_tx_queue_state(uint16_t port_id, uint16_t queue_id) +{ + struct rte_eth_txq_info tx_qinfo; + int32_t rc; + + rc = rte_eth_tx_queue_info_get(port_id, + queue_id, &tx_qinfo); + if (rc == 0) { + ports[port_id].txq[queue_id].state = + tx_qinfo.queue_state; + } else if (rc == -ENOTSUP) { + /* + * Set the txq state to RTE_ETH_QUEUE_STATE_STARTED + * to ensure that the PMDs do not implement + * rte_eth_tx_queue_info_get can forward. + */ + ports[port_id].txq[queue_id].state = + RTE_ETH_QUEUE_STATE_STARTED; + } else { + TESTPMD_LOG(WARNING, + "Failed to get tx queue info\n"); + } +} + +static void +update_queue_state(void) +{ + portid_t pi; + queueid_t qi; + + RTE_ETH_FOREACH_DEV(pi) { + for (qi = 0; qi < nb_rxq; qi++) + update_rx_queue_state(pi, qi); + for (qi = 0; qi < nb_txq; qi++) + update_tx_queue_state(pi, qi); + } +} + /* * Launch packet forwarding configuration. */ @@ -2381,9 +2445,12 @@ start_packet_forwarding(int with_tx_first) if (!pkt_fwd_shared_rxq_check()) return; - if (stream_init != NULL) + if (stream_init != NULL) { + if (rte_eal_process_type() == RTE_PROC_SECONDARY) + update_queue_state(); for (i = 0; i < cur_fwd_config.nb_fwd_streams; i++) stream_init(fwd_streams[i]); + } port_fwd_begin = cur_fwd_config.fwd_eng->port_fwd_begin; if (port_fwd_begin != NULL) { @@ -3143,6 +3210,9 @@ start_port(portid_t pid) pl[cfg_pi++] = pi; } + if (rte_eal_process_type() == RTE_PROC_SECONDARY) + update_queue_state(); + if (at_least_one_port_successfully_started && !no_link_check) check_all_ports_link_status(RTE_PORT_ALL); else if (at_least_one_port_exist & all_ports_already_started) -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-04-09 21:45:39.964731200 +0800 +++ 0046-app-testpmd-fix-secondary-process-packet-forwarding.patch 2023-04-09 21:45:38.639042200 +0800 @@ -1 +1 @@ -From 5028f207a4fa6d5cdd86019e43d2e2d80fa21ced Mon Sep 17 00:00:00 2001 +From b0901e6d5b88bb3ec324e02b2dd2337a04faa387 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 5028f207a4fa6d5cdd86019e43d2e2d80fa21ced ] @@ -14 +16,0 @@ -Cc: stable@dpdk.org @@ -23 +25 @@ -index b6197aa258..0032696608 100644 +index adf19cfb9e..60b5942d80 100644 @@ -26,2 +28,2 @@ -@@ -2397,6 +2397,70 @@ common_fwd_stream_init(struct fwd_stream *fs) - fs->disabled = rx_stopped || tx_stopped; +@@ -2342,6 +2342,70 @@ launch_packet_forwarding(lcore_function_t *pkt_fwd_on_lcore) + } @@ -97 +99 @@ -@@ -2436,9 +2500,12 @@ start_packet_forwarding(int with_tx_first) +@@ -2381,9 +2445,12 @@ start_packet_forwarding(int with_tx_first) @@ -111 +113 @@ -@@ -3198,6 +3265,9 @@ start_port(portid_t pid) +@@ -3143,6 +3210,9 @@ start_port(portid_t pid)