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 20160A0C4C; Tue, 5 Oct 2021 15:09:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6BB164136E; Tue, 5 Oct 2021 15:09:14 +0200 (CEST) Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by mails.dpdk.org (Postfix) with ESMTP id 47A4641361 for ; Tue, 5 Oct 2021 15:09:13 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id A20C6580EA3; Tue, 5 Oct 2021 09:09:12 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 05 Oct 2021 09:09:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= 0JxMeRFj8WhFyiEBcve4x9+cq01IM6okFeJqJzDD7+o=; b=f3xf4BcMwhB3ZlIY 3P8Vbirb9LucEVxFwYZ9g18GdyVjShKvqddaGU68P3Zdf6cq0AbsjyifSE9ZDif/ K5Swq2eBH53i4oC+nvmpA9BJTUlLtI1FMf7Ku5vj2A6fNil8J5cuN64xPoVspH5L siP67fYygGnyyLcrIeempqaYMJYVF68t+pgdTUZJRTMNPNITtHJtf+f1ccaR0XFu HSyVQREaSubGJZRntHzkbLB4JJwraGJsUm6UV17SpDd/YOxtSMz1wdOtIXa3UjO/ FsS+ofY2BzIqUR+zy7zR+6VxQIIkQxhvVM1fkRTerAw6pSJ4QD2BX1AhcUczvIft yHzu0Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=0JxMeRFj8WhFyiEBcve4x9+cq01IM6okFeJqJzDD7 +o=; b=J+S1397nbikoOkU6HmvQMU+BSSV4xpZ6RGqZ13oAXbGvV9FxovZxkldaM 2MNXvXiSXNqeNd0csdY97wtFMNr7VQTVLC8KE1AOB4ijPcOYCyVOimzj2qxLdykT rY/CABYN8Gw36VXqnQZbH8O4GPTWxUWoejv80QsC8A6sBRiEegFfUDmty5AhUhLM fn/3xYBeshRLAhM0T+2hGw2V5BjKgJGVywFesw4VGu44oA3ObPvunCIvIJEoGWwj Jtw6SPBf43K8yYBOPZfmuJBGjrMoku8tk0nDE9ZPmnFJjVDTN+K5w0A2TMB7Ob5o HcSDdtvIebo5ASunT5dEn/bjbiViA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudelgedgiedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 5 Oct 2021 09:09:05 -0400 (EDT) From: Thomas Monjalon To: Konstantin Ananyev Cc: dev@dpdk.org, xiaoyun.li@intel.com, 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, haiyue.wang@intel.com, johndale@cisco.com, hyonkim@cisco.com, qi.z.zhang@intel.com, xiao.w.wang@intel.com, humin29@huawei.com, yisen.zhuang@huawei.com, oulijun@huawei.com, beilei.xing@intel.com, jingjing.wu@intel.com, qiming.yang@intel.com, 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, chenbo.xia@intel.com, ferruh.yigit@intel.com, mdr@ashroe.eu, jay.jayatheerthan@intel.com Date: Tue, 05 Oct 2021 15:09:02 +0200 Message-ID: <2386814.hQzPKX2lIG@thomas> In-Reply-To: <20211004135603.20593-4-konstantin.ananyev@intel.com> References: <20211001140255.5726-1-konstantin.ananyev@intel.com> <20211004135603.20593-1-konstantin.ananyev@intel.com> <20211004135603.20593-4-konstantin.ananyev@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 internal. > 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. I don't understand why 'fast' is quoted. It looks strange. > +/* 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); I assume "fp" stands for fast path. Please write "fast path" completely in the comments. > + /* 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); Nit: Rx/Tx or could be "fast path", to be consistent. > + /* > + * 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() == 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 = 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 typos in above line > + * 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]; uintptr_t size is not fix. I think you mean uint64_t. > + > + /** 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];