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 3D55342C6D; Fri, 9 Jun 2023 13:11:10 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CB83F40EDB; Fri, 9 Jun 2023 13:11:09 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2060.outbound.protection.outlook.com [40.107.223.60]) by mails.dpdk.org (Postfix) with ESMTP id 9A6F440A84 for ; Fri, 9 Jun 2023 13:11:08 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fFfK9/2I7AtECokwmPTqc2szJw5XH9ZVTqsyS3yG4yGCtlfDY3GrSZ0op3SOtAQqtAz0hE0GrMSHRSV8UiP2vGAEuF7msCzlDT35NEjiJdBLpvfmltmb4SYaID+VfBEqDlB2AP2FMTW25R+UDPwzXd95mMi2X3AawCJOYR6I3GHlH8kPzNw8NoRdE/4DnomfeV8WCW+1fVX7PgAPjItJHEtJa5kv3c5R+FMATbjJpuNUpBSqttrYFtENv2nXsbMFgHcRJSt2QKxZ9qNM416kLF2qtuukkuLbvnJV3EMa4M3ggnIrN49pW+VLocr7avIBP8YOrcfwCSWiqCmzJI5lQA== 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=07zNorhGKTLIi0XvhbIlf+5CwejiP5+WcWIgDtlVe4E=; b=ZSdCYgYdoXLZjGTERMl1GylvsIOHaj4mhk18VIm/j96QecEmszGDMwmib1IZYioIALmBMsiTbmAV9Vbc+mCzJOo+9yhlLxiFGragQtfohFFxXXTiX0mLy6XFEHMvVfRxU+f1CJIuiiyKqca6lZkxUDb1j6dN7DvwQOrtwirsNyWHpCuz+ZIdcQo3bVQxNSJmW4TEh8877V3/YTquX89kl6jU9NsATXWVQgTvlykCB5J3gI6Ar9VQdqT/JWfnNq/Bxp4PsR0DBXZLqlQIXyxTcEk5Pe3rvdMRCKDrdBjDq3P/Pbm2awgJsVaAD550zILYMG3KXI21ZvuxlC7+lbgRQg== 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=07zNorhGKTLIi0XvhbIlf+5CwejiP5+WcWIgDtlVe4E=; b=aIVeWt0CK9CTKq1mC9OKss4g26MToEYiCh1XpX3Fnp4KRuhsy8KOZSqkZ0K5RH0IUYgBc2XRI95S/suTSfB7s9xrxcXAHkgW28B+O1BdVjYy4jfgQG9YUvjisLvYxdGh79dHXnNkhnh6U5RZBBQznNjm2HIrNzvX3igNRZe7Z64= 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 DM4PR12MB7623.namprd12.prod.outlook.com (2603:10b6:8:108::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33; Fri, 9 Jun 2023 11:11:06 +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.6455.037; Fri, 9 Jun 2023 11:11:05 +0000 Message-ID: Date: Fri, 9 Jun 2023 12:10:58 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [PATCH v4] app/testpmd: fix primary process not polling all queues 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> Content-Language: en-US From: Ferruh Yigit In-Reply-To: <20230609090340.3942-1-haijie1@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0604.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:314::13) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|DM4PR12MB7623:EE_ X-MS-Office365-Filtering-Correlation-Id: 5ee9cba8-bed5-475e-1339-08db68da37df X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kMDlYKVQSUou/4+JmhFgc9thdpOjr0bOzCIXbXylKNZxMroQ4jelnnzjjTaFkHz8wvBJjj8XNqE5wr0Eja2CaAw7dMTRaDbw9Z9TlQMw7oKBKehMWIRQwyAXabczAvjzr+Ic3yGLSb5odh/t9WTuVnbFFYofQwKv8nExA6qU8K9TFzl6/z0z9JucSouaWnEAchCkacYTx2Q3bYrU2Xs425ecZ4qgzW18CqFQvR0D1QXHpT9rGZE9eVWq8Z0E4CK9RgqGomENsfvuZPEfnH8QVolXjTKPhAWIgZ8zvQrkiaXzosMZb5Mc+URp/NJqZd0cLlLQ2CQfBg04xY+Nea6hSHNVuM+HaQG/reu5DWrKvqg7olidsKcfmIZvZeacDfc6XvVT50eXvr/bYCVn5RcUsGFc2FXr+vQcxb8Ad9i5D+InI5lNUCj/YDMwDT8/EN5ELFVDdRHim3x17o1IAW67hQ0RRh13b4EsldLhL4PLtPDHmS/BXYM3mvOcB3WapUohiMct2AI5wJzcX+ir8Tsh9x/jn9RQ/r4bJjdmmv3xNoTZqpEf2yICQFBm0gOwwhYrr6gD+YvTRawOMOEW9oNYK/cKAhYi4LDKlBxzmkxKa8Or1k+6Zcp/Ao137G4UvindYaAs4czxE5DvnnGBHRLk1Q== 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)(136003)(346002)(366004)(376002)(39860400002)(396003)(451199021)(86362001)(6486002)(6666004)(2906002)(66946007)(66476007)(66556008)(41300700001)(38100700002)(8936002)(36756003)(110136005)(5660300002)(8676002)(44832011)(478600001)(31696002)(4326008)(316002)(2616005)(186003)(53546011)(6512007)(26005)(6506007)(31686004)(83380400001)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?a1FKZmUvR05TU1lZZWUyZ1AzSzRFWjlpWE9aQnhjSTNtTnluQVd3UHNydHZz?= =?utf-8?B?SjhJbkNDUVY5cktOc0h4aUFMbThSR2lKRDgwUEovV0hpZ05SMVU0L2pBei90?= =?utf-8?B?dlRNVCtQSTM4dkxNVkZBOXk4ZWI0L2taZ1hPaldJbmkwaHFSblZ2b1VzVkV2?= =?utf-8?B?TUJNS1ArZE84dVUyRTUrVlF1VHRSNkg4eUhUckZ3eEw4MmN3aGtIc0tneDQz?= =?utf-8?B?d1M4S2JCS01OU1RldHNPeng0ZXQxU3BUa3JUNnY0bHAxS2NkQm4vamFGQkQy?= =?utf-8?B?SnlYYjFYYmkzRVZuaVlFczJqdHZzdjhVZ0lUYmRsTVhFdndUY2NDNnZ2OG5C?= =?utf-8?B?WmRicUIv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Org: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ee9cba8-bed5-475e-1339-08db68da37df X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2023 11:11:05.4768 (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: XHXlprCq5JNk72CS303oZ+9C80+oxd2Kt5xz5i9TqD9V/fTzguvFrqQo7/lwOytQ X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7623 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/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