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 9F09242D07; Tue, 20 Jun 2023 12:57:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8AC234068E; Tue, 20 Jun 2023 12:57:21 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by mails.dpdk.org (Postfix) with ESMTP id DAFD7400D6 for ; Tue, 20 Jun 2023 12:57:20 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E68MbbVTt6czEZVR0gwTe9VOs8vhJXUXR9kgUsCUhNjnRky1H0CHYlSQDwAwIZ0zcbexR17U+bHR3xoa+4kOiEbYngPorTJNAczfIbqGZ4tz5ftpA5i248GAVCBg65BMIdX9VCdbe18hWWsRhKLh2zT0eZNwZs4Q8hcKBsFadGgXkw/cG82Rg1qlo36LoxxNl4pgqOn9aCfUMDx1yYEPpEIn69QeuyMqPxAi3SD0KVAIfPi8y/Gtpiih3XEo1bkLb/YAIxMlE/12bw9cdKB59IDHcPqYxDqlwVwcoFSSgbtPC0EeRsXdpDBpT4ug2Vkn3dhO7zFCV0YhPMT6DyTIKQ== 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=ss5hQ/381EzHzVayDAK/tqLghPjQ7YnQoubgBRI1KUQ=; b=TI/v2hkyo9FAMLrAdLlXvuIGcRV8FlEISurlFQaJaKYvXn6urMzz2BrAcxzwUeOsI8xOKRqmWz2NPdcJm4LW0XXeIAXRuwyqjyULHQgYXvcUL1GHcpepxZhHUY9oOba5p9FeECl/fu6wl6KGiseaqC+Pzg5GfBYjWy7TmlgkAZl0rDG7K4p5ID/co6oxCjvS0P8n3211fhhkFMeQ+L5GuA3uoRI2gukcpMcJ6JTZMBb+qPrWICyNmjN9GzpbisRCWJVVc4EHphJ6Bu8HgR1knJLjPGcxYR3zMzl+1sZIEbLuXbfVQvwH75wnQrjGrhmbvLj9i/aeiq+AJyhazvF/FQ== 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=ss5hQ/381EzHzVayDAK/tqLghPjQ7YnQoubgBRI1KUQ=; b=O6nSBRsEOp6uSKf/a1QvRGdw1hXMdWli748VHhRoSoqysIGxsPDh67YGD3YlxxdPbtntdA8DOtGXDztK2OUcMNbKuCEU4dSff9UoVRENsJHNyA237ieX3e1FWmX0KwhFR/Gw/eqBWX4oJyJKizvgZmpwDGV3bXDc7uOm9VNxE0E= 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 BL1PR12MB5285.namprd12.prod.outlook.com (2603:10b6:208:31f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.21; Tue, 20 Jun 2023 10:57:19 +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 10:57:18 +0000 Message-ID: <04ac2534-b2ef-f106-3762-7e2dbbeb0bf9@amd.com> Date: Tue, 20 Jun 2023 11:57:12 +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: LO2P123CA0102.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:139::17) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|BL1PR12MB5285:EE_ X-MS-Office365-Filtering-Correlation-Id: 55bc437e-0de6-4497-492f-08db717d1d9b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 42HSD92/wyXrVd5/pSTC22AxSWLEN7hBS+90mud1L2GFyiHAVaxAfMd++LilGLI8ASgSIYDKqoUPDTqzzHpDAqOe6NZllEyVmEDRHLTJHv7jlemai35FXY22zDNc72CZjnyc2ponc6uJBXB36p+OkgXLZPg2mTxWQ+VKSTOcaJdYafp8FokdrxFvVEvKdajxvJt1AL2J2GlqfhNnbh5dKSL7uA+l4P6TMByo5/rHRZN+Swz1CUEWAhwFxIyAPmTHAgVwPuUT2iZ1HIX8h+GrQ3duKVhelI0bb4fNm5fM7kFzzsfOddJzQA1YBUnl5Y5qwO1E1ESrlAQr5PQA5Qhlyt5hd7pNSPA2wcmL7Npu9exBtvlLaZOaS9F2zrQVh+HjdxsJRUBFRQxI/D/fwxO8ain+BhvyCrKFQFM8N6iMgjTGuotljdKAYYQeX1/Z2PJRCx/GH8mirzFCk3OV+dgefSAXc1w9UrVoY+WB3lYP7xKBJd0OtezkOogm/gr6HHImpZOP0Nq5/HA1t7++1k8ALZClNhlLu6zrIZhq42f4jPfq63+L7H1D7oUyKkXfcNZwqSAoygfIXnG9cwEwwKirTOQoGJ7g5aBWhxNXzWLykOgBu0bSBz+P/qt6gEwjQw6c03Eh+BRmMp5DMN8mQfLsPA== 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)(366004)(346002)(376002)(136003)(396003)(39860400002)(451199021)(6486002)(478600001)(2616005)(110136005)(6666004)(83380400001)(6512007)(53546011)(26005)(6506007)(186003)(2906002)(44832011)(5660300002)(36756003)(38100700002)(4326008)(66946007)(31696002)(316002)(86362001)(8936002)(8676002)(41300700001)(66476007)(66556008)(31686004)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?V3BnaE0weVh4Y3JQeVZ6SmRXclVrdHZ0K2RKMFdJWG91dy84dE5LSm96dFZo?= =?utf-8?B?QVNnK0x2NzVHamlOdmhWanFkYUxxMFVUKyt6aHNrNHRYRUtuLzAvT0h4akhK?= =?utf-8?B?RTF0dFFhOGlJRkFZYjdJKzE3YW5kZ2h0U0V1TTVUVnNsRW1rUnhhVEFQUEtF?= =?utf-8?B?SVUrVWQ0NWhWdDVkNW9vdGR4K2pmT0I5KzBlUkZ3L3NwWHlLSE05WndHek9Z?= =?utf-8?B?TUc4SmxDU05iVEVSbEVFUjlvK0xQRFN6Wk1BZ2tDbzdLVW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WVKeGJIM3pmMmVEcE84MkNHd0NVMmRrVFdk?= =?utf-8?Q?nMqHdCOhK1NdC864EJlhJc+po?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 55bc437e-0de6-4497-492f-08db717d1d9b X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2023 10:57:18.6221 (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: yGWSAlO3FasS1u4teMoti4tRMMvlVF9lmJt6qN616SBcDhEfxiBpDnAmoSMiGnuQ X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5285 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. > Thanks Jie, I will continue to process the patch.