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 D2C6142EF9 for ; Mon, 24 Jul 2023 03:58:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF6D140ED6; Mon, 24 Jul 2023 03:58:47 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id D5FC0406B7 for ; Mon, 24 Jul 2023 03:58:45 +0200 (CEST) Received: from kwepemi500019.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4R8NXT30xlzNmBn; Mon, 24 Jul 2023 09:55:21 +0800 (CST) Received: from kwepemi500020.china.huawei.com (7.221.188.8) by kwepemi500019.china.huawei.com (7.221.188.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 24 Jul 2023 09:58:43 +0800 Received: from kwepemi500020.china.huawei.com ([7.221.188.8]) by kwepemi500020.china.huawei.com ([7.221.188.8]) with mapi id 15.01.2507.027; Mon, 24 Jul 2023 09:58:43 +0800 From: haijie To: Kevin Traynor CC: Ferruh Yigit , dpdk stable Subject: RE: patch 'app/testpmd: fix primary process not polling all queues' has been queued to stable release 21.11.5 Thread-Topic: patch 'app/testpmd: fix primary process not polling all queues' has been queued to stable release 21.11.5 Thread-Index: AQHZux5TocvpTVcsyUKqEKivq21d4K/ILOjQ Date: Mon, 24 Jul 2023 01:58:42 +0000 Message-ID: References: <20230720151942.262154-1-ktraynor@redhat.com> <20230720151942.262154-95-ktraynor@redhat.com> In-Reply-To: <20230720151942.262154-95-ktraynor@redhat.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.67.103.42] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CFilter-Loop: Reflected 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, Kevin Traynor, Please drop this patch for it has been reverted and deferred to submit. Thanks,=20 Jie Hai -----Original Message----- From: Kevin Traynor [mailto:ktraynor@redhat.com]=20 Sent: Thursday, July 20, 2023 11:19 PM To: haijie Cc: Ferruh Yigit ; dpdk stable Subject: patch 'app/testpmd: fix primary process not polling all queues' ha= s been queued to stable release 21.11.5 Hi, FYI, your patch has been queued to stable release 21.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/25/23. So please shout i= f 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 rebasi= ng (ie: not only metadata diffs), please double check that the rebase was corr= ectly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/f7a4bf2feece51aa5a53db77= 59b7edd94d4fb76a Thanks. Kevin --- >From f7a4bf2feece51aa5a53db7759b7edd94d4fb76a 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 [ 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=3D10 --txq=3D10 step2: Perform the following steps and send traffic. As expected, queue 7 d= oes 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 expecte= d 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 mea= ns queue 7 is enabled for the driver but is not involved in packet receivin= g 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 queue= s 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 t= his stream should be used to forward. This field depends on testpmd local q= ueue state, please see commit 3c4426db54fc ("app/testpmd: do not poll stopp= ed queues"). DPDK framework maintains ethdev queue state that drivers reported, which in= dicates the real state of queues. There are commands that update these two kind queue state such as 'port X r= xq|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, causi= ng the testpmd and ethdev state information to diverge and causing unexpect= ed side effects as above problem. There was a similar problem for the secondary process, please see commit 50= 28f207a4fa ("app/testpmd: fix secondary process packet forwarding"). This patch applies its workaround with some difference to the primary proce= ss. Not all PMDs implement rte_eth_rx_queue_info_get and rte_eth_tx_queue_i= nfo_get, however they may support deferred_start with primary process. To n= ot 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 9f4a0e0a= 78..dbf6fd1fca 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2376,4 +2376,11 @@ update_rx_queue_state(uint16_t port_id, uint16_t que= ue_id) rx_qinfo.queue_state; } else if (rc =3D=3D -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() =3D=3D RTE_PROC_PRIMARY) + return; /* * Set the rxq state to RTE_ETH_QUEUE_STATE_STARTED @@ -2401,4 +2408,11 = @@ update_tx_queue_state(uint16_t port_id, uint16_t queue_id) tx_qinfo.queue_state; } else if (rc =3D=3D -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() =3D=3D RTE_PROC_PRIMARY) + return; /* * Set the txq state to RTE_ETH_QUEUE_STATE_STARTED @@ -2468,6 +2482,5 @= @ start_packet_forwarding(int with_tx_first) =20 if (stream_init !=3D NULL) { - if (rte_eal_process_type() =3D=3D RTE_PROC_SECONDARY) - update_queue_state(); + update_queue_state(); for (i =3D 0; i < cur_fwd_config.nb_fwd_streams; i++) stream_init(fwd_streams[i]); @@ -3127,6 +3140,5 @@ start_port(portid_t pid) } =20 - if (rte_eal_process_type() =3D=3D RTE_PROC_SECONDARY) - update_queue_state(); + update_queue_state(); =20 if (at_least_one_port_successfully_started && !no_link_check) -- 2.41.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- - 2023-07-20 16:18:06.547994881 +0100 +++ 0095-app-testpmd-fix-primary-process-not-polling-all-queu.patch 2023-07= -20 16:17:55.023751986 +0100 @@ -1 +1 @@ -From 141a520b35f789f37dc06557bc724bf7f0e0a52d Mon Sep 17 00:00:00 2001 +From f7a4bf2feece51aa5a53db7759b7edd94d4fb76a Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 141a520b35f789f37dc06557bc724bf7f0e0a52d ] + @@ -61 +62,0 @@ -Cc: stable@dpdk.org @@ -70 +71 @@ -index c6ad9b18bf..1fc70650e0 100644 +index 9f4a0e0a78..dbf6fd1fca 100644 @@ -73 +74 @@ -@@ -2425,4 +2425,11 @@ update_rx_queue_state(uint16_t port_id, uint16_t qu= eue_id) +@@ -2376,4 +2376,11 @@ update_rx_queue_state(uint16_t port_id, uint16_t=20 +queue_id) @@ -85 +86 @@ -@@ -2450,4 +2457,11 @@ update_tx_queue_state(uint16_t port_id, uint16_t qu= eue_id) +@@ -2401,4 +2408,11 @@ update_tx_queue_state(uint16_t port_id, uint16_t=20 +queue_id) @@ -97 +98 @@ -@@ -2517,6 +2531,5 @@ start_packet_forwarding(int with_tx_first) +@@ -2468,6 +2482,5 @@ start_packet_forwarding(int with_tx_first) @@ -105 +106 @@ -@@ -3281,6 +3294,5 @@ start_port(portid_t pid) +@@ -3127,6 +3140,5 @@ start_port(portid_t pid)