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 D9F46A0C4D; Fri, 20 Aug 2021 18:28:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9A62F4013F; Fri, 20 Aug 2021 18:28:59 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 16F114003E; Fri, 20 Aug 2021 18:28:57 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10082"; a="238930248" X-IronPort-AV: E=Sophos;i="5.84,338,1620716400"; d="scan'208";a="238930248" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Aug 2021 09:28:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,338,1620716400"; d="scan'208";a="490551664" Received: from sivswdev08.ir.intel.com ([10.237.217.47]) by fmsmga008.fm.intel.com with ESMTP; 20 Aug 2021 09:28:54 -0700 From: Konstantin Ananyev To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, andrew.rybchenko@oktetlabs.ru, qiming.yang@intel.com, qi.z.zhang@intel.com, beilei.xing@intel.com, techboard@dpdk.org, Konstantin Ananyev Date: Fri, 20 Aug 2021 17:28:27 +0100 Message-Id: <20210820162834.12544-1-konstantin.ananyev@intel.com> X-Mailer: git-send-email 2.18.0 Subject: [dpdk-dev] [RFC 0/7] hide eth dev related structures 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" NOTE: This is just an RFC to start further discussion and collect the feedback. Due to significant amount of work, changes required are applied only to two PMDs so far: net/i40e and net/ice. So to build it you'll need to add: -Denable_drivers='common/*,mempool/*,net/ice,net/i40e' to your config options. The aim of these patch series is to make rte_ethdev core data structures (rte_eth_dev, rte_eth_dev_data, rte_eth_rxtx_callback, etc.) internal to DPDK and not visible to the user. That should allow future possible changes to core ethdev related structures to be transparent to the user and help to improve ABI/API stability. Note that current ethdev API is preserved, though it is an ABI break for sure. The work is based on previous discussion at: https://www.mail-archive.com/dev@dpdk.org/msg211405.html and consists of the following main points: 1. Move public 'fast' function pointers (rx_pkt_burst(), etc.) from rte_eth_dev into a separate flat array. We keep it public to still be able to use inline functions for these 'fast' calls (like rte_eth_rx_burst(), etc.) to avoid/minimize slowdown. 2. Change prototype within PMDs for these 'fast' functions (pkt_rx_burst(), etc.) to accept pair of instead of queue pointer. 3. Also some mechanical changes in function start/finish code is required. Basically to avoid extra level of indirection - PMD required to do some preliminary checks and data retrieval that are currently done at user level by inline rte_eth* functions. 4. Special _rte_eth_*_prolog(/epilog) inline functions and helper macros are provided to make these changes inside PMDs as straightforward as possible. 5. Change implementation of 'fast' ethdev functions (rte_eth_rx_burst(), etc.) to use new public flat array. 6. Move rte_eth_dev, rte_eth_dev_data, rte_eth_rxtx_callback and related things into internal header: . That approach was selected to avoid(/minimize) possible performance losses. So far I done only limited amount functional and performance testing. Didn't spot any functional problems, and performance numbers remains the same before and after the patch on my box (testpmd, macswap fwd). Remaining items: ============== - implement required changes for all PMD at drivers/net. So far I done changes only for two drivers, and definitely would use some help from other PMD maintainers. Required changes are mechanical, but we have a lot of drivers these days. - contains reference to rte_eth_dev field RTE_ETH_DEV_TO_PCI(eth_dev). Need to move this macro into some internal header. - Extra testing - checkpatch warnings - docs update Konstantin Ananyev (7): eth: move ethdev 'burst' API into separate structure eth: make drivers to use new API for Rx eth: make drivers to use new API for Tx eth: make drivers to use new API for Tx prepare eth: make drivers to use new API to obtain descriptor status eth: make drivers to use new API for Rx queue count eth: hide eth dev related structures app/test-pmd/config.c | 23 +- app/test/virtual_pmd.c | 27 +- drivers/common/octeontx2/otx2_sec_idev.c | 2 +- drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 2 +- drivers/net/i40e/i40e_ethdev.c | 15 +- drivers/net/i40e/i40e_ethdev_vf.c | 15 +- drivers/net/i40e/i40e_rxtx.c | 243 ++++--- drivers/net/i40e/i40e_rxtx.h | 68 +- drivers/net/i40e/i40e_rxtx_vec_avx2.c | 11 +- drivers/net/i40e/i40e_rxtx_vec_avx512.c | 12 +- drivers/net/i40e/i40e_rxtx_vec_sse.c | 8 +- drivers/net/i40e/i40e_vf_representor.c | 10 +- drivers/net/ice/ice_dcf_ethdev.c | 10 +- drivers/net/ice/ice_dcf_vf_representor.c | 10 +- drivers/net/ice/ice_ethdev.c | 15 +- drivers/net/ice/ice_rxtx.c | 236 ++++--- drivers/net/ice/ice_rxtx.h | 73 +-- drivers/net/ice/ice_rxtx_vec_avx2.c | 24 +- drivers/net/ice/ice_rxtx_vec_avx512.c | 24 +- drivers/net/ice/ice_rxtx_vec_common.h | 7 +- drivers/net/ice/ice_rxtx_vec_sse.c | 12 +- lib/ethdev/ethdev_driver.h | 601 ++++++++++++++++++ lib/ethdev/ethdev_private.c | 74 +++ lib/ethdev/ethdev_private.h | 3 + lib/ethdev/rte_ethdev.c | 176 ++++- lib/ethdev/rte_ethdev.h | 194 ++---- lib/ethdev/rte_ethdev_core.h | 182 ++---- lib/ethdev/version.map | 16 + lib/eventdev/rte_event_eth_rx_adapter.c | 2 +- lib/eventdev/rte_event_eth_tx_adapter.c | 2 +- lib/eventdev/rte_eventdev.c | 2 +- 31 files changed, 1488 insertions(+), 611 deletions(-) -- 2.26.3