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 62429A0C4C; Tue, 5 Oct 2021 18:41:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4A3704139F; Tue, 5 Oct 2021 18:41:42 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 35C8241297 for ; Tue, 5 Oct 2021 18:41:40 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10128"; a="224571275" X-IronPort-AV: E=Sophos;i="5.85,349,1624345200"; d="scan'208";a="224571275" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2021 09:41:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,349,1624345200"; d="scan'208";a="544952847" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga004.fm.intel.com with ESMTP; 05 Oct 2021 09:41:11 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 5 Oct 2021 09:41:11 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 5 Oct 2021 09:41:11 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.174) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Tue, 5 Oct 2021 09:41:10 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JZCEq5yRlrU5MHH+RO2A+M4MWhQC9PNvvSMXb7gPYqueBvpqoYJp5K+LZq0hek23KBnzRhlvkq2LRCPrbFcjSTgAoHVO/+fu4dksoVk2EjP3YyHsnLd50zEo/vCzCiuDSiizPqDBian1eEvqmGeAFSdWjtg6GEhTx7Wgxekjk7M4HV+PVzw8FrnEV/eUG14DZTRg5kzsoMw36vvJbjpPuwzLukdq3OgBWobMVAKAilSvd4/GqjPVQyMAgqV54bSjMRx5E9Ot35+3qogJVyTE3N4oCLS8b0O8CkL5dq+Z+mjYgs5u7fxdEVkCsNcRC7j55oVFYrY1Lo0U3BiEhuGiGg== 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=Tvz5w6e8CpJE99Fd4+hMopa/C2TH+K4zKJs0KagEltk=; b=WYf5nbl5lGjSRiZIuOyeYsDYWr9JB7HThFHgqbGoYstYnWSw/KAVBkW8cbI0PaAR+AGL7gmNz1+RRVpLtyfBHQjawRjDWyexBo8buS9BoSycZGt2SwC3IKK/88aMcS18yMKzNo3Q5YItvc5NcwFVOPh3ftZzmJCSsDgYxQXuKzP/edwsDNH/NJA+oqA3Q7TWQP0taO0V9pqm0xF0wJQRlFQSF0/lpC1EQp8u4g842TX8OkYrV0Jb3LsarXhlwesyDNlTwYf81u2id60g1OaDnafUtMnLXZpLOcR2+Ynr2O8G7ZbHgk2n9Gosvi3STELF8MX2avGN/oLLr2OY0S5MuQ== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Tvz5w6e8CpJE99Fd4+hMopa/C2TH+K4zKJs0KagEltk=; b=Uw67A6RK9v1CEIRQEnS7bMBiKHL8+txXOk9xg76pyrtopHKf9FeE37b43uK2+HiAVi8PPZkoGRGiPT0Q5T2jI6Hj2a7edtKoXLvRbhiQHAoC+G9d++WlzIarwTj4Qbdc+M2jZFh7SmBObaZ3a9zfKZTeMPbPIy9zoygBrMr6aY4= Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM6PR11MB3131.namprd11.prod.outlook.com (2603:10b6:5:6d::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.21; Tue, 5 Oct 2021 16:41:05 +0000 Received: from DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::740e:126e:c785:c8fd]) by DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::740e:126e:c785:c8fd%4]) with mapi id 15.20.4566.022; Tue, 5 Oct 2021 16:41:05 +0000 From: "Ananyev, Konstantin" To: Thomas Monjalon CC: "dev@dpdk.org" , "Li, Xiaoyun" , "anoobj@marvell.com" , "jerinj@marvell.com" , "ndabilpuram@marvell.com" , "adwivedi@marvell.com" , "shepard.siegel@atomicrules.com" , "ed.czeck@atomicrules.com" , "john.miller@atomicrules.com" , "irusskikh@marvell.com" , "ajit.khaparde@broadcom.com" , "somnath.kotur@broadcom.com" , "rahul.lakkireddy@chelsio.com" , "hemant.agrawal@nxp.com" , "sachin.saxena@oss.nxp.com" , "Wang, Haiyue" , "Daley, John" , "hyonkim@cisco.com" , "Zhang, Qi Z" , "Wang, Xiao W" , "humin29@huawei.com" , "yisen.zhuang@huawei.com" , "oulijun@huawei.com" , "Xing, Beilei" , "Wu, Jingjing" , "Yang, Qiming" , "matan@nvidia.com" , "viacheslavo@nvidia.com" , "sthemmin@microsoft.com" , "longli@microsoft.com" , "heinrich.kuhn@corigine.com" , "kirankumark@marvell.com" , "andrew.rybchenko@oktetlabs.ru" , "mczekaj@marvell.com" , "jiawenwu@trustnetic.com" , "jianwang@trustnetic.com" , "maxime.coquelin@redhat.com" , "Xia, Chenbo" , "Yigit, Ferruh" , "mdr@ashroe.eu" , "Jayatheerthan, Jay" Thread-Topic: [dpdk-dev] [PATCH v4 3/7] ethdev: copy ethdev 'fast' API into separate structure Thread-Index: AQHXuSfTraQV4QP1q0+OrjZunAm11qvEYgUAgAA5v/A= Date: Tue, 5 Oct 2021 16:41:05 +0000 Message-ID: References: <20211001140255.5726-1-konstantin.ananyev@intel.com> <20211004135603.20593-1-konstantin.ananyev@intel.com> <20211004135603.20593-4-konstantin.ananyev@intel.com> <2386814.hQzPKX2lIG@thomas> In-Reply-To: <2386814.hQzPKX2lIG@thomas> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3a990021-7d80-4c61-a05e-08d9881eed1a x-ms-traffictypediagnostic: DM6PR11MB3131: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: bY/lKibMzaIT370j41i4mDvXDBalGERg58H8vubm9yPFn0SqM5Tm/j6MTDrD7rlhrG8q4BYcMr4ET4syFtSWgJfsZMbCAWnGz7DYOnNduQ4E6JPfe0M0kgdT9HcNUWlIkE37rPWpraoEyPyM9nz+ABlCIDQyDOr0rp8l+XYBSx/M2QJwaplV6gkoYiCcGB4tVNi9QhlzgBwl8lZy+TQsPJxQgZHfamL/WXTDIqOuFBu1rjFkWNzSfbrkTlMz7ON0pfn1aCT9Gh0jaD46Mx85658SRxMMZvPVZgBfhSlttPzwEKBi7BZD5WvStKVOmXCUrgEQH4R8Qf1/a8nN1d0A//9UFCpFmVtw4Iza3FYI785m3R/FP9lOvZ+xbu1gAXMvbWwZhlxWJ1f2AtSusUK+jZ6QRmVEXD+sQJFsfHXvNzYEzXXBZxMMSQo+a6Ya3AoGoBC4DOtPdhx59AFBfL6CLkxe0C22Dqgq91i2mKZ/spOcHANlTT1jtM/66mMhXQLaiZ5OTKkYmjajYhS3ySkK6cPpiSqBBpX5WWvNc4Qhoy7wHmiGawHNEUNY0Cq6BdodOpMo7w2b48EnottwkEFU0PAnKQLHkZ3UfbGPlXNDRoNthw7lgKjvsi9VMvuhIec6mBnOvBJiUSk8hkumZBQ8wJmIU7qm0BxItwtyk7BVpOkszB0gfiwISMcOE2y91Kz9FQidQlLMM/FEA2dMbBcVkA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4491.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(71200400001)(5660300002)(186003)(26005)(7416002)(9686003)(6916009)(316002)(107886003)(76116006)(86362001)(54906003)(55236004)(6506007)(33656002)(8936002)(508600001)(8676002)(2906002)(38100700002)(52536014)(38070700005)(7696005)(55016002)(66446008)(66556008)(122000001)(66476007)(64756008)(7406005)(66946007)(4326008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?+erHRq97VSeVIiRFlauru8/MictMA9nBOVJwIlXVdDtfywWlPdB+lzN8HkzQ?= =?us-ascii?Q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V?= =?us-ascii?Q?5ZL9v73LoyllewnxQm0CX5V0P/Eg4feq6jFTPl9ftmI5ypcmChvdOyvudSI+?= =?us-ascii?Q?HG0jsZUGadvgtydXCaEUCOYWh19Pu2QFJ0xIeD1O+eA+K22R9L028yQ8EHb6?= =?us-ascii?Q?yqtqP3nVekIqPSNiqwGH76gvQ0xPcvMVnJIV09oI1h1Q2F9GIopxwIHfQjvr?= =?us-ascii?Q?VWLr/aCyPKbDcIlAANQhS2s0a5C+W7miHHs1RwDwiv9WfWiM8tYL9Vp+ohNj?= =?us-ascii?Q?JaUfYMF1UT4ycyEh7oG9SQo2UJylSkZ/2tqVl65s3ZNiO0YZavUEPV0RFTDy?= =?us-ascii?Q?hQsXSHnNp4MQip1q+n+a4AOWbWz2Dvk/vKWxM0UiVE4Wd2wUq6kjoJa144e1?= =?us-ascii?Q?KZ5oGe2zN52SSccYunWbrtUI?= 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: DM6PR11MB4491.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3a990021-7d80-4c61-a05e-08d9881eed1a X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2021 16:41:05.7107 (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: nrTTLPdWcctv7NOTQ4ny+okmiWM0fsDI+l2fWPRFrDbGaLDwKPfpmoz1+0+W0a1xZb58HzmLGbZN6MuozYJpp4VtWZIAHp/WlvaP9MX62L0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3131 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v4 3/7] ethdev: copy ethdev 'fast' API into separate structure 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 Sender: "dev" > 04/10/2021 15:55, Konstantin Ananyev: > > Copy public function pointers (rx_pkt_burst(), etc.) and related > > pointers to internal data from rte_eth_dev structure into a > > separate flat array. That array will remain in a public header. > > The intention here is to make rte_eth_dev and related structures intern= al. > > That should allow future possible changes to core eth_dev structures > > to be transparent to the user and help to avoid ABI/API breakages. > > The plan is to keep minimal part of data from rte_eth_dev public, > > so we still can use inline functions for 'fast' calls > > (like rte_eth_rx_burst(), etc.) to avoid/minimize slowdown. >=20 > I don't understand why 'fast' is quoted. > It looks strange. >=20 >=20 > > +/* reset eth 'fast' API to dummy values */ > > +void eth_dev_fp_ops_reset(struct rte_eth_fp_ops *fpo); > > + > > +/* setup eth 'fast' API to ethdev values */ > > +void eth_dev_fp_ops_setup(struct rte_eth_fp_ops *fpo, > > + const struct rte_eth_dev *dev); >=20 > I assume "fp" stands for fast path. Yes. > Please write "fast path" completely in the comments. Ok. > > + /* expose selection of PMD rx/tx function */ > > + eth_dev_fp_ops_setup(rte_eth_fp_ops + port_id, dev); > [...] > > + /* point rx/tx functions to dummy ones */ > > + eth_dev_fp_ops_reset(rte_eth_fp_ops + port_id); >=20 > Nit: Rx/Tx > or could be "fast path", to be consistent. >=20 > > + /* > > + * for secondary process, at that point we expect device > > + * to be already 'usable', so shared data and all function pointers > > + * for 'fast' devops have to be setup properly inside rte_eth_dev. > > + */ > > + if (rte_eal_process_type() =3D=3D RTE_PROC_SECONDARY) > > + eth_dev_fp_ops_setup(rte_eth_fp_ops + dev->data->port_id, dev); > > + > > rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_NEW, NULL); > > > > dev->state =3D RTE_ETH_DEV_ATTACHED; > > diff --git a/lib/ethdev/rte_ethdev_core.h b/lib/ethdev/rte_ethdev_core.= h > > index 948c0b71c1..fe47a660c7 100644 > > --- a/lib/ethdev/rte_ethdev_core.h > > +++ b/lib/ethdev/rte_ethdev_core.h > > @@ -53,6 +53,51 @@ typedef int (*eth_rx_descriptor_status_t)(void *rxq,= uint16_t offset); > > typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset); > > /**< @internal Check the status of a Tx descriptor */ > > > > +/** > > + * @internal > > + * Structure used to hold opaque pointernals to internal ethdev RX/TXi >=20 > typos in above line >=20 > > + * queues data. > > + * The main purpose to expose these pointers at all - allow compiler > > + * to fetch this data for 'fast' ethdev inline functions in advance. > > + */ > > +struct rte_ethdev_qdata { > > + void **data; > > + /**< points to array of internal queue data pointers */ > > + void **clbk; > > + /**< points to array of queue callback data pointers */ > > +}; > > + > > +/** > > + * @internal > > + * 'fast' ethdev funcions and related data are hold in a flat array. > > + * one entry per ethdev. > > + */ > > +struct rte_eth_fp_ops { > > + > > + /** first 64B line */ > > + eth_rx_burst_t rx_pkt_burst; > > + /**< PMD receive function. */ > > + eth_tx_burst_t tx_pkt_burst; > > + /**< PMD transmit function. */ > > + eth_tx_prep_t tx_pkt_prepare; > > + /**< PMD transmit prepare function. */ > > + eth_rx_queue_count_t rx_queue_count; > > + /**< Get the number of used RX descriptors. */ > > + eth_rx_descriptor_status_t rx_descriptor_status; > > + /**< Check the status of a Rx descriptor. */ > > + eth_tx_descriptor_status_t tx_descriptor_status; > > + /**< Check the status of a Tx descriptor. */ > > + uintptr_t reserved[2]; >=20 > uintptr_t size is not fix. > I think you mean uint64_t. Nope, I meant 'uintptr_t' here. That way it fits really nicely to both 64-bit and 32-bit systems. For 64-bit systems we have all function pointers on first 64B line, and all data pointers on second 64B line. For 32-bit systems we have all fields within first 64B line. =20 > > + > > + /** second 64B line */ > > + struct rte_ethdev_qdata rxq; > > + struct rte_ethdev_qdata txq; > > + uintptr_t reserved2[4]; > > + > > +} __rte_cache_aligned; > > + > > +extern struct rte_eth_fp_ops rte_eth_fp_ops[RTE_MAX_ETHPORTS]; >=20 >=20