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 92AEA42C4A; Wed, 7 Jun 2023 09:04:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7770B410FC; Wed, 7 Jun 2023 09:04:59 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 4A1FD40A84 for ; Wed, 7 Jun 2023 09:04:57 +0200 (CEST) Received: from kwepemi500020.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Qbdcy4Rn4zTkt9; Wed, 7 Jun 2023 15:04:34 +0800 (CST) Received: from [10.67.103.42] (10.67.103.42) by kwepemi500020.china.huawei.com (7.221.188.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 7 Jun 2023 15:04:54 +0800 Message-ID: <8732b6d3-45fd-21a9-4231-08526d6bd9bd@huawei.com> Date: Wed, 7 Jun 2023 15:04:53 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v3] app/test-pmd: fix not polling all queues without deferred starting To: Ferruh Yigit , Aman Singh , Yuying Zhang , Anatoly Burakov , Dmitry Kozlyuk , Matan Azrad CC: , References: <20230508031046.34346-1-haijie1@huawei.com> <20230529022649.51425-1-haijie1@huawei.com> <0d06a197-0df4-b4f4-1b1e-98419269d6bb@amd.com> From: Jie Hai In-Reply-To: <0d06a197-0df4-b4f4-1b1e-98419269d6bb@amd.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.42] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemi500020.china.huawei.com (7.221.188.8) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 2023/6/6 22:45, Ferruh Yigit wrote: > On 5/29/2023 3:26 AM, Jie Hai wrote: > >> >> Each stream has a read-only "disabled" field that control if this >> stream should be used to forward. This field depends on states >> of Rx/Tx queues, please see >> commit 3c4426db54fc ("app/testpmd: do not poll stopped queues"). >> >> Currently, the testpmd and DPDK frameworks maintain queue state >> separately. That of the primary process of testpmd are set by >> deferred_start in the queue configuration. And that of the >> framework(dev->data->rx_queue_state or dev->data->tx_queue_state) >> is set when the driver enables/disables the queue, and it is >> shared between the primary/secondary process. >> >> If the deferred_start is set, the queue is disabled and the >> corresponding queue state in the framework changes to stopped. >> However, the queue state in the framework does not only come from >> this. If the primary/secondary process stops a queue, the related >> queue state will change, too. However, the primary process of >> testpmd does not know the change brought by this operation. >> Therefore, setting the queue state in the primary testpmd by only >> the deferred_start is unsafe. >> >> For example, Rx/Tx queues who are stopped before the operations of >> stopping and starting port cannot forward packets after these >> operations on primary process. >> >> Therefore, the primary process should getting the queue state from >> of the framework as the secondary process does, please see commit >> e065c9aa3e05 ("app/testpmd: fix secondary process packet forwarding"). >> >> Fixes: 3c4426db54fc ("app/testpmd: do not poll stopped queues") >> Cc: stable@dpdk.org >> >> Signed-off-by: Jie Hai >> --- >> v1->v2: >> 1. Fix misspelled word 'deferred'. >> 2. Fix incorrect format of reference to commits. >> >> v2->v3 >> 1. Fix incorrect format of reference to commits. > > > Hi Jie, > > Problem is not clear for me. > Can you please describe more what is not working? > > . Hi Ferruh, Thanks for your question. Here's an example. step1: Start the app. dpdk-testpmd -a 0000:35:00.0 --file-prefix=test --proc-type=auto -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 can send or receive packets. 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. Jie Hai, Thanks