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 199EDA00C2; Fri, 14 Oct 2022 12:12:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B4F2042D22; Fri, 14 Oct 2022 12:12:30 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 5D02E42CF8; Fri, 14 Oct 2022 12:12:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665742348; x=1697278348; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=lgCbxbgKNnyOMprRRsnnboH9J9rr1qMZi8nvKlOgavo=; b=bvjpLguaW8AFr26ItcD14R1iif8x0h8wbsKh2KAHV4KZvcQwLWGLeSXU eoGMkAGltzprLLRnuAfIzSdpmwg4/DvxfEecW4KoKxekcEMljEhuDKJOr F/X60DALLuLUR7GahnFBtP6oqY66rnlh3RpZ1HCxMX14zY4K3AWKODpeR n1zMqBUcfQBtchNobAaaGw8nPOCMjNmfJ8LEeeLu4W1OqlgLCZX+FqmPY HuQv+W4TYCbNMrGHkzKW48kx/zFRMr58BMWFGYLBSixq0Y6k8RkMlvKyj Y7rn69Lb0xgS563HzKwmAzCS/qFAtI/5hfRttvUUhgWpSPzIR4zpN95qa Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10499"; a="292698191" X-IronPort-AV: E=Sophos;i="5.95,184,1661842800"; d="scan'208";a="292698191" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2022 03:12:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10499"; a="696256001" X-IronPort-AV: E=Sophos;i="5.95,184,1661842800"; d="scan'208";a="696256001" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga004.fm.intel.com with ESMTP; 14 Oct 2022 03:12:27 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 14 Oct 2022 03:12:26 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 14 Oct 2022 03:12:26 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Fri, 14 Oct 2022 03:12:26 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.173) 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; Fri, 14 Oct 2022 03:12:02 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ffz9djX+RbBd3hXN6nVYUWwG/0vj/xzemSanjS/X77e1h+uk8ggVLj4oigoUoDIUjV7qOIVt7Dd5JADWluOJgSxiswRazuKx4CffMMafm0eTTXOw3FVicPRvHnA8hL04aBrPP76xRmEOqypKam32/uTsUxXhWTt5TEBcnOTd7feLg8WlhfrlUYIf0u1hk1vJwFEOkUiel+jtlWbK0bxwj/NrcmMVt33Vf/s0J5jn0pYGuSSrbeegObO417DkY8z6X5zZBAwG6sOUMG57RNDxjZzK06byP/GSYbj1iDmVd94Zt/hwFYAdkDKb0hBUQte3YrR/DucQBtVe8ft0CxQ9AQ== 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=KkI7CbE5mDTSx0PYHyPTjo4ShTJAjtYWWWHkmwSgVd0=; b=A2dFBUR9ydQkIKurtY9DNhm7YTVaXV2oCIVrzeDEeXF/m+PSwTcO0gMsWEeMvDG+XZnZtq8dMJ1EsZbQverX4K3IChM++lqxjtIYdTZeqkpZIO+oYg6K/RyaOtjRU6Y0FFjC//VG0W6m4U7Z3nFiNtLwdcmJcjiIqlMooeF1BcbXcKGJvYOoyMrzUpr1hGWslkGORF+372tEUHTKJRIdUQpyv7UIfQQgX3gQ4rN3Hywpt7Z5xv2VWGvlotcea4/wuC7IA+Crc8nbN4V5T5Tfzgp8p/2JhLRf/uiN/xGiRRzvlclzPbdoGl6RuTtSCK5OOAzQ2tSrS59LVzYGCn728A== 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 Received: from DM5PR1101MB2107.namprd11.prod.outlook.com (2603:10b6:4:5a::19) by CO1PR11MB5187.namprd11.prod.outlook.com (2603:10b6:303:94::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.26; Fri, 14 Oct 2022 10:12:00 +0000 Received: from DM5PR1101MB2107.namprd11.prod.outlook.com ([fe80::d17c:b860:14e3:a27e]) by DM5PR1101MB2107.namprd11.prod.outlook.com ([fe80::d17c:b860:14e3:a27e%9]) with mapi id 15.20.5723.029; Fri, 14 Oct 2022 10:12:00 +0000 From: "Zhou, YidingX" To: Stephen Hemminger , "Zhang, Peng1X" CC: "dev@dpdk.org" , "andrew.rybchenko@oktetlabs.ru" , "Singh, Aman Deep" , "Zhang, Yuying" , "stable@dpdk.org" Subject: RE: [PATCH v3] app/testpmd: fix incorrect queues state of secondary process Thread-Topic: [PATCH v3] app/testpmd: fix incorrect queues state of secondary process Thread-Index: AQHYwb7yp88/KBB9bEiKGdlmj+IZBK4L5aOAgAH2w9A= Date: Fri, 14 Oct 2022 10:11:59 +0000 Message-ID: References: <20220819100940.657437-1-peng1x.zhang@intel.com> <20220906145310.8849-1-peng1x.zhang@intel.com> <20221012203331.60fa714a@hermes.local> In-Reply-To: <20221012203331.60fa714a@hermes.local> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM5PR1101MB2107:EE_|CO1PR11MB5187:EE_ x-ms-office365-filtering-correlation-id: 7ef8f9c2-1b33-471b-6435-08daadcc8852 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: LjiGrDkS/aUwMNn1KQ4+2IlswAhKLbQIBG0TwDCxNERu+81RC8C6mEn+fxnihBJXXNa7h7Ph1En9Y80wSKlKNRn+2S6y/Z+O2CRCoZWdz+GixJV9b7PdkgmZYotelBpbqUKQrNMO5g5mvpG3sNJLZ4CgvGocvuQ2NX4UtgS0QTIfRIxDuFLAiq2B5MAH5Is+bN67hOHfoZfPX9k8C5wX9T+QEbth2PqYBPUdDavKpT17AIr2rtGsX6Xjc/7i9lwB6yScVzLcKv6w2ldsWf0FNDsibPGNsWLJRQocNMXVjvJ7ngjOXeb7EDJyzD+u2w8mPXxXRxvDBPzibUCmp+4P2CAWvWoGArJrMJOhc+vrKkwZzeJOsbwKNiamMdTQpVL6fG1V48hay3231vd7+w31mQqze3WBRHzUCeNL4GxC7RaSFhyhVvOmeiHmSxGE19HrzxGJvSOpG2vmbJ9fZVhcBs0AUYZhdlT+f0ezx2Hd3+B8R92RluBafBx1+3KM2wUlhrTSg3eCofNyAIQ2PCmB77TTaNjoCrY3JwFFOIg9RElLNKSyp9HiW715BZJA9UvrZOEOinYzdSlagZpDZMe1WFpdXPAHz6NbsvBTqUEHPV3g2dI4JsxPorS3lO7cnhABT38l/W1Pq33zETiyPGJPZggwKN2oYlCKf0Tea5bL3ZwgQYAZqIgp0jilYaGZ+Ir3r/kyF0etGHBLPs7kBXwo1VTVRm2RHbokoVoNooZ/M5f4cFTX65581YXGpvqind/4caztTEHbzODgrIr9/bU0hg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR1101MB2107.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(346002)(39860400002)(136003)(396003)(366004)(451199015)(316002)(110136005)(478600001)(54906003)(6636002)(76116006)(71200400001)(66446008)(66946007)(8676002)(66476007)(64756008)(4326008)(66556008)(9686003)(8936002)(26005)(41300700001)(186003)(7696005)(5660300002)(6506007)(2906002)(83380400001)(122000001)(82960400001)(33656002)(38070700005)(52536014)(38100700002)(55016003)(86362001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?kpX6oEOfPiwZ+F+SC4JRS9X5D/5Bxfpt48qV49/bPBbwLlcgcj15ZoVlXQdL?= =?us-ascii?Q?AHxjr+LGLYF6oGOpGgx13y3N3iNLsS6d4BQ+Dub40RStj0X8vFwd8chCzXC2?= =?us-ascii?Q?qpHrnv2UVhXV+47fZNf1hNAFOzLpcYf3yIOMzIWh9+9JF35FVz9ql11Xd/RA?= =?us-ascii?Q?+H4yoJLg7fiPOuRirlYqBmj0zH9fj0LfQBQACA5uSLqfsvtSxYOaBwCCBB7V?= =?us-ascii?Q?Zht9V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CYvjBJSeVd/vp?= =?us-ascii?Q?NFqg3AQdyylbDNqnnAFWC8zt8bT3M8jkQpIAUNr+akdBWLOTbfkRGrpZdmbo?= =?us-ascii?Q?ezKvm8SMYxSw9NNjTWC2WMXjhX8cG/rwHLasSiPik23PPi684NvZaONOXNMD?= =?us-ascii?Q?gPLVdwTlUu+mr7LwGChIW1mrVRXIv6bao8UAcN6+7LKNBIGd8Uk0SK8rbGLc?= =?us-ascii?Q?YWtY9kogNPwD5Q5XtytvvFl/yMWBBOpHBdK0nuoJlLBAbltk+g7VSiJ+fBYj?= =?us-ascii?Q?DVEqpeL3WpWv5Ebm/UX6WhKsaYcqm1AAXag4qMh6KrspTXE0zJPhKraLVBTg?= =?us-ascii?Q?L1pLQAH+x7bv6hmC/WmX5y3uKIBEyWTcVLXGArayXmP+A0IcvfMbmx+FOfYz?= =?us-ascii?Q?K1pprC6FDiEwtJxRYzhNuuhtQ3caiakhM961B+PTf/OObdFRdjuFUN/+Gd4x?= =?us-ascii?Q?+4SoWWVrghj53K45bIeFvmn2bAiANyMALz9mi37N?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM5PR1101MB2107.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7ef8f9c2-1b33-471b-6435-08daadcc8852 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Oct 2022 10:11:59.7756 (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: 9f8mS2YQ3mU4BKkXiSqxwMV2CKLTx+IfkkbwAxcKGolxnAPdvp4wS4rKufmqHcXkcXkcBAlZxWOUGPgejj5o/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5187 X-OriginatorOrg: intel.com 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 >=20 > > + if (rte_eal_process_type() !=3D RTE_PROC_PRIMARY) { > > + struct fwd_stream *fs =3D fwd_streams[i]; > > + struct rte_eth_dev_data *dev_rx_data, > *dev_tx_data; > > + > > + dev_rx_data =3D (&rte_eth_devices[fs- > >rx_port])->data; > > + dev_tx_data =3D (&rte_eth_devices[fs->tx_port])- > >data; > > + > > + uint8_t rx_state =3D dev_rx_data- > >rx_queue_state[fs->rx_queue]; > > + ports[fs->rx_port].rxq[fs->rx_queue].state =3D > rx_state; > > + uint8_t tx_state =3D dev_tx_data- > >tx_queue_state[fs->tx_queue]; > > + ports[fs->tx_port].txq[fs->tx_queue].state =3D > tx_state; > > + } >=20 > Could the logic be put in stream_init() like this? >=20 > It keeps with the function pointer model object style model in that code. > Also, it makes testpmd more dependent on data structures that should be > hidden and internal only (rte_eth_devices). >=20 'strean_init' is a function pointer, putting this logic in will produce a l= ot of similar redundant code in all forwarding modules, like 'iofwd' 'macfw= d' and etc. It's better to hide 'rte_eth_devices' from testpmd, but this requires an AP= I at the EAL layer to access the queue state, 'rte_eth_rx/tx_queue_info_get()' can not get queue's state now.