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 D2364A00C5 for ; Wed, 24 Aug 2022 20:22:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C3FD1415D7; Wed, 24 Aug 2022 20:22:00 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id EBF4F4067B; Wed, 24 Aug 2022 20:21:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661365318; x=1692901318; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=QE5R2Ye8Ta67JkqIcUBcjGSdwdcccW7aa2CkCy6pbfs=; b=ZAbqg3kinN4DfTOXr6PSeScJtpdYLp0elXV/tx7WSBfoh5erYkTr6ZBS CsLtvBsnRsx1N2KI9NIXDsOxmyAuYmwNQ0JS6Y0llEFCWpdmKkPAky4De ate68Q7E/y/WmaLs9lnPDFX0Bbdcl6u/a6rwRqOZ23eJQBRJuKwvoZsp0 JK/johzPmyzJ1IpZf/sqJi59ZjjC6UVJoTS0jWOO+p/1yWTocv4LRzgjr s1y1JhkdhxBOXqrs2sLfe5tLvuSypseD7LGuKD8MLTlwU21TG6Ea0GNRM VTIWsCDrV+lBXBMOgDRtIyg5q5D3tTav3uzzTLqUYKyZ1kZx1C5moToJ3 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10449"; a="355766965" X-IronPort-AV: E=Sophos;i="5.93,261,1654585200"; d="scan'208";a="355766965" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Aug 2022 11:21:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,261,1654585200"; d="scan'208";a="612886772" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga007.fm.intel.com with ESMTP; 24 Aug 2022 11:21:56 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 24 Aug 2022 11:21:55 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 24 Aug 2022 11:21:55 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Wed, 24 Aug 2022 11:21:55 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.102) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Wed, 24 Aug 2022 11:21:55 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BNdbAGLSzTr/opB13+6PIyn3uEqs/4PzDGjfGk4YRgLVcu+BKG5dBMCIcmH5OEDk7aXqcbOETZFXrxURbH5p2lTkEDDnOJUi2UXK+8MxrHHwcNEKeBaaLYpjXSX4LtRv1tsoLlOb6Zxjn+bmdXWnk18T46e9cvwTRNdYipAyub/NOOOcGxB5Lb1wFyC2D3IwlKKUHRTQtcDWJIU3/nEnkK0yDYBEjEidGP4erO0KsBLucEznUdE3SMTpJiEdMdbxtD4jh6Y+2XvCy8rdS9mz5xUWhRTYcq/TUn9pP9l0HAj/hCbfFYSgdqOyoq57tHKxqUvzW13YcX5xukp1HDpMVg== 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=AdkToPQOhGd3zLSVYHLOPgm0fD8TH6ULKKxY+VsceLI=; b=locf6rdb5kTfNZCzEyuA1noSxM+cC5SH6OKVrgHdsVM6zFIiRVCfs40Iv4Mm7Q1E7045jfACX6VhiniePGTkZhZvEkKuWDFehQEEgi8HL9BNhrwOPvLHAPt8lVKRgoOAvwoCaDSl65o4COblKX/Po5G/xYnCybEXje0Kty8sGLZL/FXXSl+l5fqZw+mwYnZjD8IbW0ig8q8jHNeB8YmNzeEvdEn4nlYVGILn+zT82ql18YjW+fsyFug36NC8lXZ4UqfeWIdQL7MbuLpzVjjMIChluE2NKgdicHB3c6gJE8jCyJKOLaovODjriZVbtcIDkQQqyyi6nwq0/RsOn/VQSg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MWHPR11MB0062.namprd11.prod.outlook.com (2603:10b6:301:67::34) by DM5PR11MB2060.namprd11.prod.outlook.com (2603:10b6:3:13::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.22; Wed, 24 Aug 2022 18:21:53 +0000 Received: from MWHPR11MB0062.namprd11.prod.outlook.com ([fe80::a1ba:16c8:819c:4234]) by MWHPR11MB0062.namprd11.prod.outlook.com ([fe80::a1ba:16c8:819c:4234%6]) with mapi id 15.20.5546.022; Wed, 24 Aug 2022 18:21:53 +0000 Message-ID: <6e453332-00ea-0ead-1bf8-3e24975e742e@intel.com> Date: Wed, 24 Aug 2022 23:51:43 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v2] app/testpmd: fix incorrect queues state of secondary process Content-Language: en-US To: , CC: , References: <20220623181502.181567-1-peng1x.zhang@intel.com> <20220819100940.657437-1-peng1x.zhang@intel.com> From: "Singh, Aman Deep" In-Reply-To: <20220819100940.657437-1-peng1x.zhang@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BM1PR01CA0148.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:68::18) To MWHPR11MB0062.namprd11.prod.outlook.com (2603:10b6:301:67::34) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 23708db2-07a1-47e8-3c8a-08da85fd850b X-MS-TrafficTypeDiagnostic: DM5PR11MB2060:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Y8i5ndvOITfli6qcqlq/vibIO4Ok6vk+IhFMFKQLLt04HXm4tPXBYGhUCPTah3COxPzGWgaZNnuGMHauW4pEGnZsSwFWywHM37bWCcT6TOO0q5VBB2BqUP/FPmikGR/F5JrnYU1/+Rw7ACGfKWv/P86qejW8TnxYFgAcvCYci/d51RJ2MExOKNlUGglMQb3vrbdA+TQTAJ8j8GG+pUzqIwtjr0a9Vz4QAy4EuQM1P1MKyMyJJ28us86m3HoqgUEPWtkVUjZKEs3bRF6LBK+ZeLxFFnhAdUxv0+heoB55WBj7Fx6iTKLfWpehU0C1rVXKYTpeWFqrXsnTo0CGRnVYmSluKwQ3lUI2ZzXnOYOoLaLMVA1VEp99PMjQvx6Gk5kFNdVIxop9OaAj7Lub2DPfvRZL/H8UtNSHySvE4oWrUSrGCGCwr+ZBj/+oXmBRC8lRTxELyJmiaMS2f2BelnIy+QRmxS7n4TWPtMPq1CSPVDRYhH9L8fwYaZyrpK34+ewUKIJ5h5mSMqhAdp9u/cZXJI4rnMv7q3tA2ksUvhhsxojSmcksAXb/sRN45/S9LbrGq22D19fDqmkGrLDt1j08lTVkfZGwAUDkiBUPIS6upolfOl2Ot3xVipf0q6PMplcM26QcN6pUjqJPnE1SRu7iS08n4iulLkRgjbItGH4Tu3Pw4C7377Gux+hf/g1FnmhxBilZNAe3ysKmPtTEDNXUS1M8AtZ2p8np6Jty/5bjtEhORHFuqArZWpVGN7/JKU2b9RbjYwq5jBFveWvIODhfWlhwF2ifTOvMFh2DtzMOlZE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB0062.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(136003)(366004)(376002)(39860400002)(346002)(396003)(31686004)(6666004)(316002)(2906002)(82960400001)(53546011)(6486002)(478600001)(36756003)(66476007)(5660300002)(2616005)(26005)(4326008)(66556008)(6512007)(450100002)(8676002)(66946007)(6506007)(38100700002)(41300700001)(186003)(83380400001)(86362001)(31696002)(8936002)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RERtK1dtc0s2NkMxYlpIdW5uVVl4UHg5MngrRjIvdFR6ZUZDRDJzM0VoMW9Y?= =?utf-8?B?MU1qTFNac2lpN29HRjF0bnNXWVlYZjg2QWdTUUIvREdJSDlnZHBYK0g2N1Nh?= =?utf-8?B?OUxheStKSnBMY0J4K054cXRuU3lndi9lRmZrN09RVERyanY5OE9IY1NDTFBI?= =?utf-8?B?VERvR1RFZlJVTjBpYWZTdGZIQzl0M0c0dEkyUHNTejlxNzhHUTViQTMwQnJU?= =?ut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FmYTlIVWptOFZzcGhob3dQeUlUZU5XS1ZWMDJh?= =?utf-8?B?V0Zvd0V3SzMwMVNOR21rYk5xNDFBd2Q5ZzRvM3VFa2NZU3F0YlhQVXZiVy9s?= =?utf-8?B?dnpYTmV0RzJYWGx6VStlNlprellYRzZNRzdFalNNaEw3NzNxQjZDS21BcjJH?= =?utf-8?B?SWc9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 23708db2-07a1-47e8-3c8a-08da85fd850b X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB0062.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2022 18:21:53.4953 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6svs0C1T6OPiiwcNL4WBgGMef4S5DbnuexzZMjiHvSXK5tIAoo4hUdAgGkgUeMtGBdOdVW7XNZvp9fHwu6MZpCs8/f3f+t18MAHTDzmzI24= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB2060 X-OriginatorOrg: intel.com 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 Peng, On 8/19/2022 3:39 PM, peng1x.zhang@intel.com wrote: > From: Peng Zhang > > Primary process could set up queues state correctly when starting port, > but under multi-process scenario, "stream_init" function would get wrong > queues state for secondary process. > > This commit is to get queues state from ethdev which is located in > shared memory. > > Fixes: 3c4426db54fc ("app/testpmd: do not poll stopped queues") > Cc: stable@dpdk.org > > Signed-off-by: Peng Zhang > --- > app/test-pmd/testpmd.c | 20 ++++++++++++++++++-- > 1 file changed, 18 insertions(+), 2 deletions(-) > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > index addcbcac85..70f907d96b 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -75,6 +75,8 @@ > > #include "testpmd.h" > > +#include > + > #ifndef MAP_HUGETLB > /* FreeBSD may not have MAP_HUGETLB (in fact, it probably doesn't) */ > #define HUGE_FLAG (0x40000) > @@ -2402,9 +2404,23 @@ start_packet_forwarding(int with_tx_first) > if (!pkt_fwd_shared_rxq_check()) > return; > > - if (stream_init != NULL) > - for (i = 0; i < cur_fwd_config.nb_fwd_streams; i++) > + if (stream_init != NULL) { > + for (i = 0; i < cur_fwd_config.nb_fwd_streams; i++) { > + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { > + struct fwd_stream *fs = fwd_streams[i]; > + struct rte_eth_dev_data *dev_rx_data, *dev_tx_data; > + > + dev_rx_data = (&rte_eth_devices[fs->rx_port])->data; > + dev_tx_data = (&rte_eth_devices[fs->tx_port])->data; > + > + uint8_t rx_state = dev_rx_data->rx_queue_state[fs->rx_port]; To get the queue state, the array rx_queue_state[] should be indexed by the queue number. Using fs->rx_port may not give desired queue's state. > + ports[fs->rx_port].rxq[fs->rx_queue].state = rx_state; > + uint8_t tx_state = dev_tx_data->tx_queue_state[fs->tx_port]; Same as rx queue above. We might need to root cause the issue further. > + ports[fs->tx_port].txq[fs->tx_queue].state = tx_state; > + } > stream_init(fwd_streams[i]); > + } > + } > > port_fwd_begin = cur_fwd_config.fwd_eng->port_fwd_begin; > if (port_fwd_begin != NULL) {