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 5D03242D0A; Tue, 20 Jun 2023 19:05:46 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E0E02410F6; Tue, 20 Jun 2023 19:05:45 +0200 (CEST) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2089.outbound.protection.outlook.com [40.107.101.89]) by mails.dpdk.org (Postfix) with ESMTP id C1A8C410D7 for ; Tue, 20 Jun 2023 19:05:43 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GAZ6M7A4ewrRlCVxHKgDJkjVPSouNrVsKCnlHUyM40iTVrS4GPaFn5l4oePpadCZTwTWWdoqqKko5VoTRx3kFpoVuXQUcoAP9NEVhQhIbWHg0vkIXc3qmR+r7m2yqmAwSHkYx6d2AcpAiwGd/VBS93AEA7fjtLsRbG8GGBIE8KGmikxgaySta3y8V0RflrFMTSoly4d0YrYyBtWbeTxuwtuTRaBKlPCdFCUfRJmy5GgdHeGP2/bmkk3e1RFemDA0i1xFD0/8ObctI/UNFvbMHojm/0QcD8U2HiO/K+YUwVvqtRpC1uqAD20E0Yuez+OiZ9jx7GnR8dC2nuTOhw79rg== 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=aYlJCZF0ZfCwnMWb8sXf3fvuJe0cKrfu+YU/DnrAmbA=; b=DV23TYmoNDu5fK+xdLhfMsNU6AsDPyJqW8A5br/8xhJMm40a0Af9zZAN20ATp9FXgXygGZmgE1gSScCpLWKdbEe1rdHm2UpX00JzE2BtWBmagP3hyzKDGt1F4z2qk+b+npyMhgcujqUaWL86gSJtCUDL50dw4bAXt+5h8+81/nAk5RYNmz8piw/MjUGn0h4r8NUOW+M+PxyhIuIGxMweNDWuORo5+bKGV9KYTahd8bwhJ7LR5QjgdFd/X97/9J1bYPKSrYbZbdFeoSblpk+7ECxUsymkCec96T2JbUNBlBAoljxhEoh4gcmngvZWXlUuFuC8cQIFNMyIgRLW4/nm5w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aYlJCZF0ZfCwnMWb8sXf3fvuJe0cKrfu+YU/DnrAmbA=; b=Rn9gnOAa7VkwcMXoUM0npyU27XxDh3lILuuQyaQaBri+sXRF+ul7OUTCefdM13kCBMg4JH0nZ1vuf0cauW1PZ5olsZagbgXFApBIAujDj69KGMBabXNfSQ2z8biUUrPZ3MDrQvz+IQYXorHG/lCUWdRr88TjxEO+qBaU9URexx4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by CH2PR12MB4892.namprd12.prod.outlook.com (2603:10b6:610:65::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Tue, 20 Jun 2023 17:05:40 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::16e3:326c:5c2a:be42]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::16e3:326c:5c2a:be42%3]) with mapi id 15.20.6500.036; Tue, 20 Jun 2023 17:05:39 +0000 Message-ID: <7dd51e5e-dea2-f883-fcd6-41df51aa022c@amd.com> Date: Tue, 20 Jun 2023 18:05:33 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v4] app/testpmd: fix primary process not polling all queues Content-Language: en-US To: Jie Hai , Aman Singh , Yuying Zhang , Anatoly Burakov , Matan Azrad , Dmitry Kozlyuk Cc: dev@dpdk.org, liudongdong3@huawei.com, shiyangx.he@intel.com References: <20230529022649.51425-1-haijie1@huawei.com> <20230609090340.3942-1-haijie1@huawei.com> <9a0a53e2-2566-f13a-96ce-3ec5b839bf81@huawei.com> From: Ferruh Yigit In-Reply-To: <9a0a53e2-2566-f13a-96ce-3ec5b839bf81@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P302CA0008.GBRP302.PROD.OUTLOOK.COM (2603:10a6:600:2c2::16) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|CH2PR12MB4892:EE_ X-MS-Office365-Filtering-Correlation-Id: 896fdd13-42b1-4be8-89b7-08db71b092ec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F4VrKAFtA8c4sN/4sFu2Cc3YTraFLxpdZ4PV0IFg+L0hvRpil/1DX0at24dYvG+a1X/8Zjfu0P6bk4ljsjsddCNR0goQe7zy3bYVJ8/xmYPn3mJugl9Tp1XBB8/EVmudSQ1xggIDzYnncfTm3L53tEgFu50gG4LaRVAEj3gxwfGbyrQp/sBTWipukPPHaMe49UiJqH8IHiImNKxpTdWrpG6V9pRqhZwCj5QsTQKEzukh6U0Dl2dui6ubcP15q8xuTAPkAkAmVGENZVCBS7uO9klBcX+CiE/3a6n0gTznGW04RMf7WmZY/wdMQ7NhLswkTeJxj2s/2iNK94TPo0pYZfufZztngoLHR1E0ZjPLom7cezd/M125kCynX8TUEdavh6bIUy/JDr04gMJj42KMwkKYsHUqM/nBFw2l1zQ3SUYxVyRjzYXgqkB0Ve+tyUDH1Hyb6snxZUGpDcKogHyPbwtFRBdagzCWXjs8OEUzXI01ee1MdmP0HRV6874x7dzgduQ4ESdvvmGnoE73hyCcoGYMq83uXqzwwgsHtTitp16WgluzEypMX+ZHCLdysWzGbAxvLuVXkDzr5OhHZwUnyfMfNAmfNSwsg8pln+2ty5wgIz1hCbWLLiIfwcKcKvwy9bQlVMnCpwOVvGoallFZRQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(396003)(346002)(366004)(39860400002)(376002)(136003)(451199021)(31696002)(83380400001)(31686004)(6486002)(6666004)(110136005)(316002)(38100700002)(8676002)(8936002)(2616005)(6506007)(6512007)(86362001)(36756003)(26005)(4326008)(186003)(41300700001)(5660300002)(53546011)(66946007)(66556008)(44832011)(66476007)(478600001)(2906002)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NHFxNFNNNGZtZlAyTTd4cnRyclRiTk8zRU5XVjdlRWN5STlVTDlHNGcvbzRJ?= =?utf-8?B?YjQwNTRhc1RaZVovN3lBS2NIQ05yYk9EK01kdEhCazk5ajVDaFBVUWQwc2Rr?= =?utf-8?B?NXkwSmNFVFd4THprdUFvQUlwSGt6MkRCZzB1WjJEWjFaa0hoeFVjcnc0WSto?= =?utf-8?B?OGtaVGtsVVpIdW1MRmRZbm1NeFNONmdOUkY2NFN5cnpSVnB2c1RoR3QzdWdt?= =?utf-8?B?WnlaaVU1aElqZ0tkdWFWT2VXZFNiNE5FTDRHR3FmcWVLOXRGYjVnVlFpTmFE?= =?utf-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a3llQ1lLcTFyTU9TWVI2RmI3K1VFTnFFTytZZVkwak1X?= =?utf-8?Q?4zfO3BWXFz9n3bRqzO5ojeZm+?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 896fdd13-42b1-4be8-89b7-08db71b092ec X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2023 17:05:39.7577 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pCnQWbxVbBIUGAV0KK7bh8cj6hysMIWKLUbP6PGQqMzI0uAtlisianHYExUDl6QG X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4892 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 6/20/2023 11:07 AM, Jie Hai wrote: > On 2023/6/9 19:10, Ferruh Yigit wrote: >> On 6/9/2023 10:03 AM, Jie Hai wrote: >>> 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") >>> Cc: stable@dpdk.org >>> >>> Signed-off-by: Jie Hai >>> >> >> Patch looks good to me, but since it has potential side effects, >> >> Can some from test team verify following before continue: >> a) Secondary testpmd >> b) Deferred Queue >> >> Thanks, >> Ferruh >> >> > Hi Ferruh, > > I tested them with hns3 driver. The results are the same before and > after the patch is applied. The results are as follows: > > case1: Secondary testpmd >     Action: Secondary testpmd stop a queue and primary testpmd start the > queue. >     Result: The queue can forward for both process. > > case2: >     Action: Set a queue with deferred_start on for a primary process. >     Result: The queue cannot forward until deferred_start is off. > Acked-by: Ferruh Yigit Applied to dpdk-next-net/main, thanks.