From patchwork Wed Sep 9 13:01:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 77043 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 87654A04B1; Wed, 9 Sep 2020 15:02:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 931931C0CD; Wed, 9 Sep 2020 15:02:17 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id C663E1C0CD for ; Wed, 9 Sep 2020 15:02:15 +0200 (CEST) IronPort-SDR: cBZQbn9mUJPocSK8caD+pQySSoqOfI34Sfbs0zgumrRBNT/HdqcmcMtexJdtPtpUdau+d0mspB AkWnCy202cyQ== X-IronPort-AV: E=McAfee;i="6000,8403,9738"; a="137837523" X-IronPort-AV: E=Sophos;i="5.76,409,1592895600"; d="scan'208";a="137837523" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2020 06:01:52 -0700 IronPort-SDR: ckjs9YGuNRupOJMU5MWm2Xh5d9cCojlx6BDM1tJ/O70axRDG7CUbUcGJfqUrlmTpDbMrg/Jfdu UOTT5Ba4ExwQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,409,1592895600"; d="scan'208";a="341566967" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by FMSMGA003.fm.intel.com with ESMTP; 09 Sep 2020 06:01:50 -0700 From: Ferruh Yigit To: dev@dpdk.org, Ray Kinsella , Neil Horman , John McNamara , Marko Kovacevic , Thomas Monjalon , Andrew Rybchenko Cc: Ferruh Yigit , David Marchand Date: Wed, 9 Sep 2020 14:01:42 +0100 Message-Id: <20200909130148.1756518-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200824094021.2323605-1-ferruh.yigit@intel.com> References: <20200824094021.2323605-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 1/7] ethdev: deprecate descriptor status check API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Marking 'rte_eth_rx_descriptor_done()' API as deprecated. ``rte_eth_rx_descriptor_status`` and ``rte_eth_tx_descriptor_status`` APIs can be used as replacement. Plan is to remove the API on 21.11 release. Signed-off-by: Ferruh Yigit Acked-by: David Marchand --- Cc: David Marchand v3: * Just deprecating the 'rte_eth_rx_descriptor_done()' API without removing it to stick to the original plan. --- doc/guides/rel_notes/deprecation.rst | 2 +- doc/guides/rel_notes/release_20_11.rst | 2 ++ lib/librte_ethdev/rte_ethdev.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 279eccb04a..35c676e262 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -214,7 +214,7 @@ Deprecation Notices https://mails.dpdk.org/archives/dev/2020-July/176135.html. * ethdev: ``rx_descriptor_done`` dev_ops and ``rte_eth_rx_descriptor_done`` - will be deprecated in 20.11 and will be removed in 21.11. + will be removed in 21.11. Existing ``rte_eth_rx_descriptor_status`` and ``rte_eth_tx_descriptor_status`` APIs can be used as replacement. diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst index df227a1773..a7d57b001d 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -84,6 +84,8 @@ API Changes Also, make sure to start the actual text at the margin. ======================================================= +* ``rte_eth_rx_descriptor_done()`` API has deprecated. + ABI Changes ----------- diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index f30245b102..eb6cd01f8d 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -4567,6 +4567,7 @@ rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id) * - (-ENODEV) if *port_id* invalid. * - (-ENOTSUP) if the device does not support this function */ +__rte_deprecated static inline int rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset) { From patchwork Wed Sep 9 13:01:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 77042 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DAA1AA04B1; Wed, 9 Sep 2020 15:02:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DA48E1BF8D; Wed, 9 Sep 2020 15:02:13 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id E899C1B9B7 for ; Wed, 9 Sep 2020 15:02:10 +0200 (CEST) IronPort-SDR: Gflr891eXqX84CyOO7zA1EJSwu6EOjDJDCT5gxHjQWbRE34z8wtiy/BSIUnZyemMnYHUhe5Jfs BFLL04uLw08A== X-IronPort-AV: E=McAfee;i="6000,8403,9738"; a="146038561" X-IronPort-AV: E=Sophos;i="5.76,409,1592895600"; d="scan'208";a="146038561" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2020 06:02:03 -0700 IronPort-SDR: pPM25G4rhIuZFOMCctFHkf54RmaMgDrVa4K67vvplbsZ+koFXffE2aLeETeHhSns6Wa1KdXKKj eUO6FFRprjtg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,409,1592895600"; d="scan'208";a="341567058" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by FMSMGA003.fm.intel.com with ESMTP; 09 Sep 2020 06:01:54 -0700 From: Ferruh Yigit To: dev@dpdk.org, John McNamara , Marko Kovacevic , Shepard Siegel , Ed Czeck , John Miller , Igor Russkikh , Pavel Belous , Somalapuram Amaranath , Ajit Khaparde , Somnath Kotur , Hemant Agrawal , Sachin Saxena , Wei Zhao , Jeff Guo , John Daley , Hyong Youb Kim , Qi Zhang , Xiao Wang , Beilei Xing , Jingjing Wu , Qiming Yang , Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , Stephen Hemminger , "K. Y. Srinivasan" , Haiyang Zhang , Long Li , Heinrich Kuhn , Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K , Rasesh Mody , Shahed Shaikh , Andrew Rybchenko , Maciej Czekaj , Maxime Coquelin , Chenbo Xia , Zhihong Wang , Thomas Monjalon Cc: Ferruh Yigit , David Marchand Date: Wed, 9 Sep 2020 14:01:43 +0100 Message-Id: <20200909130148.1756518-2-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200909130148.1756518-1-ferruh.yigit@intel.com> References: <20200824094021.2323605-1-ferruh.yigit@intel.com> <20200909130148.1756518-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 2/7] ethdev: move inline device operations X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" This patch is a preparation to hide the 'struct eth_dev_ops' from applications by moving some device operations from 'struct eth_dev_ops' to 'struct rte_eth_dev'. Mentioned ethdev APIs are in the data path and implemented as inline because of performance reasons. Exposing 'struct eth_dev_ops' to applications is bad because it is a contract between ethdev and PMDs, not really needs to be known by applications, also changes in the struct causing ABI breakages which shouldn't. To be able to both keep APIs inline and hide the 'struct eth_dev_ops', moving device operations used in ethdev inline APIs to 'struct rte_eth_dev' to the same level with Rx/Tx burst functions. The list of dev_ops moved: eth_rx_queue_count_t rx_queue_count; eth_rx_descriptor_done_t rx_descriptor_done; eth_rx_descriptor_status_t rx_descriptor_status; eth_tx_descriptor_status_t tx_descriptor_status; Signed-off-by: Ferruh Yigit Reviewed-by: Andrew Rybchenko Acked-by: David Marchand Acked-by: Sachin Saxena --- v2: * Updated features.rst * Tweak assignment order in sfc Cc: David Marchand v3: * ``rx_descriptor_done`` also moved * release note updated --- doc/guides/nics/features.rst | 6 +++--- doc/guides/rel_notes/release_20_11.rst | 9 +++++++++ drivers/net/ark/ark_ethdev.c | 2 +- drivers/net/atlantic/atl_ethdev.c | 9 +++++---- drivers/net/axgbe/axgbe_ethdev.c | 5 +++-- drivers/net/bnxt/bnxt_ethdev.c | 6 +++--- drivers/net/dpaa/dpaa_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/e1000/em_ethdev.c | 8 ++++---- drivers/net/e1000/igb_ethdev.c | 14 +++++++------- drivers/net/enic/enic_ethdev.c | 3 +-- drivers/net/fm10k/fm10k_ethdev.c | 8 ++++---- drivers/net/i40e/i40e_ethdev.c | 8 ++++---- drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++---- drivers/net/iavf/iavf_ethdev.c | 6 +++--- drivers/net/ice/ice_ethdev.c | 6 +++--- drivers/net/igc/igc_ethdev.c | 8 ++++---- drivers/net/ixgbe/ixgbe_ethdev.c | 14 +++++++------- drivers/net/mlx5/linux/mlx5_os.c | 12 +++++------- drivers/net/mlx5/mlx5_flow.c | 4 ++++ drivers/net/netvsc/hn_ethdev.c | 6 +++--- drivers/net/nfp/nfp_net.c | 2 +- drivers/net/octeontx2/otx2_ethdev.c | 8 ++++---- drivers/net/qede/qede_ethdev.c | 3 +-- drivers/net/sfc/sfc_ethdev.c | 16 ++++++++-------- drivers/net/thunderx/nicvf_ethdev.c | 2 +- drivers/net/vhost/rte_eth_vhost.c | 2 +- drivers/net/virtio/virtio_ethdev.c | 2 +- lib/librte_ethdev/rte_ethdev.h | 17 ++++++++--------- lib/librte_ethdev/rte_ethdev_core.h | 13 ++++++------- 30 files changed, 110 insertions(+), 101 deletions(-) diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst index edd21c4d8e..dd8c9555b0 100644 --- a/doc/guides/nics/features.rst +++ b/doc/guides/nics/features.rst @@ -646,9 +646,9 @@ used, status can be "Available", "Done" or "Unavailable". When ``rx_descriptor_done`` is used, status can be "DD bit is set" or "DD bit is not set". -* **[implements] eth_dev_ops**: ``rx_descriptor_status``. +* **[implements] rte_eth_dev**: ``rx_descriptor_status``. * **[related] API**: ``rte_eth_rx_descriptor_status()``. -* **[implements] eth_dev_ops**: ``rx_descriptor_done``. +* **[implements] rte_eth_dev**: ``rx_descriptor_done``. * **[related] API**: ``rte_eth_rx_descriptor_done()``. @@ -660,7 +660,7 @@ Tx descriptor status Supports checking the status of a Tx descriptor. Status can be "Full", "Done" or "Unavailable." -* **[implements] eth_dev_ops**: ``tx_descriptor_status``. +* **[implements] rte_eth_dev**: ``tx_descriptor_status``. * **[related] API**: ``rte_eth_tx_descriptor_status()``. diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst index a7d57b001d..ff7242012b 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -102,6 +102,15 @@ ABI Changes Also, make sure to start the actual text at the margin. ======================================================= +* ``ethdev`` changes + + * Following device operation function pointers moved from ``struct eth_dev_ops`` to ``struct rte_eth_dev``: + + * ``eth_rx_queue_count_t rx_queue_count;`` + * ``eth_rx_descriptor_done_t rx_descriptor_done;`` + * ``eth_rx_descriptor_status_t rx_descriptor_status;`` + * ``eth_tx_descriptor_status_t tx_descriptor_status;`` + Known Issues ------------ diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c index b32ccd8677..ce7f6e4803 100644 --- a/drivers/net/ark/ark_ethdev.c +++ b/drivers/net/ark/ark_ethdev.c @@ -132,7 +132,6 @@ static const struct eth_dev_ops ark_eth_dev_ops = { .dev_infos_get = eth_ark_dev_info_get, .rx_queue_setup = eth_ark_dev_rx_queue_setup, - .rx_queue_count = eth_ark_dev_rx_queue_count, .tx_queue_setup = eth_ark_tx_queue_setup, .link_update = eth_ark_dev_link_update, @@ -318,6 +317,7 @@ eth_ark_dev_init(struct rte_eth_dev *dev) return -1; dev->dev_ops = &ark_eth_dev_ops; + dev->rx_queue_count = eth_ark_dev_rx_queue_count; dev->data->mac_addrs = rte_zmalloc("ark", RTE_ETHER_ADDR_LEN, 0); if (!dev->data->mac_addrs) { diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index d3b00ab295..540b106045 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -313,10 +313,6 @@ static const struct eth_dev_ops atl_eth_dev_ops = { .rx_queue_intr_enable = atl_dev_rx_queue_intr_enable, .rx_queue_intr_disable = atl_dev_rx_queue_intr_disable, - .rx_queue_count = atl_rx_queue_count, - .rx_descriptor_status = atl_dev_rx_descriptor_status, - .tx_descriptor_status = atl_dev_tx_descriptor_status, - /* EEPROM */ .get_eeprom_length = atl_dev_get_eeprom_length, .get_eeprom = atl_dev_get_eeprom, @@ -373,6 +369,11 @@ eth_atl_dev_init(struct rte_eth_dev *eth_dev) PMD_INIT_FUNC_TRACE(); eth_dev->dev_ops = &atl_eth_dev_ops; + + eth_dev->rx_queue_count = atl_rx_queue_count; + eth_dev->rx_descriptor_status = atl_dev_rx_descriptor_status; + eth_dev->tx_descriptor_status = atl_dev_tx_descriptor_status; + eth_dev->rx_pkt_burst = &atl_recv_pkts; eth_dev->tx_pkt_burst = &atl_xmit_pkts; eth_dev->tx_pkt_prepare = &atl_prep_pkts; diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c index 0c25739f82..02ceb95754 100644 --- a/drivers/net/axgbe/axgbe_ethdev.c +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -224,8 +224,6 @@ static const struct eth_dev_ops axgbe_eth_dev_ops = { .rxq_info_get = axgbe_rxq_info_get, .txq_info_get = axgbe_txq_info_get, .dev_supported_ptypes_get = axgbe_dev_supported_ptypes_get, - .rx_descriptor_status = axgbe_dev_rx_descriptor_status, - .tx_descriptor_status = axgbe_dev_tx_descriptor_status, .mtu_set = axgb_mtu_set, }; @@ -1632,6 +1630,9 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev) eth_dev->dev_ops = &axgbe_eth_dev_ops; + eth_dev->rx_descriptor_status = axgbe_dev_rx_descriptor_status; + eth_dev->tx_descriptor_status = axgbe_dev_tx_descriptor_status; + /* * For secondary processes, we don't initialise any further as primary * has already done this work. diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 75d055be00..4d224bfa04 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -4246,9 +4246,6 @@ static const struct eth_dev_ops bnxt_dev_ops = { .dev_led_off = bnxt_dev_led_off_op, .xstats_get_by_id = bnxt_dev_xstats_get_by_id_op, .xstats_get_names_by_id = bnxt_dev_xstats_get_names_by_id_op, - .rx_queue_count = bnxt_rx_queue_count_op, - .rx_descriptor_status = bnxt_rx_descriptor_status_op, - .tx_descriptor_status = bnxt_tx_descriptor_status_op, .rx_queue_start = bnxt_rx_queue_start, .rx_queue_stop = bnxt_rx_queue_stop, .tx_queue_start = bnxt_tx_queue_start, @@ -5681,6 +5678,9 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused) PMD_DRV_LOG(INFO, "%s\n", bnxt_version); eth_dev->dev_ops = &bnxt_dev_ops; + eth_dev->rx_queue_count = bnxt_rx_queue_count_op; + eth_dev->rx_descriptor_status = bnxt_rx_descriptor_status_op; + eth_dev->tx_descriptor_status = bnxt_tx_descriptor_status_op; eth_dev->rx_pkt_burst = &bnxt_recv_pkts; eth_dev->tx_pkt_burst = &bnxt_xmit_pkts; diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index b0f2023e60..e2c3fd0368 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -1421,7 +1421,6 @@ static struct eth_dev_ops dpaa_devops = { .tx_queue_setup = dpaa_eth_tx_queue_setup, .rx_queue_release = dpaa_eth_rx_queue_release, .tx_queue_release = dpaa_eth_tx_queue_release, - .rx_queue_count = dpaa_dev_rx_queue_count, .rx_burst_mode_get = dpaa_dev_rx_burst_mode_get, .tx_burst_mode_get = dpaa_dev_tx_burst_mode_get, .rxq_info_get = dpaa_rxq_info_get, @@ -1917,6 +1916,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) /* Populate ethdev structure */ eth_dev->dev_ops = &dpaa_devops; + eth_dev->rx_queue_count = dpaa_dev_rx_queue_count; eth_dev->rx_pkt_burst = dpaa_eth_queue_rx; eth_dev->tx_pkt_burst = dpaa_eth_tx_drop_all; diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 02c254846c..38cf0ab71c 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -2331,7 +2331,6 @@ static struct eth_dev_ops dpaa2_ethdev_ops = { .tx_queue_release = dpaa2_dev_tx_queue_release, .rx_burst_mode_get = dpaa2_dev_rx_burst_mode_get, .tx_burst_mode_get = dpaa2_dev_tx_burst_mode_get, - .rx_queue_count = dpaa2_dev_rx_queue_count, .flow_ctrl_get = dpaa2_flow_ctrl_get, .flow_ctrl_set = dpaa2_flow_ctrl_set, .mac_addr_add = dpaa2_dev_add_mac_addr, @@ -2486,6 +2485,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) * plugged. */ eth_dev->dev_ops = &dpaa2_ethdev_ops; + eth_dev->rx_queue_count = dpaa2_dev_rx_queue_count; if (dpaa2_get_devargs(dev->devargs, DRIVER_LOOPBACK_MODE)) eth_dev->rx_pkt_burst = dpaa2_dev_loopback_rx; else if (dpaa2_get_devargs(dev->devargs, diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index 902b1cdca0..82766da882 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -176,10 +176,6 @@ static const struct eth_dev_ops eth_em_ops = { .vlan_offload_set = eth_em_vlan_offload_set, .rx_queue_setup = eth_em_rx_queue_setup, .rx_queue_release = eth_em_rx_queue_release, - .rx_queue_count = eth_em_rx_queue_count, - .rx_descriptor_done = eth_em_rx_descriptor_done, - .rx_descriptor_status = eth_em_rx_descriptor_status, - .tx_descriptor_status = eth_em_tx_descriptor_status, .tx_queue_setup = eth_em_tx_queue_setup, .tx_queue_release = eth_em_tx_queue_release, .rx_queue_intr_enable = eth_em_rx_queue_intr_enable, @@ -250,6 +246,10 @@ eth_em_dev_init(struct rte_eth_dev *eth_dev) E1000_DEV_PRIVATE_TO_VFTA(eth_dev->data->dev_private); eth_dev->dev_ops = ð_em_ops; + eth_dev->rx_queue_count = eth_em_rx_queue_count; + eth_dev->rx_descriptor_done = eth_em_rx_descriptor_done; + eth_dev->rx_descriptor_status = eth_em_rx_descriptor_status; + eth_dev->tx_descriptor_status = eth_em_tx_descriptor_status; eth_dev->rx_pkt_burst = (eth_rx_burst_t)ð_em_recv_pkts; eth_dev->tx_pkt_burst = (eth_tx_burst_t)ð_em_xmit_pkts; eth_dev->tx_pkt_prepare = (eth_tx_prep_t)ð_em_prep_pkts; diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index a5551e8175..fe0cea88c2 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -380,10 +380,6 @@ static const struct eth_dev_ops eth_igb_ops = { .rx_queue_intr_enable = eth_igb_rx_queue_intr_enable, .rx_queue_intr_disable = eth_igb_rx_queue_intr_disable, .rx_queue_release = eth_igb_rx_queue_release, - .rx_queue_count = eth_igb_rx_queue_count, - .rx_descriptor_done = eth_igb_rx_descriptor_done, - .rx_descriptor_status = eth_igb_rx_descriptor_status, - .tx_descriptor_status = eth_igb_tx_descriptor_status, .tx_queue_setup = eth_igb_tx_queue_setup, .tx_queue_release = eth_igb_tx_queue_release, .tx_done_cleanup = eth_igb_tx_done_cleanup, @@ -441,9 +437,6 @@ static const struct eth_dev_ops igbvf_eth_dev_ops = { .dev_supported_ptypes_get = eth_igb_supported_ptypes_get, .rx_queue_setup = eth_igb_rx_queue_setup, .rx_queue_release = eth_igb_rx_queue_release, - .rx_descriptor_done = eth_igb_rx_descriptor_done, - .rx_descriptor_status = eth_igb_rx_descriptor_status, - .tx_descriptor_status = eth_igb_tx_descriptor_status, .tx_queue_setup = eth_igb_tx_queue_setup, .tx_queue_release = eth_igb_tx_queue_release, .tx_done_cleanup = eth_igb_tx_done_cleanup, @@ -754,6 +747,10 @@ eth_igb_dev_init(struct rte_eth_dev *eth_dev) uint32_t ctrl_ext; eth_dev->dev_ops = ð_igb_ops; + eth_dev->rx_queue_count = eth_igb_rx_queue_count; + eth_dev->rx_descriptor_done = eth_igb_rx_descriptor_done; + eth_dev->rx_descriptor_status = eth_igb_rx_descriptor_status; + eth_dev->tx_descriptor_status = eth_igb_tx_descriptor_status; eth_dev->rx_pkt_burst = ð_igb_recv_pkts; eth_dev->tx_pkt_burst = ð_igb_xmit_pkts; eth_dev->tx_pkt_prepare = ð_igb_prep_pkts; @@ -949,6 +946,9 @@ eth_igbvf_dev_init(struct rte_eth_dev *eth_dev) PMD_INIT_FUNC_TRACE(); eth_dev->dev_ops = &igbvf_eth_dev_ops; + eth_dev->rx_descriptor_done = eth_igb_rx_descriptor_done; + eth_dev->rx_descriptor_status = eth_igb_rx_descriptor_status; + eth_dev->tx_descriptor_status = eth_igb_tx_descriptor_status; eth_dev->rx_pkt_burst = ð_igb_recv_pkts; eth_dev->tx_pkt_burst = ð_igb_xmit_pkts; eth_dev->tx_pkt_prepare = ð_igb_prep_pkts; diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index ca75919ee2..2cffa3aa2d 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -1141,8 +1141,6 @@ static const struct eth_dev_ops enicpmd_eth_dev_ops = { .tx_queue_stop = enicpmd_dev_tx_queue_stop, .rx_queue_setup = enicpmd_dev_rx_queue_setup, .rx_queue_release = enicpmd_dev_rx_queue_release, - .rx_queue_count = enicpmd_dev_rx_queue_count, - .rx_descriptor_done = NULL, .tx_queue_setup = enicpmd_dev_tx_queue_setup, .tx_queue_release = enicpmd_dev_tx_queue_release, .rx_queue_intr_enable = enicpmd_dev_rx_queue_intr_enable, @@ -1279,6 +1277,7 @@ static int eth_enicpmd_dev_init(struct rte_eth_dev *eth_dev) ENICPMD_FUNC_TRACE(); eth_dev->dev_ops = &enicpmd_eth_dev_ops; + eth_dev->rx_queue_count = enicpmd_dev_rx_queue_count; eth_dev->rx_pkt_burst = &enic_recv_pkts; eth_dev->tx_pkt_burst = &enic_xmit_pkts; eth_dev->tx_pkt_prepare = &enic_prep_pkts; diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index fd927923da..e6043e1455 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -2855,10 +2855,6 @@ static const struct eth_dev_ops fm10k_eth_dev_ops = { .rx_queue_release = fm10k_rx_queue_release, .tx_queue_setup = fm10k_tx_queue_setup, .tx_queue_release = fm10k_tx_queue_release, - .rx_queue_count = fm10k_dev_rx_queue_count, - .rx_descriptor_done = fm10k_dev_rx_descriptor_done, - .rx_descriptor_status = fm10k_dev_rx_descriptor_status, - .tx_descriptor_status = fm10k_dev_tx_descriptor_status, .rx_queue_intr_enable = fm10k_dev_rx_queue_intr_enable, .rx_queue_intr_disable = fm10k_dev_rx_queue_intr_disable, .reta_update = fm10k_reta_update, @@ -3055,6 +3051,10 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev) PMD_INIT_FUNC_TRACE(); dev->dev_ops = &fm10k_eth_dev_ops; + dev->rx_queue_count = fm10k_dev_rx_queue_count; + dev->rx_descriptor_done = fm10k_dev_rx_descriptor_done; + dev->rx_descriptor_status = fm10k_dev_rx_descriptor_status; + dev->tx_descriptor_status = fm10k_dev_tx_descriptor_status; dev->rx_pkt_burst = &fm10k_recv_pkts; dev->tx_pkt_burst = &fm10k_xmit_pkts; dev->tx_pkt_prepare = &fm10k_prep_pkts; diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 841447228a..80efd06cd9 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -474,10 +474,6 @@ static const struct eth_dev_ops i40e_eth_dev_ops = { .rx_queue_intr_enable = i40e_dev_rx_queue_intr_enable, .rx_queue_intr_disable = i40e_dev_rx_queue_intr_disable, .rx_queue_release = i40e_dev_rx_queue_release, - .rx_queue_count = i40e_dev_rx_queue_count, - .rx_descriptor_done = i40e_dev_rx_descriptor_done, - .rx_descriptor_status = i40e_dev_rx_descriptor_status, - .tx_descriptor_status = i40e_dev_tx_descriptor_status, .tx_queue_setup = i40e_dev_tx_queue_setup, .tx_queue_release = i40e_dev_tx_queue_release, .dev_led_on = i40e_dev_led_on, @@ -1448,6 +1444,10 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused) PMD_INIT_FUNC_TRACE(); dev->dev_ops = &i40e_eth_dev_ops; + dev->rx_queue_count = i40e_dev_rx_queue_count; + dev->rx_descriptor_done = i40e_dev_rx_descriptor_done; + dev->rx_descriptor_status = i40e_dev_rx_descriptor_status; + dev->tx_descriptor_status = i40e_dev_tx_descriptor_status; dev->rx_pkt_burst = i40e_recv_pkts; dev->tx_pkt_burst = i40e_xmit_pkts; dev->tx_pkt_prepare = i40e_prep_pkts; diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index b755350cd2..be4b28fa45 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -199,12 +199,8 @@ static const struct eth_dev_ops i40evf_eth_dev_ops = { .rx_queue_release = i40e_dev_rx_queue_release, .rx_queue_intr_enable = i40evf_dev_rx_queue_intr_enable, .rx_queue_intr_disable = i40evf_dev_rx_queue_intr_disable, - .rx_descriptor_done = i40e_dev_rx_descriptor_done, - .rx_descriptor_status = i40e_dev_rx_descriptor_status, - .tx_descriptor_status = i40e_dev_tx_descriptor_status, .tx_queue_setup = i40e_dev_tx_queue_setup, .tx_queue_release = i40e_dev_tx_queue_release, - .rx_queue_count = i40e_dev_rx_queue_count, .rxq_info_get = i40e_rxq_info_get, .txq_info_get = i40e_txq_info_get, .mac_addr_add = i40evf_add_mac_addr, @@ -1561,6 +1557,10 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev) /* assign ops func pointer */ eth_dev->dev_ops = &i40evf_eth_dev_ops; + eth_dev->rx_queue_count = i40e_dev_rx_queue_count; + eth_dev->rx_descriptor_done = i40e_dev_rx_descriptor_done; + eth_dev->rx_descriptor_status = i40e_dev_rx_descriptor_status; + eth_dev->tx_descriptor_status = i40e_dev_tx_descriptor_status; eth_dev->rx_pkt_burst = &i40e_recv_pkts; eth_dev->tx_pkt_burst = &i40e_xmit_pkts; diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 8e1d8a8d3e..e1ff38e8be 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -117,9 +117,6 @@ static const struct eth_dev_ops iavf_eth_dev_ops = { .rss_hash_conf_get = iavf_dev_rss_hash_conf_get, .rxq_info_get = iavf_dev_rxq_info_get, .txq_info_get = iavf_dev_txq_info_get, - .rx_queue_count = iavf_dev_rxq_count, - .rx_descriptor_status = iavf_dev_rx_desc_status, - .tx_descriptor_status = iavf_dev_tx_desc_status, .mtu_set = iavf_dev_mtu_set, .rx_queue_intr_enable = iavf_dev_rx_queue_intr_enable, .rx_queue_intr_disable = iavf_dev_rx_queue_intr_disable, @@ -1383,6 +1380,9 @@ iavf_dev_init(struct rte_eth_dev *eth_dev) /* assign ops func pointer */ eth_dev->dev_ops = &iavf_eth_dev_ops; + eth_dev->rx_queue_count = iavf_dev_rxq_count; + eth_dev->rx_descriptor_status = iavf_dev_rx_desc_status; + eth_dev->tx_descriptor_status = iavf_dev_tx_desc_status; eth_dev->rx_pkt_burst = &iavf_recv_pkts; eth_dev->tx_pkt_burst = &iavf_xmit_pkts; eth_dev->tx_pkt_prepare = &iavf_prep_pkts; diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index c5dac2e328..c8b16c7f87 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -205,9 +205,6 @@ static const struct eth_dev_ops ice_eth_dev_ops = { .tx_burst_mode_get = ice_tx_burst_mode_get, .get_eeprom_length = ice_get_eeprom_length, .get_eeprom = ice_get_eeprom, - .rx_queue_count = ice_rx_queue_count, - .rx_descriptor_status = ice_rx_descriptor_status, - .tx_descriptor_status = ice_tx_descriptor_status, .stats_get = ice_stats_get, .stats_reset = ice_stats_reset, .xstats_get = ice_xstats_get, @@ -2163,6 +2160,9 @@ ice_dev_init(struct rte_eth_dev *dev) int ret; dev->dev_ops = &ice_eth_dev_ops; + dev->rx_queue_count = ice_rx_queue_count; + dev->rx_descriptor_status = ice_rx_descriptor_status; + dev->tx_descriptor_status = ice_tx_descriptor_status; dev->rx_pkt_burst = ice_recv_pkts; dev->tx_pkt_burst = ice_xmit_pkts; dev->tx_pkt_prepare = ice_prep_pkts; diff --git a/drivers/net/igc/igc_ethdev.c b/drivers/net/igc/igc_ethdev.c index 6ab3ee909d..aa37c11861 100644 --- a/drivers/net/igc/igc_ethdev.c +++ b/drivers/net/igc/igc_ethdev.c @@ -272,10 +272,6 @@ static const struct eth_dev_ops eth_igc_ops = { .rx_queue_setup = eth_igc_rx_queue_setup, .rx_queue_release = eth_igc_rx_queue_release, - .rx_queue_count = eth_igc_rx_queue_count, - .rx_descriptor_done = eth_igc_rx_descriptor_done, - .rx_descriptor_status = eth_igc_rx_descriptor_status, - .tx_descriptor_status = eth_igc_tx_descriptor_status, .tx_queue_setup = eth_igc_tx_queue_setup, .tx_queue_release = eth_igc_tx_queue_release, .tx_done_cleanup = eth_igc_tx_done_cleanup, @@ -1227,6 +1223,10 @@ eth_igc_dev_init(struct rte_eth_dev *dev) PMD_INIT_FUNC_TRACE(); dev->dev_ops = ð_igc_ops; + dev->rx_descriptor_done = eth_igc_rx_descriptor_done; + dev->rx_queue_count = eth_igc_rx_queue_count; + dev->rx_descriptor_status = eth_igc_rx_descriptor_status; + dev->tx_descriptor_status = eth_igc_tx_descriptor_status; /* * for secondary processes, we don't initialize any further as primary diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index d9582473a4..337ce90fbf 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -545,10 +545,6 @@ static const struct eth_dev_ops ixgbe_eth_dev_ops = { .rx_queue_intr_enable = ixgbe_dev_rx_queue_intr_enable, .rx_queue_intr_disable = ixgbe_dev_rx_queue_intr_disable, .rx_queue_release = ixgbe_dev_rx_queue_release, - .rx_queue_count = ixgbe_dev_rx_queue_count, - .rx_descriptor_done = ixgbe_dev_rx_descriptor_done, - .rx_descriptor_status = ixgbe_dev_rx_descriptor_status, - .tx_descriptor_status = ixgbe_dev_tx_descriptor_status, .tx_queue_setup = ixgbe_dev_tx_queue_setup, .tx_queue_release = ixgbe_dev_tx_queue_release, .dev_led_on = ixgbe_dev_led_on, @@ -622,9 +618,6 @@ static const struct eth_dev_ops ixgbevf_eth_dev_ops = { .vlan_offload_set = ixgbevf_vlan_offload_set, .rx_queue_setup = ixgbe_dev_rx_queue_setup, .rx_queue_release = ixgbe_dev_rx_queue_release, - .rx_descriptor_done = ixgbe_dev_rx_descriptor_done, - .rx_descriptor_status = ixgbe_dev_rx_descriptor_status, - .tx_descriptor_status = ixgbe_dev_tx_descriptor_status, .tx_queue_setup = ixgbe_dev_tx_queue_setup, .tx_queue_release = ixgbe_dev_tx_queue_release, .rx_queue_intr_enable = ixgbevf_dev_rx_queue_intr_enable, @@ -1091,6 +1084,10 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused) ixgbe_dev_macsec_setting_reset(eth_dev); eth_dev->dev_ops = &ixgbe_eth_dev_ops; + eth_dev->rx_queue_count = ixgbe_dev_rx_queue_count; + eth_dev->rx_descriptor_done = ixgbe_dev_rx_descriptor_done; + eth_dev->rx_descriptor_status = ixgbe_dev_rx_descriptor_status; + eth_dev->tx_descriptor_status = ixgbe_dev_tx_descriptor_status; eth_dev->rx_pkt_burst = &ixgbe_recv_pkts; eth_dev->tx_pkt_burst = &ixgbe_xmit_pkts; eth_dev->tx_pkt_prepare = &ixgbe_prep_pkts; @@ -1570,6 +1567,9 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev) PMD_INIT_FUNC_TRACE(); eth_dev->dev_ops = &ixgbevf_eth_dev_ops; + eth_dev->rx_descriptor_done = ixgbe_dev_rx_descriptor_done; + eth_dev->rx_descriptor_status = ixgbe_dev_rx_descriptor_status; + eth_dev->tx_descriptor_status = ixgbe_dev_tx_descriptor_status; eth_dev->rx_pkt_burst = &ixgbe_recv_pkts; eth_dev->tx_pkt_burst = &ixgbe_xmit_pkts; diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index bf1f82ba67..ec3cc4000e 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -601,6 +601,8 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, } eth_dev->device = dpdk_dev; eth_dev->dev_ops = &mlx5_os_dev_sec_ops; + eth_dev->rx_descriptor_status = mlx5_rx_descriptor_status; + eth_dev->tx_descriptor_status = mlx5_tx_descriptor_status; err = mlx5_proc_priv_init(eth_dev); if (err) return NULL; @@ -1208,6 +1210,9 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, eth_dev->rx_pkt_burst = removed_rx_burst; eth_dev->tx_pkt_burst = removed_tx_burst; eth_dev->dev_ops = &mlx5_os_dev_ops; + eth_dev->rx_descriptor_status = mlx5_rx_descriptor_status; + eth_dev->tx_descriptor_status = mlx5_tx_descriptor_status; + eth_dev->rx_queue_count = mlx5_rx_queue_count; /* Register MAC address. */ claim_zero(mlx5_mac_addr_add(eth_dev, &mac, 0, 0)); if (config->vf && config->vf_nl_en) @@ -2396,13 +2401,10 @@ const struct eth_dev_ops mlx5_os_dev_ops = { .rss_hash_update = mlx5_rss_hash_update, .rss_hash_conf_get = mlx5_rss_hash_conf_get, .filter_ctrl = mlx5_dev_filter_ctrl, - .rx_descriptor_status = mlx5_rx_descriptor_status, - .tx_descriptor_status = mlx5_tx_descriptor_status, .rxq_info_get = mlx5_rxq_info_get, .txq_info_get = mlx5_txq_info_get, .rx_burst_mode_get = mlx5_rx_burst_mode_get, .tx_burst_mode_get = mlx5_tx_burst_mode_get, - .rx_queue_count = mlx5_rx_queue_count, .rx_queue_intr_enable = mlx5_rx_intr_enable, .rx_queue_intr_disable = mlx5_rx_intr_disable, .is_removed = mlx5_is_removed, @@ -2427,8 +2429,6 @@ const struct eth_dev_ops mlx5_os_dev_sec_ops = { .rx_queue_stop = mlx5_rx_queue_stop, .tx_queue_start = mlx5_tx_queue_start, .tx_queue_stop = mlx5_tx_queue_stop, - .rx_descriptor_status = mlx5_rx_descriptor_status, - .tx_descriptor_status = mlx5_tx_descriptor_status, .rxq_info_get = mlx5_rxq_info_get, .txq_info_get = mlx5_txq_info_get, .rx_burst_mode_get = mlx5_rx_burst_mode_get, @@ -2480,8 +2480,6 @@ const struct eth_dev_ops mlx5_os_dev_ops_isolate = { .vlan_strip_queue_set = mlx5_vlan_strip_queue_set, .vlan_offload_set = mlx5_vlan_offload_set, .filter_ctrl = mlx5_dev_filter_ctrl, - .rx_descriptor_status = mlx5_rx_descriptor_status, - .tx_descriptor_status = mlx5_tx_descriptor_status, .rxq_info_get = mlx5_rxq_info_get, .txq_info_get = mlx5_txq_info_get, .rx_burst_mode_get = mlx5_rx_burst_mode_get, diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 4c29898203..eb55bd7f99 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -5138,6 +5138,10 @@ mlx5_flow_isolate(struct rte_eth_dev *dev, dev->dev_ops = &mlx5_os_dev_ops_isolate; else dev->dev_ops = &mlx5_os_dev_ops; + + dev->rx_descriptor_status = mlx5_rx_descriptor_status; + dev->tx_descriptor_status = mlx5_tx_descriptor_status; + return 0; } diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index fd91c0e491..229c1b9149 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -871,11 +871,8 @@ static const struct eth_dev_ops hn_eth_dev_ops = { .tx_queue_setup = hn_dev_tx_queue_setup, .tx_queue_release = hn_dev_tx_queue_release, .tx_done_cleanup = hn_dev_tx_done_cleanup, - .tx_descriptor_status = hn_dev_tx_descriptor_status, .rx_queue_setup = hn_dev_rx_queue_setup, .rx_queue_release = hn_dev_rx_queue_release, - .rx_queue_count = hn_dev_rx_queue_count, - .rx_descriptor_status = hn_dev_rx_queue_status, .link_update = hn_dev_link_update, .stats_get = hn_dev_stats_get, .stats_reset = hn_dev_stats_reset, @@ -936,6 +933,9 @@ eth_hn_dev_init(struct rte_eth_dev *eth_dev) vmbus = container_of(device, struct rte_vmbus_device, device); eth_dev->dev_ops = &hn_eth_dev_ops; + eth_dev->rx_queue_count = hn_dev_rx_queue_count; + eth_dev->rx_descriptor_status = hn_dev_rx_queue_status; + eth_dev->tx_descriptor_status = hn_dev_tx_descriptor_status; eth_dev->tx_pkt_burst = &hn_xmit_pkts; eth_dev->rx_pkt_burst = &hn_recv_pkts; diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index 99946279db..c556dedab6 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -2701,7 +2701,6 @@ static const struct eth_dev_ops nfp_net_eth_dev_ops = { .rss_hash_conf_get = nfp_net_rss_hash_conf_get, .rx_queue_setup = nfp_net_rx_queue_setup, .rx_queue_release = nfp_net_rx_queue_release, - .rx_queue_count = nfp_net_rx_queue_count, .tx_queue_setup = nfp_net_tx_queue_setup, .tx_queue_release = nfp_net_tx_queue_release, .rx_queue_intr_enable = nfp_rx_queue_intr_enable, @@ -2785,6 +2784,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev) } eth_dev->dev_ops = &nfp_net_eth_dev_ops; + eth_dev->rx_queue_count = nfp_net_rx_queue_count; eth_dev->rx_pkt_burst = &nfp_net_recv_pkts; eth_dev->tx_pkt_burst = &nfp_net_xmit_pkts; diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c index 33b72bd4db..c06e32f26b 100644 --- a/drivers/net/octeontx2/otx2_ethdev.c +++ b/drivers/net/octeontx2/otx2_ethdev.c @@ -2272,10 +2272,6 @@ static const struct eth_dev_ops otx2_eth_dev_ops = { .txq_info_get = otx2_nix_txq_info_get, .rx_burst_mode_get = otx2_rx_burst_mode_get, .tx_burst_mode_get = otx2_tx_burst_mode_get, - .rx_queue_count = otx2_nix_rx_queue_count, - .rx_descriptor_done = otx2_nix_rx_descriptor_done, - .rx_descriptor_status = otx2_nix_rx_descriptor_status, - .tx_descriptor_status = otx2_nix_tx_descriptor_status, .tx_done_cleanup = otx2_nix_tx_done_cleanup, .set_queue_rate_limit = otx2_nix_tm_set_queue_rate_limit, .pool_ops_supported = otx2_nix_pool_ops_supported, @@ -2382,6 +2378,10 @@ otx2_eth_dev_init(struct rte_eth_dev *eth_dev) int rc, max_entries; eth_dev->dev_ops = &otx2_eth_dev_ops; + eth_dev->rx_descriptor_done = otx2_nix_rx_descriptor_done; + eth_dev->rx_queue_count = otx2_nix_rx_queue_count; + eth_dev->rx_descriptor_status = otx2_nix_rx_descriptor_status; + eth_dev->tx_descriptor_status = otx2_nix_tx_descriptor_status; /* For secondary processes, the primary has done all the work */ if (rte_eal_process_type() != RTE_PROC_PRIMARY) { diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index 70d48e48ef..59f1746ee9 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -2386,7 +2386,6 @@ static const struct eth_dev_ops qede_eth_dev_ops = { .dev_infos_get = qede_dev_info_get, .rx_queue_setup = qede_rx_queue_setup, .rx_queue_release = qede_rx_queue_release, - .rx_descriptor_status = qede_rx_descriptor_status, .tx_queue_setup = qede_tx_queue_setup, .tx_queue_release = qede_tx_queue_release, .dev_start = qede_dev_start, @@ -2431,7 +2430,6 @@ static const struct eth_dev_ops qede_eth_vf_dev_ops = { .dev_infos_get = qede_dev_info_get, .rx_queue_setup = qede_rx_queue_setup, .rx_queue_release = qede_rx_queue_release, - .rx_descriptor_status = qede_rx_descriptor_status, .tx_queue_setup = qede_tx_queue_setup, .tx_queue_release = qede_tx_queue_release, .dev_start = qede_dev_start, @@ -2670,6 +2668,7 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf) } eth_dev->dev_ops = (is_vf) ? &qede_eth_vf_dev_ops : &qede_eth_dev_ops; + eth_dev->rx_descriptor_status = qede_rx_descriptor_status; adapter->num_tx_queues = 0; adapter->num_rx_queues = 0; diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index acee3e48e4..1a58e0df84 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -1819,10 +1819,6 @@ static const struct eth_dev_ops sfc_eth_dev_ops = { .tx_queue_stop = sfc_tx_queue_stop, .rx_queue_setup = sfc_rx_queue_setup, .rx_queue_release = sfc_rx_queue_release, - .rx_queue_count = sfc_rx_queue_count, - .rx_descriptor_done = sfc_rx_descriptor_done, - .rx_descriptor_status = sfc_rx_descriptor_status, - .tx_descriptor_status = sfc_tx_descriptor_status, .rx_queue_intr_enable = sfc_rx_queue_intr_enable, .rx_queue_intr_disable = sfc_rx_queue_intr_disable, .tx_queue_setup = sfc_tx_queue_setup, @@ -1977,6 +1973,10 @@ sfc_eth_dev_set_ops(struct rte_eth_dev *dev) dev->tx_pkt_prepare = dp_tx->pkt_prepare; dev->tx_pkt_burst = dp_tx->pkt_burst; + dev->rx_queue_count = sfc_rx_queue_count; + dev->rx_descriptor_done = sfc_rx_descriptor_done; + dev->rx_descriptor_status = sfc_rx_descriptor_status; + dev->tx_descriptor_status = sfc_tx_descriptor_status; dev->dev_ops = &sfc_eth_dev_ops; return 0; @@ -2017,10 +2017,6 @@ sfc_eth_dev_clear_ops(struct rte_eth_dev *dev) static const struct eth_dev_ops sfc_eth_dev_secondary_ops = { .dev_supported_ptypes_get = sfc_dev_supported_ptypes_get, - .rx_queue_count = sfc_rx_queue_count, - .rx_descriptor_done = sfc_rx_descriptor_done, - .rx_descriptor_status = sfc_rx_descriptor_status, - .tx_descriptor_status = sfc_tx_descriptor_status, .reta_query = sfc_dev_rss_reta_query, .rss_hash_conf_get = sfc_dev_rss_hash_conf_get, .rxq_info_get = sfc_rx_queue_info_get, @@ -2085,6 +2081,10 @@ sfc_eth_dev_secondary_init(struct rte_eth_dev *dev, uint32_t logtype_main) dev->rx_pkt_burst = dp_rx->pkt_burst; dev->tx_pkt_prepare = dp_tx->pkt_prepare; dev->tx_pkt_burst = dp_tx->pkt_burst; + dev->rx_queue_count = sfc_rx_queue_count; + dev->rx_descriptor_done = sfc_rx_descriptor_done; + dev->rx_descriptor_status = sfc_rx_descriptor_status; + dev->tx_descriptor_status = sfc_tx_descriptor_status; dev->dev_ops = &sfc_eth_dev_secondary_ops; return 0; diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index d955a7ee23..959c8e4ddc 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -2029,7 +2029,6 @@ static const struct eth_dev_ops nicvf_eth_dev_ops = { .tx_queue_stop = nicvf_dev_tx_queue_stop, .rx_queue_setup = nicvf_dev_rx_queue_setup, .rx_queue_release = nicvf_dev_rx_queue_release, - .rx_queue_count = nicvf_dev_rx_queue_count, .tx_queue_setup = nicvf_dev_tx_queue_setup, .tx_queue_release = nicvf_dev_tx_queue_release, .dev_set_link_up = nicvf_dev_set_link_up, @@ -2134,6 +2133,7 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev) PMD_INIT_FUNC_TRACE(); eth_dev->dev_ops = &nicvf_eth_dev_ops; + eth_dev->rx_queue_count = nicvf_dev_rx_queue_count; /* For secondary processes, the primary has done all the work */ if (rte_eal_process_type() != RTE_PROC_PRIMARY) { diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index e55278af69..fa365605ef 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -1385,7 +1385,6 @@ static const struct eth_dev_ops ops = { .rx_queue_release = eth_queue_release, .tx_queue_release = eth_queue_release, .tx_done_cleanup = eth_tx_done_cleanup, - .rx_queue_count = eth_rx_queue_count, .link_update = eth_link_update, .stats_get = eth_stats_get, .stats_reset = eth_stats_reset, @@ -1447,6 +1446,7 @@ eth_dev_vhost_create(struct rte_vdev_device *dev, char *iface_name, data->all_multicast = 1; eth_dev->dev_ops = &ops; + eth_dev->rx_queue_count = eth_rx_queue_count; /* finally assign rx and tx ops */ eth_dev->rx_pkt_burst = eth_vhost_rx; diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index dc0093bdf0..4f2fa0d943 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -920,7 +920,6 @@ static const struct eth_dev_ops virtio_eth_dev_ops = { .rx_queue_intr_enable = virtio_dev_rx_queue_intr_enable, .rx_queue_intr_disable = virtio_dev_rx_queue_intr_disable, .rx_queue_release = virtio_dev_queue_release, - .rx_descriptor_done = virtio_dev_rx_queue_done, .tx_queue_setup = virtio_dev_tx_queue_setup, .tx_queue_release = virtio_dev_queue_release, /* collect stats per queue */ @@ -1903,6 +1902,7 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev) } eth_dev->dev_ops = &virtio_eth_dev_ops; + eth_dev->rx_descriptor_done = virtio_dev_rx_queue_done; if (rte_eal_process_type() == RTE_PROC_SECONDARY) { if (!hw->virtio_user_dev) { diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index eb6cd01f8d..b6f26a513b 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -4545,11 +4545,11 @@ rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id) RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); dev = &rte_eth_devices[port_id]; - RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP); + RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_queue_count, -ENOTSUP); if (queue_id >= dev->data->nb_rx_queues) return -EINVAL; - return (int)(*dev->dev_ops->rx_queue_count)(dev, queue_id); + return (int)(*dev->rx_queue_count)(dev, queue_id); } /** @@ -4573,9 +4573,8 @@ rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); - RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP); - return (*dev->dev_ops->rx_descriptor_done)( \ - dev->data->rx_queues[queue_id], offset); + RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_descriptor_done, -ENOTSUP); + return (*dev->rx_descriptor_done)(dev->data->rx_queues[queue_id], offset); } #define RTE_ETH_RX_DESC_AVAIL 0 /**< Desc available for hw. */ @@ -4630,10 +4629,10 @@ rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id, if (queue_id >= dev->data->nb_rx_queues) return -ENODEV; #endif - RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_status, -ENOTSUP); + RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_descriptor_status, -ENOTSUP); rxq = dev->data->rx_queues[queue_id]; - return (*dev->dev_ops->rx_descriptor_status)(rxq, offset); + return (*dev->rx_descriptor_status)(rxq, offset); } #define RTE_ETH_TX_DESC_FULL 0 /**< Desc filled for hw, waiting xmit. */ @@ -4687,10 +4686,10 @@ static inline int rte_eth_tx_descriptor_status(uint16_t port_id, if (queue_id >= dev->data->nb_tx_queues) return -ENODEV; #endif - RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_descriptor_status, -ENOTSUP); + RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_descriptor_status, -ENOTSUP); txq = dev->data->tx_queues[queue_id]; - return (*dev->dev_ops->tx_descriptor_status)(txq, offset); + return (*dev->tx_descriptor_status)(txq, offset); } /** diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h index 32407dd418..8ed827475f 100644 --- a/lib/librte_ethdev/rte_ethdev_core.h +++ b/lib/librte_ethdev/rte_ethdev_core.h @@ -660,13 +660,6 @@ struct eth_dev_ops { eth_queue_stop_t tx_queue_stop; /**< Stop TX for a queue. */ eth_rx_queue_setup_t rx_queue_setup;/**< Set up device RX queue. */ eth_queue_release_t rx_queue_release; /**< Release RX queue. */ - eth_rx_queue_count_t rx_queue_count; - /**< Get the number of used RX descriptors. */ - eth_rx_descriptor_done_t rx_descriptor_done; /**< Check rxd DD bit. */ - 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. */ /* * Static inline functions use functions ABOVE this comment. * New dev_ops functions should be added BELOW to avoid breaking ABI. @@ -782,6 +775,12 @@ struct rte_eth_dev { eth_rx_burst_t rx_pkt_burst; /**< Pointer to PMD receive function. */ eth_tx_burst_t tx_pkt_burst; /**< Pointer to PMD transmit function. */ eth_tx_prep_t tx_pkt_prepare; /**< Pointer to PMD transmit prepare function. */ + + eth_rx_queue_count_t rx_queue_count; /**< Get the number of used RX descriptors. */ + eth_rx_descriptor_done_t rx_descriptor_done; /**< Check rxd DD bit. */ + 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. */ + /** * Next two fields are per-device data but *data is shared between * primary and secondary processes and *process_private is per-process From patchwork Wed Sep 9 13:01:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 77044 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E69C6A04B1; Wed, 9 Sep 2020 15:02:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C9FB51B9B7; Wed, 9 Sep 2020 15:02:40 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id EE7D8160 for ; Wed, 9 Sep 2020 15:02:37 +0200 (CEST) IronPort-SDR: rZ76u2E3uzZ3vDQqCY4IKD2XKuTHU8MNhV0imvm144tdMn6EX45gmSxtB8SJhyFWhk0EM4hA6E KZzRxFUhnWtw== X-IronPort-AV: E=McAfee;i="6000,8403,9738"; a="146038579" X-IronPort-AV: E=Sophos;i="5.76,409,1592895600"; d="scan'208";a="146038579" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2020 06:02:08 -0700 IronPort-SDR: 9tjDi0vzTWIUpqSJ5K7dlR9263DVOD4Q9U8hHhv6C4RIAJWTGn9vLWfpRn1QFikBj6Zrv91eeM sliwx+U3leUA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,409,1592895600"; d="scan'208";a="341567088" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by FMSMGA003.fm.intel.com with ESMTP; 09 Sep 2020 06:02:04 -0700 From: Ferruh Yigit To: dev@dpdk.org, Ray Kinsella , Neil Horman , John McNamara , Marko Kovacevic , Beilei Xing , Jeff Guo , Wei Zhao , Thomas Monjalon , Andrew Rybchenko , Ori Kam , Cristian Dumitrescu Cc: Ferruh Yigit , David Marchand Date: Wed, 9 Sep 2020 14:01:44 +0100 Message-Id: <20200909130148.1756518-3-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200909130148.1756518-1-ferruh.yigit@intel.com> References: <20200824094021.2323605-1-ferruh.yigit@intel.com> <20200909130148.1756518-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 3/7] ethdev: make device operations struct private X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Hiding the 'struct eth_dev_ops' from applications. Removing relevant deprecation notice. Signed-off-by: Ferruh Yigit Acked-by: Andrew Rybchenko Acked-by: David Marchand --- Cc: David Marchand v3: * release note updated v4: * Fix wording in release notes, s/inline/internal --- doc/guides/rel_notes/deprecation.rst | 9 - doc/guides/rel_notes/release_20_11.rst | 2 + drivers/net/i40e/i40e_vf_representor.c | 1 + drivers/net/ixgbe/ixgbe_vf_representor.c | 1 + lib/librte_ethdev/rte_ethdev_core.h | 712 +---------------------- lib/librte_ethdev/rte_ethdev_driver.h | 694 ++++++++++++++++++++++ lib/librte_ethdev/rte_flow_driver.h | 1 + lib/librte_ethdev/rte_mtr_driver.h | 1 + lib/librte_ethdev/rte_tm_driver.h | 1 + 9 files changed, 710 insertions(+), 712 deletions(-) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 35c676e262..8770c87006 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -156,15 +156,6 @@ Deprecation Notices Due to adoption of C11 atomic builtins, the field ``refcnt_atomic`` will be replaced with ``refcnt`` of type ``uint16_t`` in DPDK 20.11. -* ethdev: Split the ``struct eth_dev_ops`` struct to hide it as much as possible - will be done in 20.11. - Currently the ``struct eth_dev_ops`` struct is accessible by the application - because some inline functions, like ``rte_eth_tx_descriptor_status()``, - access the struct directly. - The struct will be separate in two, the ops used by inline functions will be - moved next to Rx/Tx burst functions, rest of the ``struct eth_dev_ops`` struct - will be moved to header file for drivers to hide it from applications. - * ethdev: the legacy filter API, including ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` as well as filter types MACVLAN, ETHERTYPE, FLEXIBLE, SYN, NTUPLE, TUNNEL, FDIR, diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst index ff7242012b..9b5bfcfae8 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -111,6 +111,8 @@ ABI Changes * ``eth_rx_descriptor_status_t rx_descriptor_status;`` * ``eth_tx_descriptor_status_t tx_descriptor_status;`` + * ``struct eth_dev_ops`` is no more accessible by applications, which was already internal data structure. + Known Issues ------------ diff --git a/drivers/net/i40e/i40e_vf_representor.c b/drivers/net/i40e/i40e_vf_representor.c index 083bc1a5f3..f09d4d8798 100644 --- a/drivers/net/i40e/i40e_vf_representor.c +++ b/drivers/net/i40e/i40e_vf_representor.c @@ -7,6 +7,7 @@ #include #include +#include "rte_ethdev_driver.h" #include "base/i40e_type.h" #include "base/virtchnl.h" #include "i40e_ethdev.h" diff --git a/drivers/net/ixgbe/ixgbe_vf_representor.c b/drivers/net/ixgbe/ixgbe_vf_representor.c index dbbef294ae..edb5d43846 100644 --- a/drivers/net/ixgbe/ixgbe_vf_representor.c +++ b/drivers/net/ixgbe/ixgbe_vf_representor.c @@ -6,6 +6,7 @@ #include #include +#include "rte_ethdev_driver.h" #include "base/ixgbe_type.h" #include "base/ixgbe_vf.h" #include "ixgbe_ethdev.h" diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h index 8ed827475f..bedd69acbd 100644 --- a/lib/librte_ethdev/rte_ethdev_core.h +++ b/lib/librte_ethdev/rte_ethdev_core.h @@ -21,322 +21,8 @@ struct rte_eth_dev_callback; /** @internal Structure to keep track of registered callbacks */ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback); -/* - * Definitions of all functions exported by an Ethernet driver through the - * the generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev* - * structure associated with an Ethernet device. - */ struct rte_eth_dev; -typedef int (*eth_dev_configure_t)(struct rte_eth_dev *dev); -/**< @internal Ethernet device configuration. */ - -typedef int (*eth_dev_start_t)(struct rte_eth_dev *dev); -/**< @internal Function used to start a configured Ethernet device. */ - -typedef void (*eth_dev_stop_t)(struct rte_eth_dev *dev); -/**< @internal Function used to stop a configured Ethernet device. */ - -typedef int (*eth_dev_set_link_up_t)(struct rte_eth_dev *dev); -/**< @internal Function used to link up a configured Ethernet device. */ - -typedef int (*eth_dev_set_link_down_t)(struct rte_eth_dev *dev); -/**< @internal Function used to link down a configured Ethernet device. */ - -typedef void (*eth_dev_close_t)(struct rte_eth_dev *dev); -/**< @internal Function used to close a configured Ethernet device. */ - -typedef int (*eth_dev_reset_t)(struct rte_eth_dev *dev); -/** <@internal Function used to reset a configured Ethernet device. */ - -typedef int (*eth_is_removed_t)(struct rte_eth_dev *dev); -/**< @internal Function used to detect an Ethernet device removal. */ - -/** - * @internal - * Function used to enable the Rx promiscuous mode of an Ethernet device. - * - * @param dev - * ethdev handle of port. - * - * @return - * Negative errno value on error, 0 on success. - * - * @retval 0 - * Success, promiscuous mode is enabled. - * @retval -ENOTSUP - * Promiscuous mode is not supported. - * @retval -ENODEV - * Device is gone. - * @retval -E_RTE_SECONDARY - * Function was called from a secondary process instance and not supported. - * @retval -ETIMEDOUT - * Attempt to enable promiscuos mode failed because of timeout. - * @retval -EAGAIN - * Failed to enable promiscuous mode. - */ -typedef int (*eth_promiscuous_enable_t)(struct rte_eth_dev *dev); - -/** - * @internal - * Function used to disable the Rx promiscuous mode of an Ethernet device. - * - * @param dev - * ethdev handle of port. - * - * @return - * Negative errno value on error, 0 on success. - * - * @retval 0 - * Success, promiscuous mode is disabled. - * @retval -ENOTSUP - * Promiscuous mode disabling is not supported. - * @retval -ENODEV - * Device is gone. - * @retval -E_RTE_SECONDARY - * Function was called from a secondary process instance and not supported. - * @retval -ETIMEDOUT - * Attempt to disable promiscuos mode failed because of timeout. - * @retval -EAGAIN - * Failed to disable promiscuous mode. - */ -typedef int (*eth_promiscuous_disable_t)(struct rte_eth_dev *dev); - -/** - * @internal - * Enable the receipt of all multicast packets by an Ethernet device. - * - * @param dev - * ethdev handle of port. - * - * @return - * Negative errno value on error, 0 on success. - * - * @retval 0 - * Success, all-multicast mode is enabled. - * @retval -ENOTSUP - * All-multicast mode is not supported. - * @retval -ENODEV - * Device is gone. - * @retval -E_RTE_SECONDARY - * Function was called from a secondary process instance and not supported. - * @retval -ETIMEDOUT - * Attempt to enable all-multicast mode failed because of timeout. - * @retval -EAGAIN - * Failed to enable all-multicast mode. - */ -typedef int (*eth_allmulticast_enable_t)(struct rte_eth_dev *dev); - -/** - * @internal - * Disable the receipt of all multicast packets by an Ethernet device. - * - * @param dev - * ethdev handle of port. - * - * @return - * Negative errno value on error, 0 on success. - * - * @retval 0 - * Success, all-multicast mode is disabled. - * @retval -ENOTSUP - * All-multicast mode disabling is not supported. - * @retval -ENODEV - * Device is gone. - * @retval -E_RTE_SECONDARY - * Function was called from a secondary process instance and not supported. - * @retval -ETIMEDOUT - * Attempt to disable all-multicast mode failed because of timeout. - * @retval -EAGAIN - * Failed to disable all-multicast mode. - */ -typedef int (*eth_allmulticast_disable_t)(struct rte_eth_dev *dev); - -typedef int (*eth_link_update_t)(struct rte_eth_dev *dev, - int wait_to_complete); -/**< @internal Get link speed, duplex mode and state (up/down) of an Ethernet device. */ - -typedef int (*eth_stats_get_t)(struct rte_eth_dev *dev, - struct rte_eth_stats *igb_stats); -/**< @internal Get global I/O statistics of an Ethernet device. */ - -/** - * @internal - * Reset global I/O statistics of an Ethernet device to 0. - * - * @param dev - * ethdev handle of port. - * - * @return - * Negative errno value on error, 0 on success. - * - * @retval 0 - * Success, statistics has been reset. - * @retval -ENOTSUP - * Resetting statistics is not supported. - * @retval -EINVAL - * Resetting statistics is not valid. - * @retval -ENOMEM - * Not enough memory to get the stats. - */ -typedef int (*eth_stats_reset_t)(struct rte_eth_dev *dev); - -typedef int (*eth_xstats_get_t)(struct rte_eth_dev *dev, - struct rte_eth_xstat *stats, unsigned n); -/**< @internal Get extended stats of an Ethernet device. */ - -typedef int (*eth_xstats_get_by_id_t)(struct rte_eth_dev *dev, - const uint64_t *ids, - uint64_t *values, - unsigned int n); -/**< @internal Get extended stats of an Ethernet device. */ - -/** - * @internal - * Reset extended stats of an Ethernet device. - * - * @param dev - * ethdev handle of port. - * - * @return - * Negative errno value on error, 0 on success. - * - * @retval 0 - * Success, statistics has been reset. - * @retval -ENOTSUP - * Resetting statistics is not supported. - * @retval -EINVAL - * Resetting statistics is not valid. - * @retval -ENOMEM - * Not enough memory to get the stats. - */ -typedef int (*eth_xstats_reset_t)(struct rte_eth_dev *dev); - -typedef int (*eth_xstats_get_names_t)(struct rte_eth_dev *dev, - struct rte_eth_xstat_name *xstats_names, unsigned size); -/**< @internal Get names of extended stats of an Ethernet device. */ - -typedef int (*eth_xstats_get_names_by_id_t)(struct rte_eth_dev *dev, - struct rte_eth_xstat_name *xstats_names, const uint64_t *ids, - unsigned int size); -/**< @internal Get names of extended stats of an Ethernet device. */ - -typedef int (*eth_queue_stats_mapping_set_t)(struct rte_eth_dev *dev, - uint16_t queue_id, - uint8_t stat_idx, - uint8_t is_rx); -/**< @internal Set a queue statistics mapping for a tx/rx queue of an Ethernet device. */ - -typedef int (*eth_dev_infos_get_t)(struct rte_eth_dev *dev, - struct rte_eth_dev_info *dev_info); -/**< @internal Get specific information of an Ethernet device. */ - -typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev); -/**< @internal Get supported ptypes of an Ethernet device. */ - -/** - * @internal - * Inform Ethernet device about reduced range of packet types to handle. - * - * @param dev - * The Ethernet device identifier. - * @param ptype_mask - * The ptype family that application is interested in should be bitwise OR of - * RTE_PTYPE_*_MASK or 0. - * @return - * - (0) if Success. - */ -typedef int (*eth_dev_ptypes_set_t)(struct rte_eth_dev *dev, - uint32_t ptype_mask); - -typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev, - uint16_t queue_id); -/**< @internal Start rx and tx of a queue of an Ethernet device. */ - -typedef int (*eth_queue_stop_t)(struct rte_eth_dev *dev, - uint16_t queue_id); -/**< @internal Stop rx and tx of a queue of an Ethernet device. */ - -typedef int (*eth_rx_queue_setup_t)(struct rte_eth_dev *dev, - uint16_t rx_queue_id, - uint16_t nb_rx_desc, - unsigned int socket_id, - const struct rte_eth_rxconf *rx_conf, - struct rte_mempool *mb_pool); -/**< @internal Set up a receive queue of an Ethernet device. */ - -typedef int (*eth_tx_queue_setup_t)(struct rte_eth_dev *dev, - uint16_t tx_queue_id, - uint16_t nb_tx_desc, - unsigned int socket_id, - const struct rte_eth_txconf *tx_conf); -/**< @internal Setup a transmit queue of an Ethernet device. */ - -typedef int (*eth_rx_enable_intr_t)(struct rte_eth_dev *dev, - uint16_t rx_queue_id); -/**< @internal Enable interrupt of a receive queue of an Ethernet device. */ - -typedef int (*eth_rx_disable_intr_t)(struct rte_eth_dev *dev, - uint16_t rx_queue_id); -/**< @internal Disable interrupt of a receive queue of an Ethernet device. */ - -typedef void (*eth_queue_release_t)(void *queue); -/**< @internal Release memory resources allocated by given RX/TX queue. */ - -typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev, - uint16_t rx_queue_id); -/**< @internal Get number of used descriptors on a receive queue. */ - -typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset); -/**< @internal Check DD bit of specific RX descriptor */ - -typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t offset); -/**< @internal Check the status of a Rx descriptor */ - -typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset); -/**< @internal Check the status of a Tx descriptor */ - -typedef int (*eth_fw_version_get_t)(struct rte_eth_dev *dev, - char *fw_version, size_t fw_size); -/**< @internal Get firmware information of an Ethernet device. */ - -typedef int (*eth_tx_done_cleanup_t)(void *txq, uint32_t free_cnt); -/**< @internal Force mbufs to be from TX ring. */ - -typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev, - uint16_t rx_queue_id, struct rte_eth_rxq_info *qinfo); - -typedef void (*eth_txq_info_get_t)(struct rte_eth_dev *dev, - uint16_t tx_queue_id, struct rte_eth_txq_info *qinfo); - -typedef int (*eth_burst_mode_get_t)(struct rte_eth_dev *dev, - uint16_t queue_id, struct rte_eth_burst_mode *mode); - -typedef int (*mtu_set_t)(struct rte_eth_dev *dev, uint16_t mtu); -/**< @internal Set MTU. */ - -typedef int (*vlan_filter_set_t)(struct rte_eth_dev *dev, - uint16_t vlan_id, - int on); -/**< @internal filtering of a VLAN Tag Identifier by an Ethernet device. */ - -typedef int (*vlan_tpid_set_t)(struct rte_eth_dev *dev, - enum rte_vlan_type type, uint16_t tpid); -/**< @internal set the outer/inner VLAN-TPID by an Ethernet device. */ - -typedef int (*vlan_offload_set_t)(struct rte_eth_dev *dev, int mask); -/**< @internal set VLAN offload function by an Ethernet device. */ - -typedef int (*vlan_pvid_set_t)(struct rte_eth_dev *dev, - uint16_t vlan_id, - int on); -/**< @internal set port based TX VLAN insertion by an Ethernet device. */ - -typedef void (*vlan_strip_queue_set_t)(struct rte_eth_dev *dev, - uint16_t rx_queue_id, - int on); -/**< @internal VLAN stripping enable/disable by an queue of Ethernet device. */ - typedef uint16_t (*eth_rx_burst_t)(void *rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts); @@ -352,400 +38,20 @@ typedef uint16_t (*eth_tx_prep_t)(void *txq, uint16_t nb_pkts); /**< @internal Prepare output packets on a transmit queue of an Ethernet device. */ -typedef int (*flow_ctrl_get_t)(struct rte_eth_dev *dev, - struct rte_eth_fc_conf *fc_conf); -/**< @internal Get current flow control parameter on an Ethernet device */ - -typedef int (*flow_ctrl_set_t)(struct rte_eth_dev *dev, - struct rte_eth_fc_conf *fc_conf); -/**< @internal Setup flow control parameter on an Ethernet device */ - -typedef int (*priority_flow_ctrl_set_t)(struct rte_eth_dev *dev, - struct rte_eth_pfc_conf *pfc_conf); -/**< @internal Setup priority flow control parameter on an Ethernet device */ - -typedef int (*reta_update_t)(struct rte_eth_dev *dev, - struct rte_eth_rss_reta_entry64 *reta_conf, - uint16_t reta_size); -/**< @internal Update RSS redirection table on an Ethernet device */ - -typedef int (*reta_query_t)(struct rte_eth_dev *dev, - struct rte_eth_rss_reta_entry64 *reta_conf, - uint16_t reta_size); -/**< @internal Query RSS redirection table on an Ethernet device */ - -typedef int (*rss_hash_update_t)(struct rte_eth_dev *dev, - struct rte_eth_rss_conf *rss_conf); -/**< @internal Update RSS hash configuration of an Ethernet device */ - -typedef int (*rss_hash_conf_get_t)(struct rte_eth_dev *dev, - struct rte_eth_rss_conf *rss_conf); -/**< @internal Get current RSS hash configuration of an Ethernet device */ - -typedef int (*eth_dev_led_on_t)(struct rte_eth_dev *dev); -/**< @internal Turn on SW controllable LED on an Ethernet device */ - -typedef int (*eth_dev_led_off_t)(struct rte_eth_dev *dev); -/**< @internal Turn off SW controllable LED on an Ethernet device */ - -typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index); -/**< @internal Remove MAC address from receive address register */ - -typedef int (*eth_mac_addr_add_t)(struct rte_eth_dev *dev, - struct rte_ether_addr *mac_addr, - uint32_t index, - uint32_t vmdq); -/**< @internal Set a MAC address into Receive Address Address Register */ - -typedef int (*eth_mac_addr_set_t)(struct rte_eth_dev *dev, - struct rte_ether_addr *mac_addr); -/**< @internal Set a MAC address into Receive Address Address Register */ - -typedef int (*eth_uc_hash_table_set_t)(struct rte_eth_dev *dev, - struct rte_ether_addr *mac_addr, - uint8_t on); -/**< @internal Set a Unicast Hash bitmap */ - -typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev, - uint8_t on); -/**< @internal Set all Unicast Hash bitmap */ - -typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev, - uint16_t queue_idx, - uint16_t tx_rate); -/**< @internal Set queue TX rate */ - -typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev, - struct rte_eth_mirror_conf *mirror_conf, - uint8_t rule_id, - uint8_t on); -/**< @internal Add a traffic mirroring rule on an Ethernet device */ - -typedef int (*eth_mirror_rule_reset_t)(struct rte_eth_dev *dev, - uint8_t rule_id); -/**< @internal Remove a traffic mirroring rule on an Ethernet device */ - -typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev, - struct rte_eth_udp_tunnel *tunnel_udp); -/**< @internal Add tunneling UDP port */ - -typedef int (*eth_udp_tunnel_port_del_t)(struct rte_eth_dev *dev, - struct rte_eth_udp_tunnel *tunnel_udp); -/**< @internal Delete tunneling UDP port */ - -typedef int (*eth_set_mc_addr_list_t)(struct rte_eth_dev *dev, - struct rte_ether_addr *mc_addr_set, - uint32_t nb_mc_addr); -/**< @internal set the list of multicast addresses on an Ethernet device */ - -typedef int (*eth_timesync_enable_t)(struct rte_eth_dev *dev); -/**< @internal Function used to enable IEEE1588/802.1AS timestamping. */ - -typedef int (*eth_timesync_disable_t)(struct rte_eth_dev *dev); -/**< @internal Function used to disable IEEE1588/802.1AS timestamping. */ - -typedef int (*eth_timesync_read_rx_timestamp_t)(struct rte_eth_dev *dev, - struct timespec *timestamp, - uint32_t flags); -/**< @internal Function used to read an RX IEEE1588/802.1AS timestamp. */ - -typedef int (*eth_timesync_read_tx_timestamp_t)(struct rte_eth_dev *dev, - struct timespec *timestamp); -/**< @internal Function used to read a TX IEEE1588/802.1AS timestamp. */ -typedef int (*eth_timesync_adjust_time)(struct rte_eth_dev *dev, int64_t); -/**< @internal Function used to adjust the device clock */ - -typedef int (*eth_timesync_read_time)(struct rte_eth_dev *dev, - struct timespec *timestamp); -/**< @internal Function used to get time from the device clock. */ - -typedef int (*eth_timesync_write_time)(struct rte_eth_dev *dev, - const struct timespec *timestamp); -/**< @internal Function used to get time from the device clock */ - -typedef int (*eth_read_clock)(struct rte_eth_dev *dev, - uint64_t *timestamp); -/**< @internal Function used to get the current value of the device clock. */ - -typedef int (*eth_get_reg_t)(struct rte_eth_dev *dev, - struct rte_dev_reg_info *info); -/**< @internal Retrieve registers */ - -typedef int (*eth_get_eeprom_length_t)(struct rte_eth_dev *dev); -/**< @internal Retrieve eeprom size */ - -typedef int (*eth_get_eeprom_t)(struct rte_eth_dev *dev, - struct rte_dev_eeprom_info *info); -/**< @internal Retrieve eeprom data */ - -typedef int (*eth_set_eeprom_t)(struct rte_eth_dev *dev, - struct rte_dev_eeprom_info *info); -/**< @internal Program eeprom data */ - -typedef int (*eth_get_module_info_t)(struct rte_eth_dev *dev, - struct rte_eth_dev_module_info *modinfo); -/**< @internal Retrieve type and size of plugin module eeprom */ - -typedef int (*eth_get_module_eeprom_t)(struct rte_eth_dev *dev, - struct rte_dev_eeprom_info *info); -/**< @internal Retrieve plugin module eeprom data */ - -typedef int (*eth_l2_tunnel_eth_type_conf_t) - (struct rte_eth_dev *dev, struct rte_eth_l2_tunnel_conf *l2_tunnel); -/**< @internal config l2 tunnel ether type */ - -typedef int (*eth_l2_tunnel_offload_set_t) - (struct rte_eth_dev *dev, - struct rte_eth_l2_tunnel_conf *l2_tunnel, - uint32_t mask, - uint8_t en); -/**< @internal enable/disable the l2 tunnel offload functions */ - - -typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev, - enum rte_filter_type filter_type, - enum rte_filter_op filter_op, - void *arg); -/**< @internal Take operations to assigned filter type on an Ethernet device */ - -typedef int (*eth_tm_ops_get_t)(struct rte_eth_dev *dev, void *ops); -/**< @internal Get Traffic Management (TM) operations on an Ethernet device */ - -typedef int (*eth_mtr_ops_get_t)(struct rte_eth_dev *dev, void *ops); -/**< @internal Get Traffic Metering and Policing (MTR) operations */ - -typedef int (*eth_get_dcb_info)(struct rte_eth_dev *dev, - struct rte_eth_dcb_info *dcb_info); -/**< @internal Get dcb information on an Ethernet device */ - -typedef int (*eth_pool_ops_supported_t)(struct rte_eth_dev *dev, - const char *pool); -/**< @internal Test if a port supports specific mempool ops */ - -/** - * @internal - * Get the hairpin capabilities. - * - * @param dev - * ethdev handle of port. - * @param cap - * returns the hairpin capabilities from the device. - * - * @return - * Negative errno value on error, 0 on success. - * - * @retval 0 - * Success, hairpin is supported. - * @retval -ENOTSUP - * Hairpin is not supported. - */ -typedef int (*eth_hairpin_cap_get_t)(struct rte_eth_dev *dev, - struct rte_eth_hairpin_cap *cap); - -/** - * @internal - * Setup RX hairpin queue. - * - * @param dev - * ethdev handle of port. - * @param rx_queue_id - * the selected RX queue index. - * @param nb_rx_desc - * the requested number of descriptors for this queue. 0 - use PMD default. - * @param conf - * the RX hairpin configuration structure. - * - * @return - * Negative errno value on error, 0 on success. - * - * @retval 0 - * Success, hairpin is supported. - * @retval -ENOTSUP - * Hairpin is not supported. - * @retval -EINVAL - * One of the parameters is invalid. - * @retval -ENOMEM - * Unable to allocate resources. - */ -typedef int (*eth_rx_hairpin_queue_setup_t) - (struct rte_eth_dev *dev, uint16_t rx_queue_id, - uint16_t nb_rx_desc, - const struct rte_eth_hairpin_conf *conf); - -/** - * @internal - * Setup TX hairpin queue. - * - * @param dev - * ethdev handle of port. - * @param tx_queue_id - * the selected TX queue index. - * @param nb_tx_desc - * the requested number of descriptors for this queue. 0 - use PMD default. - * @param conf - * the TX hairpin configuration structure. - * - * @return - * Negative errno value on error, 0 on success. - * - * @retval 0 - * Success, hairpin is supported. - * @retval -ENOTSUP - * Hairpin is not supported. - * @retval -EINVAL - * One of the parameters is invalid. - * @retval -ENOMEM - * Unable to allocate resources. - */ -typedef int (*eth_tx_hairpin_queue_setup_t) - (struct rte_eth_dev *dev, uint16_t tx_queue_id, - uint16_t nb_tx_desc, - const struct rte_eth_hairpin_conf *hairpin_conf); - -/** - * @internal A structure containing the functions exported by an Ethernet driver. - */ -struct eth_dev_ops { - eth_dev_configure_t dev_configure; /**< Configure device. */ - eth_dev_start_t dev_start; /**< Start device. */ - eth_dev_stop_t dev_stop; /**< Stop device. */ - eth_dev_set_link_up_t dev_set_link_up; /**< Device link up. */ - eth_dev_set_link_down_t dev_set_link_down; /**< Device link down. */ - eth_dev_close_t dev_close; /**< Close device. */ - eth_dev_reset_t dev_reset; /**< Reset device. */ - eth_link_update_t link_update; /**< Get device link state. */ - eth_is_removed_t is_removed; - /**< Check if the device was physically removed. */ - - eth_promiscuous_enable_t promiscuous_enable; /**< Promiscuous ON. */ - eth_promiscuous_disable_t promiscuous_disable;/**< Promiscuous OFF. */ - eth_allmulticast_enable_t allmulticast_enable;/**< RX multicast ON. */ - eth_allmulticast_disable_t allmulticast_disable;/**< RX multicast OFF. */ - eth_mac_addr_remove_t mac_addr_remove; /**< Remove MAC address. */ - eth_mac_addr_add_t mac_addr_add; /**< Add a MAC address. */ - eth_mac_addr_set_t mac_addr_set; /**< Set a MAC address. */ - eth_set_mc_addr_list_t set_mc_addr_list; /**< set list of mcast addrs. */ - mtu_set_t mtu_set; /**< Set MTU. */ - - eth_stats_get_t stats_get; /**< Get generic device statistics. */ - eth_stats_reset_t stats_reset; /**< Reset generic device statistics. */ - eth_xstats_get_t xstats_get; /**< Get extended device statistics. */ - eth_xstats_reset_t xstats_reset; /**< Reset extended device statistics. */ - eth_xstats_get_names_t xstats_get_names; - /**< Get names of extended statistics. */ - eth_queue_stats_mapping_set_t queue_stats_mapping_set; - /**< Configure per queue stat counter mapping. */ - - eth_dev_infos_get_t dev_infos_get; /**< Get device info. */ - eth_rxq_info_get_t rxq_info_get; /**< retrieve RX queue information. */ - eth_txq_info_get_t txq_info_get; /**< retrieve TX queue information. */ - eth_burst_mode_get_t rx_burst_mode_get; /**< Get RX burst mode */ - eth_burst_mode_get_t tx_burst_mode_get; /**< Get TX burst mode */ - eth_fw_version_get_t fw_version_get; /**< Get firmware version. */ - eth_dev_supported_ptypes_get_t dev_supported_ptypes_get; - /**< Get packet types supported and identified by device. */ - eth_dev_ptypes_set_t dev_ptypes_set; - /**< Inform Ethernet device about reduced range of packet types to handle. */ - - vlan_filter_set_t vlan_filter_set; /**< Filter VLAN Setup. */ - vlan_tpid_set_t vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */ - vlan_strip_queue_set_t vlan_strip_queue_set; /**< VLAN Stripping on queue. */ - vlan_offload_set_t vlan_offload_set; /**< Set VLAN Offload. */ - vlan_pvid_set_t vlan_pvid_set; /**< Set port based TX VLAN insertion. */ - - eth_queue_start_t rx_queue_start;/**< Start RX for a queue. */ - eth_queue_stop_t rx_queue_stop; /**< Stop RX for a queue. */ - eth_queue_start_t tx_queue_start;/**< Start TX for a queue. */ - eth_queue_stop_t tx_queue_stop; /**< Stop TX for a queue. */ - eth_rx_queue_setup_t rx_queue_setup;/**< Set up device RX queue. */ - eth_queue_release_t rx_queue_release; /**< Release RX queue. */ - /* - * Static inline functions use functions ABOVE this comment. - * New dev_ops functions should be added BELOW to avoid breaking ABI. - */ - eth_rx_enable_intr_t rx_queue_intr_enable; /**< Enable Rx queue interrupt. */ - eth_rx_disable_intr_t rx_queue_intr_disable; /**< Disable Rx queue interrupt. */ - eth_tx_queue_setup_t tx_queue_setup;/**< Set up device TX queue. */ - eth_queue_release_t tx_queue_release; /**< Release TX queue. */ - eth_tx_done_cleanup_t tx_done_cleanup;/**< Free tx ring mbufs */ - - eth_dev_led_on_t dev_led_on; /**< Turn on LED. */ - eth_dev_led_off_t dev_led_off; /**< Turn off LED. */ - - flow_ctrl_get_t flow_ctrl_get; /**< Get flow control. */ - flow_ctrl_set_t flow_ctrl_set; /**< Setup flow control. */ - priority_flow_ctrl_set_t priority_flow_ctrl_set; /**< Setup priority flow control. */ - - eth_uc_hash_table_set_t uc_hash_table_set; /**< Set Unicast Table Array. */ - eth_uc_all_hash_table_set_t uc_all_hash_table_set; /**< Set Unicast hash bitmap. */ - - eth_mirror_rule_set_t mirror_rule_set; /**< Add a traffic mirror rule. */ - eth_mirror_rule_reset_t mirror_rule_reset; /**< reset a traffic mirror rule. */ - - eth_udp_tunnel_port_add_t udp_tunnel_port_add; /** Add UDP tunnel port. */ - eth_udp_tunnel_port_del_t udp_tunnel_port_del; /** Del UDP tunnel port. */ - eth_l2_tunnel_eth_type_conf_t l2_tunnel_eth_type_conf; - /** Config ether type of l2 tunnel. */ - eth_l2_tunnel_offload_set_t l2_tunnel_offload_set; - /** Enable/disable l2 tunnel offload functions. */ - - eth_set_queue_rate_limit_t set_queue_rate_limit; /**< Set queue rate limit. */ - - rss_hash_update_t rss_hash_update; /** Configure RSS hash protocols. */ - rss_hash_conf_get_t rss_hash_conf_get; /** Get current RSS hash configuration. */ - reta_update_t reta_update; /** Update redirection table. */ - reta_query_t reta_query; /** Query redirection table. */ - - eth_get_reg_t get_reg; /**< Get registers. */ - eth_get_eeprom_length_t get_eeprom_length; /**< Get eeprom length. */ - eth_get_eeprom_t get_eeprom; /**< Get eeprom data. */ - eth_set_eeprom_t set_eeprom; /**< Set eeprom. */ - - eth_get_module_info_t get_module_info; - /** Get plugin module eeprom attribute. */ - eth_get_module_eeprom_t get_module_eeprom; - /** Get plugin module eeprom data. */ - - eth_filter_ctrl_t filter_ctrl; /**< common filter control. */ - - eth_get_dcb_info get_dcb_info; /** Get DCB information. */ - - eth_timesync_enable_t timesync_enable; - /** Turn IEEE1588/802.1AS timestamping on. */ - eth_timesync_disable_t timesync_disable; - /** Turn IEEE1588/802.1AS timestamping off. */ - eth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp; - /** Read the IEEE1588/802.1AS RX timestamp. */ - eth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp; - /** Read the IEEE1588/802.1AS TX timestamp. */ - eth_timesync_adjust_time timesync_adjust_time; /** Adjust the device clock. */ - eth_timesync_read_time timesync_read_time; /** Get the device clock time. */ - eth_timesync_write_time timesync_write_time; /** Set the device clock time. */ - - eth_read_clock read_clock; - - eth_xstats_get_by_id_t xstats_get_by_id; - /**< Get extended device statistic values by ID. */ - eth_xstats_get_names_by_id_t xstats_get_names_by_id; - /**< Get name of extended device statistics by ID. */ +typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev, + uint16_t rx_queue_id); +/**< @internal Get number of used descriptors on a receive queue. */ - eth_tm_ops_get_t tm_ops_get; - /**< Get Traffic Management (TM) operations. */ +typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset); +/**< @internal Check DD bit of specific RX descriptor */ - eth_mtr_ops_get_t mtr_ops_get; - /**< Get Traffic Metering and Policing (MTR) operations. */ +typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t offset); +/**< @internal Check the status of a Rx descriptor */ - eth_pool_ops_supported_t pool_ops_supported; - /**< Test if a port supports specific mempool ops */ +typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset); +/**< @internal Check the status of a Tx descriptor */ - eth_hairpin_cap_get_t hairpin_cap_get; - /**< Returns the hairpin capabilities. */ - eth_rx_hairpin_queue_setup_t rx_hairpin_queue_setup; - /**< Set up device RX hairpin queue. */ - eth_tx_hairpin_queue_setup_t tx_hairpin_queue_setup; - /**< Set up device TX hairpin queue. */ -}; /** * @internal diff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h index 13fd049c0d..b006cbbe92 100644 --- a/lib/librte_ethdev/rte_ethdev_driver.h +++ b/lib/librte_ethdev/rte_ethdev_driver.h @@ -21,6 +21,700 @@ extern "C" { #endif +/* + * Definitions of all functions exported by an Ethernet driver through the + * generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev* + * structure associated with an Ethernet device. + */ + +typedef int (*eth_dev_configure_t)(struct rte_eth_dev *dev); +/**< @internal Ethernet device configuration. */ + +typedef int (*eth_dev_start_t)(struct rte_eth_dev *dev); +/**< @internal Function used to start a configured Ethernet device. */ + +typedef void (*eth_dev_stop_t)(struct rte_eth_dev *dev); +/**< @internal Function used to stop a configured Ethernet device. */ + +typedef int (*eth_dev_set_link_up_t)(struct rte_eth_dev *dev); +/**< @internal Function used to link up a configured Ethernet device. */ + +typedef int (*eth_dev_set_link_down_t)(struct rte_eth_dev *dev); +/**< @internal Function used to link down a configured Ethernet device. */ + +typedef void (*eth_dev_close_t)(struct rte_eth_dev *dev); +/**< @internal Function used to close a configured Ethernet device. */ + +typedef int (*eth_dev_reset_t)(struct rte_eth_dev *dev); +/** <@internal Function used to reset a configured Ethernet device. */ + +typedef int (*eth_is_removed_t)(struct rte_eth_dev *dev); +/**< @internal Function used to detect an Ethernet device removal. */ + +/** + * @internal + * Function used to enable the Rx promiscuous mode of an Ethernet device. + * + * @param dev + * ethdev handle of port. + * + * @return + * Negative errno value on error, 0 on success. + * + * @retval 0 + * Success, promiscuous mode is enabled. + * @retval -ENOTSUP + * Promiscuous mode is not supported. + * @retval -ENODEV + * Device is gone. + * @retval -E_RTE_SECONDARY + * Function was called from a secondary process instance and not supported. + * @retval -ETIMEDOUT + * Attempt to enable promiscuos mode failed because of timeout. + * @retval -EAGAIN + * Failed to enable promiscuous mode. + */ +typedef int (*eth_promiscuous_enable_t)(struct rte_eth_dev *dev); + +/** + * @internal + * Function used to disable the Rx promiscuous mode of an Ethernet device. + * + * @param dev + * ethdev handle of port. + * + * @return + * Negative errno value on error, 0 on success. + * + * @retval 0 + * Success, promiscuous mode is disabled. + * @retval -ENOTSUP + * Promiscuous mode disabling is not supported. + * @retval -ENODEV + * Device is gone. + * @retval -E_RTE_SECONDARY + * Function was called from a secondary process instance and not supported. + * @retval -ETIMEDOUT + * Attempt to disable promiscuos mode failed because of timeout. + * @retval -EAGAIN + * Failed to disable promiscuous mode. + */ +typedef int (*eth_promiscuous_disable_t)(struct rte_eth_dev *dev); + +/** + * @internal + * Enable the receipt of all multicast packets by an Ethernet device. + * + * @param dev + * ethdev handle of port. + * + * @return + * Negative errno value on error, 0 on success. + * + * @retval 0 + * Success, all-multicast mode is enabled. + * @retval -ENOTSUP + * All-multicast mode is not supported. + * @retval -ENODEV + * Device is gone. + * @retval -E_RTE_SECONDARY + * Function was called from a secondary process instance and not supported. + * @retval -ETIMEDOUT + * Attempt to enable all-multicast mode failed because of timeout. + * @retval -EAGAIN + * Failed to enable all-multicast mode. + */ +typedef int (*eth_allmulticast_enable_t)(struct rte_eth_dev *dev); + +/** + * @internal + * Disable the receipt of all multicast packets by an Ethernet device. + * + * @param dev + * ethdev handle of port. + * + * @return + * Negative errno value on error, 0 on success. + * + * @retval 0 + * Success, all-multicast mode is disabled. + * @retval -ENOTSUP + * All-multicast mode disabling is not supported. + * @retval -ENODEV + * Device is gone. + * @retval -E_RTE_SECONDARY + * Function was called from a secondary process instance and not supported. + * @retval -ETIMEDOUT + * Attempt to disable all-multicast mode failed because of timeout. + * @retval -EAGAIN + * Failed to disable all-multicast mode. + */ +typedef int (*eth_allmulticast_disable_t)(struct rte_eth_dev *dev); + +typedef int (*eth_link_update_t)(struct rte_eth_dev *dev, + int wait_to_complete); +/**< @internal Get link speed, duplex mode and state (up/down) of an Ethernet device. */ + +typedef int (*eth_stats_get_t)(struct rte_eth_dev *dev, + struct rte_eth_stats *igb_stats); +/**< @internal Get global I/O statistics of an Ethernet device. */ + +/** + * @internal + * Reset global I/O statistics of an Ethernet device to 0. + * + * @param dev + * ethdev handle of port. + * + * @return + * Negative errno value on error, 0 on success. + * + * @retval 0 + * Success, statistics has been reset. + * @retval -ENOTSUP + * Resetting statistics is not supported. + * @retval -EINVAL + * Resetting statistics is not valid. + * @retval -ENOMEM + * Not enough memory to get the stats. + */ +typedef int (*eth_stats_reset_t)(struct rte_eth_dev *dev); + +typedef int (*eth_xstats_get_t)(struct rte_eth_dev *dev, + struct rte_eth_xstat *stats, unsigned int n); +/**< @internal Get extended stats of an Ethernet device. */ + +typedef int (*eth_xstats_get_by_id_t)(struct rte_eth_dev *dev, + const uint64_t *ids, + uint64_t *values, + unsigned int n); +/**< @internal Get extended stats of an Ethernet device. */ + +/** + * @internal + * Reset extended stats of an Ethernet device. + * + * @param dev + * ethdev handle of port. + * + * @return + * Negative errno value on error, 0 on success. + * + * @retval 0 + * Success, statistics has been reset. + * @retval -ENOTSUP + * Resetting statistics is not supported. + * @retval -EINVAL + * Resetting statistics is not valid. + * @retval -ENOMEM + * Not enough memory to get the stats. + */ +typedef int (*eth_xstats_reset_t)(struct rte_eth_dev *dev); + +typedef int (*eth_xstats_get_names_t)(struct rte_eth_dev *dev, + struct rte_eth_xstat_name *xstats_names, unsigned int size); +/**< @internal Get names of extended stats of an Ethernet device. */ + +typedef int (*eth_xstats_get_names_by_id_t)(struct rte_eth_dev *dev, + struct rte_eth_xstat_name *xstats_names, const uint64_t *ids, + unsigned int size); +/**< @internal Get names of extended stats of an Ethernet device. */ + +typedef int (*eth_queue_stats_mapping_set_t)(struct rte_eth_dev *dev, + uint16_t queue_id, + uint8_t stat_idx, + uint8_t is_rx); +/**< @internal Set a queue statistics mapping for a tx/rx queue of an Ethernet device. */ + +typedef int (*eth_dev_infos_get_t)(struct rte_eth_dev *dev, + struct rte_eth_dev_info *dev_info); +/**< @internal Get specific information of an Ethernet device. */ + +typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev); +/**< @internal Get supported ptypes of an Ethernet device. */ + +/** + * @internal + * Inform Ethernet device about reduced range of packet types to handle. + * + * @param dev + * The Ethernet device identifier. + * @param ptype_mask + * The ptype family that application is interested in should be bitwise OR of + * RTE_PTYPE_*_MASK or 0. + * @return + * - (0) if Success. + */ +typedef int (*eth_dev_ptypes_set_t)(struct rte_eth_dev *dev, + uint32_t ptype_mask); + +typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev, + uint16_t queue_id); +/**< @internal Start rx and tx of a queue of an Ethernet device. */ + +typedef int (*eth_queue_stop_t)(struct rte_eth_dev *dev, + uint16_t queue_id); +/**< @internal Stop rx and tx of a queue of an Ethernet device. */ + +typedef int (*eth_rx_queue_setup_t)(struct rte_eth_dev *dev, + uint16_t rx_queue_id, + uint16_t nb_rx_desc, + unsigned int socket_id, + const struct rte_eth_rxconf *rx_conf, + struct rte_mempool *mb_pool); +/**< @internal Set up a receive queue of an Ethernet device. */ + +typedef int (*eth_tx_queue_setup_t)(struct rte_eth_dev *dev, + uint16_t tx_queue_id, + uint16_t nb_tx_desc, + unsigned int socket_id, + const struct rte_eth_txconf *tx_conf); +/**< @internal Setup a transmit queue of an Ethernet device. */ + +typedef int (*eth_rx_enable_intr_t)(struct rte_eth_dev *dev, + uint16_t rx_queue_id); +/**< @internal Enable interrupt of a receive queue of an Ethernet device. */ + +typedef int (*eth_rx_disable_intr_t)(struct rte_eth_dev *dev, + uint16_t rx_queue_id); +/**< @internal Disable interrupt of a receive queue of an Ethernet device. */ + +typedef void (*eth_queue_release_t)(void *queue); +/**< @internal Release memory resources allocated by given RX/TX queue. */ + +typedef int (*eth_fw_version_get_t)(struct rte_eth_dev *dev, + char *fw_version, size_t fw_size); +/**< @internal Get firmware information of an Ethernet device. */ + +typedef int (*eth_tx_done_cleanup_t)(void *txq, uint32_t free_cnt); +/**< @internal Force mbufs to be from TX ring. */ + +typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev, + uint16_t rx_queue_id, struct rte_eth_rxq_info *qinfo); + +typedef void (*eth_txq_info_get_t)(struct rte_eth_dev *dev, + uint16_t tx_queue_id, struct rte_eth_txq_info *qinfo); + +typedef int (*eth_burst_mode_get_t)(struct rte_eth_dev *dev, + uint16_t queue_id, struct rte_eth_burst_mode *mode); + +typedef int (*mtu_set_t)(struct rte_eth_dev *dev, uint16_t mtu); +/**< @internal Set MTU. */ + +typedef int (*vlan_filter_set_t)(struct rte_eth_dev *dev, + uint16_t vlan_id, + int on); +/**< @internal filtering of a VLAN Tag Identifier by an Ethernet device. */ + +typedef int (*vlan_tpid_set_t)(struct rte_eth_dev *dev, + enum rte_vlan_type type, uint16_t tpid); +/**< @internal set the outer/inner VLAN-TPID by an Ethernet device. */ + +typedef int (*vlan_offload_set_t)(struct rte_eth_dev *dev, int mask); +/**< @internal set VLAN offload function by an Ethernet device. */ + +typedef int (*vlan_pvid_set_t)(struct rte_eth_dev *dev, + uint16_t vlan_id, + int on); +/**< @internal set port based TX VLAN insertion by an Ethernet device. */ + +typedef void (*vlan_strip_queue_set_t)(struct rte_eth_dev *dev, + uint16_t rx_queue_id, + int on); +/**< @internal VLAN stripping enable/disable by an queue of Ethernet device. */ + +typedef int (*flow_ctrl_get_t)(struct rte_eth_dev *dev, + struct rte_eth_fc_conf *fc_conf); +/**< @internal Get current flow control parameter on an Ethernet device */ + +typedef int (*flow_ctrl_set_t)(struct rte_eth_dev *dev, + struct rte_eth_fc_conf *fc_conf); +/**< @internal Setup flow control parameter on an Ethernet device */ + +typedef int (*priority_flow_ctrl_set_t)(struct rte_eth_dev *dev, + struct rte_eth_pfc_conf *pfc_conf); +/**< @internal Setup priority flow control parameter on an Ethernet device */ + +typedef int (*reta_update_t)(struct rte_eth_dev *dev, + struct rte_eth_rss_reta_entry64 *reta_conf, + uint16_t reta_size); +/**< @internal Update RSS redirection table on an Ethernet device */ + +typedef int (*reta_query_t)(struct rte_eth_dev *dev, + struct rte_eth_rss_reta_entry64 *reta_conf, + uint16_t reta_size); +/**< @internal Query RSS redirection table on an Ethernet device */ + +typedef int (*rss_hash_update_t)(struct rte_eth_dev *dev, + struct rte_eth_rss_conf *rss_conf); +/**< @internal Update RSS hash configuration of an Ethernet device */ + +typedef int (*rss_hash_conf_get_t)(struct rte_eth_dev *dev, + struct rte_eth_rss_conf *rss_conf); +/**< @internal Get current RSS hash configuration of an Ethernet device */ + +typedef int (*eth_dev_led_on_t)(struct rte_eth_dev *dev); +/**< @internal Turn on SW controllable LED on an Ethernet device */ + +typedef int (*eth_dev_led_off_t)(struct rte_eth_dev *dev); +/**< @internal Turn off SW controllable LED on an Ethernet device */ + +typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index); +/**< @internal Remove MAC address from receive address register */ + +typedef int (*eth_mac_addr_add_t)(struct rte_eth_dev *dev, + struct rte_ether_addr *mac_addr, + uint32_t index, + uint32_t vmdq); +/**< @internal Set a MAC address into Receive Address Register */ + +typedef int (*eth_mac_addr_set_t)(struct rte_eth_dev *dev, + struct rte_ether_addr *mac_addr); +/**< @internal Set a MAC address into Receive Address Register */ + +typedef int (*eth_uc_hash_table_set_t)(struct rte_eth_dev *dev, + struct rte_ether_addr *mac_addr, + uint8_t on); +/**< @internal Set a Unicast Hash bitmap */ + +typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev, + uint8_t on); +/**< @internal Set all Unicast Hash bitmap */ + +typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev, + uint16_t queue_idx, + uint16_t tx_rate); +/**< @internal Set queue TX rate */ + +typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev, + struct rte_eth_mirror_conf *mirror_conf, + uint8_t rule_id, + uint8_t on); +/**< @internal Add a traffic mirroring rule on an Ethernet device */ + +typedef int (*eth_mirror_rule_reset_t)(struct rte_eth_dev *dev, + uint8_t rule_id); +/**< @internal Remove a traffic mirroring rule on an Ethernet device */ + +typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev, + struct rte_eth_udp_tunnel *tunnel_udp); +/**< @internal Add tunneling UDP port */ + +typedef int (*eth_udp_tunnel_port_del_t)(struct rte_eth_dev *dev, + struct rte_eth_udp_tunnel *tunnel_udp); +/**< @internal Delete tunneling UDP port */ + +typedef int (*eth_set_mc_addr_list_t)(struct rte_eth_dev *dev, + struct rte_ether_addr *mc_addr_set, + uint32_t nb_mc_addr); +/**< @internal set the list of multicast addresses on an Ethernet device */ + +typedef int (*eth_timesync_enable_t)(struct rte_eth_dev *dev); +/**< @internal Function used to enable IEEE1588/802.1AS timestamping. */ + +typedef int (*eth_timesync_disable_t)(struct rte_eth_dev *dev); +/**< @internal Function used to disable IEEE1588/802.1AS timestamping. */ + +typedef int (*eth_timesync_read_rx_timestamp_t)(struct rte_eth_dev *dev, + struct timespec *timestamp, + uint32_t flags); +/**< @internal Function used to read an RX IEEE1588/802.1AS timestamp. */ + +typedef int (*eth_timesync_read_tx_timestamp_t)(struct rte_eth_dev *dev, + struct timespec *timestamp); +/**< @internal Function used to read a TX IEEE1588/802.1AS timestamp. */ + +typedef int (*eth_timesync_adjust_time)(struct rte_eth_dev *dev, int64_t); +/**< @internal Function used to adjust the device clock */ + +typedef int (*eth_timesync_read_time)(struct rte_eth_dev *dev, + struct timespec *timestamp); +/**< @internal Function used to get time from the device clock. */ + +typedef int (*eth_timesync_write_time)(struct rte_eth_dev *dev, + const struct timespec *timestamp); +/**< @internal Function used to get time from the device clock */ + +typedef int (*eth_read_clock)(struct rte_eth_dev *dev, + uint64_t *timestamp); +/**< @internal Function used to get the current value of the device clock. */ + +typedef int (*eth_get_reg_t)(struct rte_eth_dev *dev, + struct rte_dev_reg_info *info); +/**< @internal Retrieve registers */ + +typedef int (*eth_get_eeprom_length_t)(struct rte_eth_dev *dev); +/**< @internal Retrieve eeprom size */ + +typedef int (*eth_get_eeprom_t)(struct rte_eth_dev *dev, + struct rte_dev_eeprom_info *info); +/**< @internal Retrieve eeprom data */ + +typedef int (*eth_set_eeprom_t)(struct rte_eth_dev *dev, + struct rte_dev_eeprom_info *info); +/**< @internal Program eeprom data */ + +typedef int (*eth_get_module_info_t)(struct rte_eth_dev *dev, + struct rte_eth_dev_module_info *modinfo); +/**< @internal Retrieve type and size of plugin module eeprom */ + +typedef int (*eth_get_module_eeprom_t)(struct rte_eth_dev *dev, + struct rte_dev_eeprom_info *info); +/**< @internal Retrieve plugin module eeprom data */ + +typedef int (*eth_l2_tunnel_eth_type_conf_t) + (struct rte_eth_dev *dev, struct rte_eth_l2_tunnel_conf *l2_tunnel); +/**< @internal config l2 tunnel ether type */ + +typedef int (*eth_l2_tunnel_offload_set_t) + (struct rte_eth_dev *dev, + struct rte_eth_l2_tunnel_conf *l2_tunnel, + uint32_t mask, + uint8_t en); +/**< @internal enable/disable the l2 tunnel offload functions */ + + +typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev, + enum rte_filter_type filter_type, + enum rte_filter_op filter_op, + void *arg); +/**< @internal Take operations to assigned filter type on an Ethernet device */ + +typedef int (*eth_tm_ops_get_t)(struct rte_eth_dev *dev, void *ops); +/**< @internal Get Traffic Management (TM) operations on an Ethernet device */ + +typedef int (*eth_mtr_ops_get_t)(struct rte_eth_dev *dev, void *ops); +/**< @internal Get Traffic Metering and Policing (MTR) operations */ + +typedef int (*eth_get_dcb_info)(struct rte_eth_dev *dev, + struct rte_eth_dcb_info *dcb_info); +/**< @internal Get dcb information on an Ethernet device */ + +typedef int (*eth_pool_ops_supported_t)(struct rte_eth_dev *dev, + const char *pool); +/**< @internal Test if a port supports specific mempool ops */ + +/** + * @internal + * Get the hairpin capabilities. + * + * @param dev + * ethdev handle of port. + * @param cap + * returns the hairpin capabilities from the device. + * + * @return + * Negative errno value on error, 0 on success. + * + * @retval 0 + * Success, hairpin is supported. + * @retval -ENOTSUP + * Hairpin is not supported. + */ +typedef int (*eth_hairpin_cap_get_t)(struct rte_eth_dev *dev, + struct rte_eth_hairpin_cap *cap); + +/** + * @internal + * Setup RX hairpin queue. + * + * @param dev + * ethdev handle of port. + * @param rx_queue_id + * the selected RX queue index. + * @param nb_rx_desc + * the requested number of descriptors for this queue. 0 - use PMD default. + * @param conf + * the RX hairpin configuration structure. + * + * @return + * Negative errno value on error, 0 on success. + * + * @retval 0 + * Success, hairpin is supported. + * @retval -ENOTSUP + * Hairpin is not supported. + * @retval -EINVAL + * One of the parameters is invalid. + * @retval -ENOMEM + * Unable to allocate resources. + */ +typedef int (*eth_rx_hairpin_queue_setup_t) + (struct rte_eth_dev *dev, uint16_t rx_queue_id, + uint16_t nb_rx_desc, + const struct rte_eth_hairpin_conf *conf); + +/** + * @internal + * Setup TX hairpin queue. + * + * @param dev + * ethdev handle of port. + * @param tx_queue_id + * the selected TX queue index. + * @param nb_tx_desc + * the requested number of descriptors for this queue. 0 - use PMD default. + * @param conf + * the TX hairpin configuration structure. + * + * @return + * Negative errno value on error, 0 on success. + * + * @retval 0 + * Success, hairpin is supported. + * @retval -ENOTSUP + * Hairpin is not supported. + * @retval -EINVAL + * One of the parameters is invalid. + * @retval -ENOMEM + * Unable to allocate resources. + */ +typedef int (*eth_tx_hairpin_queue_setup_t) + (struct rte_eth_dev *dev, uint16_t tx_queue_id, + uint16_t nb_tx_desc, + const struct rte_eth_hairpin_conf *hairpin_conf); + +/** + * @internal A structure containing the functions exported by an Ethernet driver. + */ +struct eth_dev_ops { + eth_dev_configure_t dev_configure; /**< Configure device. */ + eth_dev_start_t dev_start; /**< Start device. */ + eth_dev_stop_t dev_stop; /**< Stop device. */ + eth_dev_set_link_up_t dev_set_link_up; /**< Device link up. */ + eth_dev_set_link_down_t dev_set_link_down; /**< Device link down. */ + eth_dev_close_t dev_close; /**< Close device. */ + eth_dev_reset_t dev_reset; /**< Reset device. */ + eth_link_update_t link_update; /**< Get device link state. */ + eth_is_removed_t is_removed; + /**< Check if the device was physically removed. */ + + eth_promiscuous_enable_t promiscuous_enable; /**< Promiscuous ON. */ + eth_promiscuous_disable_t promiscuous_disable;/**< Promiscuous OFF. */ + eth_allmulticast_enable_t allmulticast_enable;/**< RX multicast ON. */ + eth_allmulticast_disable_t allmulticast_disable;/**< RX multicast OFF. */ + eth_mac_addr_remove_t mac_addr_remove; /**< Remove MAC address. */ + eth_mac_addr_add_t mac_addr_add; /**< Add a MAC address. */ + eth_mac_addr_set_t mac_addr_set; /**< Set a MAC address. */ + eth_set_mc_addr_list_t set_mc_addr_list; /**< set list of mcast addrs. */ + mtu_set_t mtu_set; /**< Set MTU. */ + + eth_stats_get_t stats_get; /**< Get generic device statistics. */ + eth_stats_reset_t stats_reset; /**< Reset generic device statistics. */ + eth_xstats_get_t xstats_get; /**< Get extended device statistics. */ + eth_xstats_reset_t xstats_reset; /**< Reset extended device statistics. */ + eth_xstats_get_names_t xstats_get_names; + /**< Get names of extended statistics. */ + eth_queue_stats_mapping_set_t queue_stats_mapping_set; + /**< Configure per queue stat counter mapping. */ + + eth_dev_infos_get_t dev_infos_get; /**< Get device info. */ + eth_rxq_info_get_t rxq_info_get; /**< retrieve RX queue information. */ + eth_txq_info_get_t txq_info_get; /**< retrieve TX queue information. */ + eth_burst_mode_get_t rx_burst_mode_get; /**< Get RX burst mode */ + eth_burst_mode_get_t tx_burst_mode_get; /**< Get TX burst mode */ + eth_fw_version_get_t fw_version_get; /**< Get firmware version. */ + eth_dev_supported_ptypes_get_t dev_supported_ptypes_get; + /**< Get packet types supported and identified by device. */ + eth_dev_ptypes_set_t dev_ptypes_set; + /**< Inform Ethernet device about reduced range of packet types to handle. */ + + vlan_filter_set_t vlan_filter_set; /**< Filter VLAN Setup. */ + vlan_tpid_set_t vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */ + vlan_strip_queue_set_t vlan_strip_queue_set; /**< VLAN Stripping on queue. */ + vlan_offload_set_t vlan_offload_set; /**< Set VLAN Offload. */ + vlan_pvid_set_t vlan_pvid_set; /**< Set port based TX VLAN insertion. */ + + eth_queue_start_t rx_queue_start;/**< Start RX for a queue. */ + eth_queue_stop_t rx_queue_stop; /**< Stop RX for a queue. */ + eth_queue_start_t tx_queue_start;/**< Start TX for a queue. */ + eth_queue_stop_t tx_queue_stop; /**< Stop TX for a queue. */ + eth_rx_queue_setup_t rx_queue_setup;/**< Set up device RX queue. */ + eth_queue_release_t rx_queue_release; /**< Release RX queue. */ + + eth_rx_enable_intr_t rx_queue_intr_enable; /**< Enable Rx queue interrupt. */ + eth_rx_disable_intr_t rx_queue_intr_disable; /**< Disable Rx queue interrupt. */ + eth_tx_queue_setup_t tx_queue_setup;/**< Set up device TX queue. */ + eth_queue_release_t tx_queue_release; /**< Release TX queue. */ + eth_tx_done_cleanup_t tx_done_cleanup;/**< Free tx ring mbufs */ + + eth_dev_led_on_t dev_led_on; /**< Turn on LED. */ + eth_dev_led_off_t dev_led_off; /**< Turn off LED. */ + + flow_ctrl_get_t flow_ctrl_get; /**< Get flow control. */ + flow_ctrl_set_t flow_ctrl_set; /**< Setup flow control. */ + priority_flow_ctrl_set_t priority_flow_ctrl_set; /**< Setup priority flow control. */ + + eth_uc_hash_table_set_t uc_hash_table_set; /**< Set Unicast Table Array. */ + eth_uc_all_hash_table_set_t uc_all_hash_table_set; /**< Set Unicast hash bitmap. */ + + eth_mirror_rule_set_t mirror_rule_set; /**< Add a traffic mirror rule. */ + eth_mirror_rule_reset_t mirror_rule_reset; /**< reset a traffic mirror rule. */ + + eth_udp_tunnel_port_add_t udp_tunnel_port_add; /** Add UDP tunnel port. */ + eth_udp_tunnel_port_del_t udp_tunnel_port_del; /** Del UDP tunnel port. */ + eth_l2_tunnel_eth_type_conf_t l2_tunnel_eth_type_conf; + /** Config ether type of l2 tunnel. */ + eth_l2_tunnel_offload_set_t l2_tunnel_offload_set; + /** Enable/disable l2 tunnel offload functions. */ + + eth_set_queue_rate_limit_t set_queue_rate_limit; /**< Set queue rate limit. */ + + rss_hash_update_t rss_hash_update; /** Configure RSS hash protocols. */ + rss_hash_conf_get_t rss_hash_conf_get; /** Get current RSS hash configuration. */ + reta_update_t reta_update; /** Update redirection table. */ + reta_query_t reta_query; /** Query redirection table. */ + + eth_get_reg_t get_reg; /**< Get registers. */ + eth_get_eeprom_length_t get_eeprom_length; /**< Get eeprom length. */ + eth_get_eeprom_t get_eeprom; /**< Get eeprom data. */ + eth_set_eeprom_t set_eeprom; /**< Set eeprom. */ + + eth_get_module_info_t get_module_info; + /** Get plugin module eeprom attribute. */ + eth_get_module_eeprom_t get_module_eeprom; + /** Get plugin module eeprom data. */ + + eth_filter_ctrl_t filter_ctrl; /**< common filter control. */ + + eth_get_dcb_info get_dcb_info; /** Get DCB information. */ + + eth_timesync_enable_t timesync_enable; + /** Turn IEEE1588/802.1AS timestamping on. */ + eth_timesync_disable_t timesync_disable; + /** Turn IEEE1588/802.1AS timestamping off. */ + eth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp; + /** Read the IEEE1588/802.1AS RX timestamp. */ + eth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp; + /** Read the IEEE1588/802.1AS TX timestamp. */ + eth_timesync_adjust_time timesync_adjust_time; /** Adjust the device clock. */ + eth_timesync_read_time timesync_read_time; /** Get the device clock time. */ + eth_timesync_write_time timesync_write_time; /** Set the device clock time. */ + + eth_read_clock read_clock; + + eth_xstats_get_by_id_t xstats_get_by_id; + /**< Get extended device statistic values by ID. */ + eth_xstats_get_names_by_id_t xstats_get_names_by_id; + /**< Get name of extended device statistics by ID. */ + + eth_tm_ops_get_t tm_ops_get; + /**< Get Traffic Management (TM) operations. */ + + eth_mtr_ops_get_t mtr_ops_get; + /**< Get Traffic Metering and Policing (MTR) operations. */ + + eth_pool_ops_supported_t pool_ops_supported; + /**< Test if a port supports specific mempool ops */ + + eth_hairpin_cap_get_t hairpin_cap_get; + /**< Returns the hairpin capabilities. */ + eth_rx_hairpin_queue_setup_t rx_hairpin_queue_setup; + /**< Set up device RX hairpin queue. */ + eth_tx_hairpin_queue_setup_t tx_hairpin_queue_setup; + /**< Set up device TX hairpin queue. */ +}; + /** * RX/TX queue states */ diff --git a/lib/librte_ethdev/rte_flow_driver.h b/lib/librte_ethdev/rte_flow_driver.h index 881cc469b7..997598db11 100644 --- a/lib/librte_ethdev/rte_flow_driver.h +++ b/lib/librte_ethdev/rte_flow_driver.h @@ -18,6 +18,7 @@ #include #include "rte_ethdev.h" +#include "rte_ethdev_driver.h" #include "rte_flow.h" #ifdef __cplusplus diff --git a/lib/librte_ethdev/rte_mtr_driver.h b/lib/librte_ethdev/rte_mtr_driver.h index 3ec7ffa2a5..3b39532935 100644 --- a/lib/librte_ethdev/rte_mtr_driver.h +++ b/lib/librte_ethdev/rte_mtr_driver.h @@ -18,6 +18,7 @@ #include #include "rte_ethdev.h" +#include "rte_ethdev_driver.h" #include "rte_mtr.h" #ifdef __cplusplus diff --git a/lib/librte_ethdev/rte_tm_driver.h b/lib/librte_ethdev/rte_tm_driver.h index 90114ff53e..b86ed89c00 100644 --- a/lib/librte_ethdev/rte_tm_driver.h +++ b/lib/librte_ethdev/rte_tm_driver.h @@ -18,6 +18,7 @@ #include #include "rte_ethdev.h" +#include "rte_ethdev_driver.h" #include "rte_tm.h" #ifdef __cplusplus From patchwork Wed Sep 9 13:01:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 77045 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CDEEBA04B1; Wed, 9 Sep 2020 15:02:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 374331C0D9; Wed, 9 Sep 2020 15:02:42 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 687511B9B7 for ; Wed, 9 Sep 2020 15:02:38 +0200 (CEST) IronPort-SDR: bYAERBNORKdpxGjd58fRKfaIMGifj8bgOS381iI+kbxmVHHsPSBuOrotGJTCfRm2oihuRACptZ jJM6T5AFC2dA== X-IronPort-AV: E=McAfee;i="6000,8403,9738"; a="146038594" X-IronPort-AV: E=Sophos;i="5.76,409,1592895600"; d="scan'208";a="146038594" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2020 06:02:12 -0700 IronPort-SDR: Jdk7CD1cWnmsqnad4j2nJZqU03JYX5GpCr3ZdVLmbcaQSqKvHyIJ4zaHbrsungAkbux3QDM09E O6cEvs2O4duw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,409,1592895600"; d="scan'208";a="341567106" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by FMSMGA003.fm.intel.com with ESMTP; 09 Sep 2020 06:02:09 -0700 From: Ferruh Yigit To: dev@dpdk.org, Ray Kinsella , Neil Horman , John McNamara , Marko Kovacevic , Thomas Monjalon , Andrew Rybchenko , Ori Kam Cc: Ferruh Yigit , David Marchand Date: Wed, 9 Sep 2020 14:01:45 +0100 Message-Id: <20200909130148.1756518-4-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200909130148.1756518-1-ferruh.yigit@intel.com> References: <20200824094021.2323605-1-ferruh.yigit@intel.com> <20200909130148.1756518-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 4/7] ethdev: mark internal functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Some ethdev functions are for drivers only, not for applications. Since we have '__rte_internal' tag available now, marking internal functions with it and moving functions to INTERNAL section in linker script. This is also good for documenting the internal functions. Some internal APIs seems marked as experimental, but it doesn't make sense to have internals APIs as experimental, updating their tag and doxygen comments. Signed-off-by: Ferruh Yigit Acked-by: Andrew Rybchenko Acked-by: David Marchand --- Cc: David Marchand v3: * release note updated --- doc/guides/rel_notes/deprecation.rst | 6 ----- doc/guides/rel_notes/release_20_11.rst | 2 ++ lib/librte_ethdev/rte_ethdev.h | 3 +-- lib/librte_ethdev/rte_ethdev_driver.h | 33 ++++++++++-------------- lib/librte_ethdev/rte_ethdev_version.map | 30 ++++++++++----------- lib/librte_ethdev/rte_flow_driver.h | 4 +-- 6 files changed, 31 insertions(+), 47 deletions(-) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 8770c87006..6c82db2961 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -225,12 +225,6 @@ Deprecation Notices following the IPv6 header, as proposed in RFC https://mails.dpdk.org/archives/dev/2020-August/177257.html. -* ethdev: Some internal APIs for driver usage are exported in the .map file. - Now DPDK has ``__rte_internal`` marker so we can mark internal APIs and move - them to the INTERNAL block in .map. Although these APIs are internal it will - break the ABI checks, that is why change is planned for 20.11. - The list of internal APIs are mainly ones listed in ``rte_ethdev_driver.h``. - * traffic manager: All traffic manager API's in ``rte_tm.h`` were mistakenly made ABI stable in the v19.11 release. The TM maintainer and other contributors have agreed to keep the TM APIs as experimental in expectation of additional spec diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst index 9b5bfcfae8..f8c3521b3f 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -113,6 +113,8 @@ ABI Changes * ``struct eth_dev_ops`` is no more accessible by applications, which was already internal data structure. + * ``ethdev`` internal functions are marked with ``__rte_internal`` tag. + Known Issues ------------ diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index b6f26a513b..e7733d828b 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -1724,8 +1724,7 @@ rte_eth_find_next_of(uint16_t port_id_start, */ __rte_experimental uint16_t -rte_eth_find_next_sibling(uint16_t port_id_start, - uint16_t ref_port_id); +rte_eth_find_next_sibling(uint16_t port_id_start, uint16_t ref_port_id); /** * Macro to iterate over all ethdev ports sharing the same rte_device diff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h index b006cbbe92..3d1bc33272 100644 --- a/lib/librte_ethdev/rte_ethdev_driver.h +++ b/lib/librte_ethdev/rte_ethdev_driver.h @@ -759,6 +759,7 @@ int rte_eth_dev_is_tx_hairpin_queue(struct rte_eth_dev *dev, uint16_t queue_id); * @return * - The pointer to the ethdev slot, on success. NULL on error */ +__rte_internal struct rte_eth_dev *rte_eth_dev_allocated(const char *name); /** @@ -770,6 +771,7 @@ struct rte_eth_dev *rte_eth_dev_allocated(const char *name); * @return * - Slot in the rte_dev_devices array for a new device; */ +__rte_internal struct rte_eth_dev *rte_eth_dev_allocate(const char *name); /** @@ -783,6 +785,7 @@ struct rte_eth_dev *rte_eth_dev_allocate(const char *name); * device. * - Error: Null pointer. */ +__rte_internal struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name); /** @@ -801,6 +804,7 @@ struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name); * @return * - 0 on success, negative on error */ +__rte_internal int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev); /** @@ -814,6 +818,7 @@ int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev); * @return * void */ +__rte_internal void _rte_eth_dev_reset(struct rte_eth_dev *dev); /** @@ -833,6 +838,7 @@ void _rte_eth_dev_reset(struct rte_eth_dev *dev); * @return * int */ +__rte_internal int _rte_eth_dev_callback_process(struct rte_eth_dev *dev, enum rte_eth_event_type event, void *ret_param); @@ -848,6 +854,7 @@ int _rte_eth_dev_callback_process(struct rte_eth_dev *dev, * @param dev * New ethdev port. */ +__rte_internal void rte_eth_dev_probing_finish(struct rte_eth_dev *dev); /** @@ -869,6 +876,7 @@ void rte_eth_dev_probing_finish(struct rte_eth_dev *dev); * @param socket_id * The *socket_id* argument is the socket identifier in case of NUMA. */ +__rte_internal const struct rte_memzone * rte_eth_dma_zone_reserve(const struct rte_eth_dev *eth_dev, const char *name, uint16_t queue_id, size_t size, @@ -955,9 +963,6 @@ rte_eth_linkstatus_get(const struct rte_eth_dev *dev, } /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * Allocate an unique switch domain identifier. * * A pool of switch domain identifiers which can be allocated on request. This @@ -971,14 +976,11 @@ rte_eth_linkstatus_get(const struct rte_eth_dev *dev, * @return * Negative errno value on error, 0 on success. */ -__rte_experimental +__rte_internal int rte_eth_switch_domain_alloc(uint16_t *domain_id); /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * Free switch domain. * * Return a switch domain identifier to the pool of free identifiers after it is @@ -990,7 +992,7 @@ rte_eth_switch_domain_alloc(uint16_t *domain_id); * @return * Negative errno value on error, 0 on success. */ -__rte_experimental +__rte_internal int rte_eth_switch_domain_free(uint16_t domain_id); @@ -1007,9 +1009,6 @@ struct rte_eth_devargs { }; /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * PMD helper function to parse ethdev arguments * * @param devargs @@ -1020,7 +1019,7 @@ struct rte_eth_devargs { * @return * Negative errno value on error, 0 on success. */ -__rte_experimental +__rte_internal int rte_eth_devargs_parse(const char *devargs, struct rte_eth_devargs *eth_devargs); @@ -1030,9 +1029,6 @@ typedef int (*ethdev_bus_specific_init)(struct rte_eth_dev *ethdev, void *bus_specific_init_params); /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * PMD helper function for the creation of a new ethdev ports. * * @param device @@ -1053,7 +1049,7 @@ typedef int (*ethdev_bus_specific_init)(struct rte_eth_dev *ethdev, * @return * Negative errno value on error, 0 on success. */ -__rte_experimental +__rte_internal int rte_eth_dev_create(struct rte_device *device, const char *name, size_t priv_data_size, @@ -1064,9 +1060,6 @@ rte_eth_dev_create(struct rte_device *device, const char *name, typedef int (*ethdev_uninit_t)(struct rte_eth_dev *ethdev); /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * PMD helper function for cleaning up the resources of a ethdev port on it's * destruction. * @@ -1078,7 +1071,7 @@ typedef int (*ethdev_uninit_t)(struct rte_eth_dev *ethdev); * @return * Negative errno value on error, 0 on success. */ -__rte_experimental +__rte_internal int rte_eth_dev_destroy(struct rte_eth_dev *ethdev, ethdev_uninit_t ethdev_uninit); diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map index 8d9d6b1c67..6a84f3d76d 100644 --- a/lib/librte_ethdev/rte_ethdev_version.map +++ b/lib/librte_ethdev/rte_ethdev_version.map @@ -1,8 +1,6 @@ DPDK_21 { global: - _rte_eth_dev_callback_process; - _rte_eth_dev_reset; rte_eth_add_first_rx_callback; rte_eth_add_rx_callback; rte_eth_add_tx_callback; @@ -10,9 +8,6 @@ DPDK_21 { rte_eth_allmulticast_enable; rte_eth_allmulticast_get; rte_eth_dev_adjust_nb_rx_tx_desc; - rte_eth_dev_allocate; - rte_eth_dev_allocated; - rte_eth_dev_attach_secondary; rte_eth_dev_callback_register; rte_eth_dev_callback_unregister; rte_eth_dev_close; @@ -44,8 +39,6 @@ DPDK_21 { rte_eth_dev_mac_addr_remove; rte_eth_dev_pool_ops_supported; rte_eth_dev_priority_flow_ctrl_set; - rte_eth_dev_probing_finish; - rte_eth_dev_release_port; rte_eth_dev_reset; rte_eth_dev_rss_hash_conf_get; rte_eth_dev_rss_hash_update; @@ -81,7 +74,6 @@ DPDK_21 { rte_eth_dev_udp_tunnel_port_delete; rte_eth_dev_vlan_filter; rte_eth_devices; - rte_eth_dma_zone_reserve; rte_eth_find_next; rte_eth_find_next_owned_by; rte_eth_iterator_cleanup; @@ -195,16 +187,8 @@ EXPERIMENTAL { rte_eth_dev_owner_unset; # added in 18.05 - rte_eth_dev_create; - rte_eth_dev_destroy; rte_eth_dev_get_module_eeprom; rte_eth_dev_get_module_info; - rte_eth_devargs_parse; - rte_eth_switch_domain_alloc; - rte_eth_switch_domain_free; - - # added in 18.08 - rte_flow_expand_rss; # added in 18.11 rte_eth_dev_rx_intr_ctl_q_get_fd; @@ -246,5 +230,19 @@ EXPERIMENTAL { INTERNAL { global: + _rte_eth_dev_callback_process; + _rte_eth_dev_reset; + rte_eth_dev_allocate; + rte_eth_dev_allocated; + rte_eth_dev_attach_secondary; + rte_eth_dev_create; + rte_eth_dev_destroy; + rte_eth_dev_probing_finish; + rte_eth_dev_release_port; + rte_eth_devargs_parse; rte_eth_dma_zone_free; + rte_eth_dma_zone_reserve; + rte_eth_switch_domain_alloc; + rte_eth_switch_domain_free; + rte_flow_expand_rss; }; diff --git a/lib/librte_ethdev/rte_flow_driver.h b/lib/librte_ethdev/rte_flow_driver.h index 997598db11..3ee871d3eb 100644 --- a/lib/librte_ethdev/rte_flow_driver.h +++ b/lib/librte_ethdev/rte_flow_driver.h @@ -161,8 +161,6 @@ struct rte_flow_expand_rss { * Expand RSS flows into several possible flows according to the RSS hash * fields requested and the driver capabilities. * - * @b EXPERIMENTAL: this API may change without prior notice - * * @param[out] buf * Buffer to store the result expansion. * @param[in] size @@ -183,7 +181,7 @@ struct rte_flow_expand_rss { * * -E2BIG: graph-depth @p graph is too deep. */ -__rte_experimental +__rte_internal int rte_flow_expand_rss(struct rte_flow_expand_rss *buf, size_t size, const struct rte_flow_item *pattern, uint64_t types, From patchwork Wed Sep 9 13:01:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 77046 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8AE56A04B1; Wed, 9 Sep 2020 15:03:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BE97E1C114; Wed, 9 Sep 2020 15:02:44 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id CE25B1C0CC for ; Wed, 9 Sep 2020 15:02:40 +0200 (CEST) IronPort-SDR: I5BqT02aPZL8LQRgeB1lDYDH0atScVUlIXLKzyab+DYFlLHqGyIZaebF3+QKqmdqGs5Ccyl6It wUr65P5AiB/g== X-IronPort-AV: E=McAfee;i="6000,8403,9738"; a="146038611" X-IronPort-AV: E=Sophos;i="5.76,409,1592895600"; d="scan'208";a="146038611" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2020 06:02:15 -0700 IronPort-SDR: B609Eu4hHHCoqUWb6rLsV/LqXEqZOpxeq7uk/rAwvxvmg4zrAl9zmy2CwpG4Pa4wWvGAMlVQQQ v+Ll/WnpFwGQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,409,1592895600"; d="scan'208";a="341567132" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by FMSMGA003.fm.intel.com with ESMTP; 09 Sep 2020 06:02:13 -0700 From: Ferruh Yigit To: dev@dpdk.org, Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , Thomas Monjalon , Andrew Rybchenko , Ray Kinsella , Neil Horman Cc: Ferruh Yigit , David Marchand Date: Wed, 9 Sep 2020 14:01:46 +0100 Message-Id: <20200909130148.1756518-5-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200909130148.1756518-1-ferruh.yigit@intel.com> References: <20200824094021.2323605-1-ferruh.yigit@intel.com> <20200909130148.1756518-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 5/7] ethdev: use hairpin helper functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Hairpin helper functions were not used by drivers, but it was used only local to ethdev. They are: 'rte_eth_dev_is_rx_hairpin_queue()' 'rte_eth_dev_is_tx_hairpin_queue()' Exposing them as internal APIs and update mlx5 driver (only user of hairpin) to use them. Signed-off-by: Ferruh Yigit Acked-by: Andrew Rybchenko Acked-by: David Marchand --- drivers/net/mlx5/mlx5_rxq.c | 4 ++-- drivers/net/mlx5/mlx5_txq.c | 4 ++-- lib/librte_ethdev/rte_ethdev_driver.h | 2 ++ lib/librte_ethdev/rte_ethdev_version.map | 2 ++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 946f7454f6..1b729f7ab2 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -542,7 +542,7 @@ mlx5_rx_queue_stop(struct rte_eth_dev *dev, uint16_t idx) eth_rx_burst_t pkt_burst = dev->rx_pkt_burst; int ret; - if (dev->data->rx_queue_state[idx] == RTE_ETH_QUEUE_STATE_HAIRPIN) { + if (rte_eth_dev_is_rx_hairpin_queue(dev, idx)) { DRV_LOG(ERR, "Hairpin queue can't be stopped"); rte_errno = EINVAL; return -EINVAL; @@ -653,7 +653,7 @@ mlx5_rx_queue_start(struct rte_eth_dev *dev, uint16_t idx) { int ret; - if (dev->data->rx_queue_state[idx] == RTE_ETH_QUEUE_STATE_HAIRPIN) { + if (rte_eth_dev_is_rx_hairpin_queue(dev, idx)) { DRV_LOG(ERR, "Hairpin queue can't be started"); rte_errno = EINVAL; return -EINVAL; diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c index 66ad368e64..450d9641de 100644 --- a/drivers/net/mlx5/mlx5_txq.c +++ b/drivers/net/mlx5/mlx5_txq.c @@ -244,7 +244,7 @@ mlx5_tx_queue_stop(struct rte_eth_dev *dev, uint16_t idx) { int ret; - if (dev->data->tx_queue_state[idx] == RTE_ETH_QUEUE_STATE_HAIRPIN) { + if (rte_eth_dev_is_tx_hairpin_queue(dev, idx)) { DRV_LOG(ERR, "Hairpin queue can't be stopped"); rte_errno = EINVAL; return -EINVAL; @@ -371,7 +371,7 @@ mlx5_tx_queue_start(struct rte_eth_dev *dev, uint16_t idx) { int ret; - if (dev->data->tx_queue_state[idx] == RTE_ETH_QUEUE_STATE_HAIRPIN) { + if (rte_eth_dev_is_tx_hairpin_queue(dev, idx)) { DRV_LOG(ERR, "Hairpin queue can't be started"); rte_errno = EINVAL; return -EINVAL; diff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h index 3d1bc33272..5dfe9fdf1a 100644 --- a/lib/librte_ethdev/rte_ethdev_driver.h +++ b/lib/librte_ethdev/rte_ethdev_driver.h @@ -734,6 +734,7 @@ struct eth_dev_ops { * @return * - (1) if the queue is hairpin queue, 0 otherwise. */ +__rte_internal int rte_eth_dev_is_rx_hairpin_queue(struct rte_eth_dev *dev, uint16_t queue_id); /** @@ -748,6 +749,7 @@ int rte_eth_dev_is_rx_hairpin_queue(struct rte_eth_dev *dev, uint16_t queue_id); * @return * - (1) if the queue is hairpin queue, 0 otherwise. */ +__rte_internal int rte_eth_dev_is_tx_hairpin_queue(struct rte_eth_dev *dev, uint16_t queue_id); /** diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map index 6a84f3d76d..5db3fb156a 100644 --- a/lib/librte_ethdev/rte_ethdev_version.map +++ b/lib/librte_ethdev/rte_ethdev_version.map @@ -237,6 +237,8 @@ INTERNAL { rte_eth_dev_attach_secondary; rte_eth_dev_create; rte_eth_dev_destroy; + rte_eth_dev_is_rx_hairpin_queue; + rte_eth_dev_is_tx_hairpin_queue; rte_eth_dev_probing_finish; rte_eth_dev_release_port; rte_eth_devargs_parse; From patchwork Wed Sep 9 13:01:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 77047 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 18BE9A04B1; Wed, 9 Sep 2020 15:03:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 015321C11E; Wed, 9 Sep 2020 15:02:46 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 482091C0DA; Wed, 9 Sep 2020 15:02:42 +0200 (CEST) IronPort-SDR: 9de5uu9VGBLoJwpLGxoJfDwfwmCK4MkxbX99wUmyFG6J3Av+IkCU0iyJby8x/hk5eUE2wWRIPZ KjwiW5PGmT8g== X-IronPort-AV: E=McAfee;i="6000,8403,9738"; a="146038632" X-IronPort-AV: E=Sophos;i="5.76,409,1592895600"; d="scan'208";a="146038632" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2020 06:02:19 -0700 IronPort-SDR: f7JeicRK/GuDrUxLqTjWDZfslmfDvy/oH5y2ahJ1cayFVzEv9b94OPl3UnddCMejO9TDTidSpT s8LukiepkGCw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,409,1592895600"; d="scan'208";a="341567270" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by FMSMGA003.fm.intel.com with ESMTP; 09 Sep 2020 06:02:17 -0700 From: Ferruh Yigit To: dev@dpdk.org, Ray Kinsella , Neil Horman , Thomas Monjalon , Andrew Rybchenko , Sergio Gonzalez Monroy Cc: Ferruh Yigit , stable@dpdk.org, David Marchand Date: Wed, 9 Sep 2020 14:01:47 +0100 Message-Id: <20200909130148.1756518-6-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200909130148.1756518-1-ferruh.yigit@intel.com> References: <20200824094021.2323605-1-ferruh.yigit@intel.com> <20200909130148.1756518-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 6/7] ethdev: remove invalid symbols from map file X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" These are struct type names, not object names. Removing them from .map file. Fixes: 9d41beed24b0 ("lib: provide initial versioning") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit Reviewed-by: Andrew Rybchenko Acked-by: David Marchand --- lib/librte_ethdev/rte_ethdev_version.map | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map index 5db3fb156a..a85986a2a2 100644 --- a/lib/librte_ethdev/rte_ethdev_version.map +++ b/lib/librte_ethdev/rte_ethdev_version.map @@ -81,7 +81,6 @@ DPDK_21 { rte_eth_iterator_next; rte_eth_led_off; rte_eth_led_on; - rte_eth_link; rte_eth_link_get; rte_eth_link_get_nowait; rte_eth_macaddr_get; @@ -96,7 +95,6 @@ DPDK_21 { rte_eth_rx_queue_setup; rte_eth_set_queue_rate_limit; rte_eth_speed_bitflag; - rte_eth_stats; rte_eth_stats_get; rte_eth_stats_reset; rte_eth_timesync_adjust_time; From patchwork Wed Sep 9 13:01:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 77048 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 61007A04B1; Wed, 9 Sep 2020 15:03:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0F0E51C126; Wed, 9 Sep 2020 15:02:54 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 068B71C10B for ; Wed, 9 Sep 2020 15:02:51 +0200 (CEST) IronPort-SDR: gG2KS/w/bzNkCKtg4k7s4FkBcPeLl2xmqdjYR+FQDOMhL4W9V4E3UHv20FSb2SEzPvH35P+oAU UdLnJjxjA21w== X-IronPort-AV: E=McAfee;i="6000,8403,9738"; a="146038718" X-IronPort-AV: E=Sophos;i="5.76,409,1592895600"; d="scan'208";a="146038718" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2020 06:02:35 -0700 IronPort-SDR: Oe2JMZoOFFxnvFAQBlPcDaUunjmCL//Ug+0Fpv+M5RXlPtrHaMlztNhmkQ6Cy+XuBQWWCUqWWS X6d+gE+/trxA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,409,1592895600"; d="scan'208";a="341567365" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by FMSMGA003.fm.intel.com with ESMTP; 09 Sep 2020 06:02:23 -0700 From: Ferruh Yigit To: dev@dpdk.org, John McNamara , Marko Kovacevic , Igor Russkikh , Pavel Belous , Ajit Khaparde , Somnath Kotur , Chas Williams , "Wei Hu (Xavier)" , Hemant Agrawal , Sachin Saxena , Wei Zhao , Jeff Guo , Marcin Wojtas , Michal Krawczyk , Guy Tzalik , Evgeny Schemeilin , Igor Chauskin , John Daley , Hyong Youb Kim , Gaetan Rivet , Qi Zhang , Xiao Wang , Ziyang Xuan , Xiaoyun Wang , Guoyang Zhou , Beilei Xing , Jingjing Wu , Qiming Yang , Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , Stephen Hemminger , "K. Y. Srinivasan" , Haiyang Zhang , Long Li , Heinrich Kuhn , Harman Kalra , Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K , Rasesh Mody , Shahed Shaikh , Andrew Rybchenko , Maciej Czekaj , Maxime Coquelin , Chenbo Xia , Zhihong Wang , Yong Wang , Thomas Monjalon , Ray Kinsella , Neil Horman Cc: Ferruh Yigit , David Marchand Date: Wed, 9 Sep 2020 14:01:48 +0100 Message-Id: <20200909130148.1756518-7-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200909130148.1756518-1-ferruh.yigit@intel.com> References: <20200824094021.2323605-1-ferruh.yigit@intel.com> <20200909130148.1756518-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 7/7] ethdev: remove underscore prefix from internal API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" '_rte_eth_dev_callback_process()' & '_rte_eth_dev_reset()' internal APIs has unconventional underscore ('_') prefix. Although this is not documented most probably this is to mark them as internal. Since we have '__rte_internal' flag to mark this, removing '_' from API names. For '_rte_eth_dev_reset()', there is already a public API named 'rte_eth_dev_reset()', so renaming '_rte_eth_dev_reset()' to 'rte_eth_dev_internal_reset'. Signed-off-by: Ferruh Yigit Acked-by: Andrew Rybchenko Acked-by: David Marchand Acked-by: Sachin Saxena --- v3: * release note updated --- app/test/virtual_pmd.c | 4 ++-- doc/guides/prog_guide/poll_mode_drv.rst | 4 ++-- doc/guides/rel_notes/release_20_11.rst | 5 +++++ drivers/net/atlantic/atl_ethdev.c | 5 ++--- drivers/net/bnxt/bnxt_ethdev.c | 6 +++--- drivers/net/bnxt/rte_pmd_bnxt.c | 4 ++-- drivers/net/bonding/rte_eth_bond_pmd.c | 8 ++++---- drivers/net/dpaa/dpaa_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_ethdev.c | 3 +-- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/igb_ethdev.c | 7 +++---- drivers/net/ena/ena_ethdev.c | 4 ++-- drivers/net/enic/enic_main.c | 2 +- drivers/net/failsafe/failsafe_ether.c | 6 +++--- drivers/net/fm10k/fm10k_ethdev.c | 11 ++++------- drivers/net/hinic/base/hinic_pmd_hwdev.c | 6 +++--- drivers/net/i40e/i40e_ethdev.c | 2 +- drivers/net/i40e/i40e_ethdev_vf.c | 4 ++-- drivers/net/i40e/i40e_pf.c | 2 +- drivers/net/iavf/iavf_vchnl.c | 5 ++--- drivers/net/ice/ice_ethdev.c | 4 ++-- drivers/net/igc/igc_ethdev.c | 3 +-- drivers/net/ixgbe/ixgbe_ethdev.c | 10 ++++------ drivers/net/ixgbe/ixgbe_pf.c | 5 ++--- drivers/net/mlx4/mlx4_intr.c | 10 +++++----- drivers/net/mlx5/linux/mlx5_ethdev_os.c | 4 ++-- drivers/net/mlx5/mlx5_flow.c | 2 +- drivers/net/netvsc/hn_rndis.c | 2 +- drivers/net/nfp/nfp_net.c | 2 +- drivers/net/octeontx/octeontx_ethdev.c | 6 +++--- drivers/net/octeontx2/otx2_link.c | 2 +- drivers/net/qede/qede_main.c | 3 +-- drivers/net/sfc/sfc_intr.c | 12 ++++++------ drivers/net/thunderx/nicvf_ethdev.c | 6 +++--- drivers/net/vhost/rte_eth_vhost.c | 6 +++--- drivers/net/virtio/virtio_ethdev.c | 6 +++--- drivers/net/vmxnet3/vmxnet3_ethdev.c | 6 +++--- lib/librte_ethdev/rte_ethdev.c | 8 ++++---- lib/librte_ethdev/rte_ethdev_driver.h | 4 ++-- lib/librte_ethdev/rte_ethdev_version.map | 4 ++-- 40 files changed, 95 insertions(+), 102 deletions(-) diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c index 79156cb85a..b49089a33c 100644 --- a/app/test/virtual_pmd.c +++ b/app/test/virtual_pmd.c @@ -474,8 +474,8 @@ virtual_ethdev_simulate_link_status_interrupt(uint16_t port_id, vrtl_eth_dev->data->dev_link.link_status = link_status; - _rte_eth_dev_callback_process(vrtl_eth_dev, RTE_ETH_EVENT_INTR_LSC, - NULL); + rte_eth_dev_callback_process(vrtl_eth_dev, RTE_ETH_EVENT_INTR_LSC, + NULL); } int diff --git a/doc/guides/prog_guide/poll_mode_drv.rst b/doc/guides/prog_guide/poll_mode_drv.rst index 6fae39f904..86e0a141e6 100644 --- a/doc/guides/prog_guide/poll_mode_drv.rst +++ b/doc/guides/prog_guide/poll_mode_drv.rst @@ -600,9 +600,9 @@ thread safety all these operations should be called from the same thread. For example when PF is reset, the PF sends a message to notify VFs of this event and also trigger an interrupt to VFs. Then in the interrupt service routine the VFs detects this notification message and calls -_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, NULL). +rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, NULL). This means that a PF reset triggers an RTE_ETH_EVENT_INTR_RESET -event within VFs. The function _rte_eth_dev_callback_process() will +event within VFs. The function rte_eth_dev_callback_process() will call the registered callback function. The callback function can trigger the application to handle all operations the VF reset requires including stopping Rx/Tx queues and calling rte_eth_dev_reset(). diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst index f8c3521b3f..7ff6ac23b6 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -86,6 +86,11 @@ API Changes * ``rte_eth_rx_descriptor_done()`` API has deprecated. +* Renamed internal ethdev APIs: + + * ``_rte_eth_dev_callback_process()`` -> ``rte_eth_dev_callback_process()`` + * ``_rte_eth_dev_reset`` -> ``rte_eth_dev_internal_reset()`` + ABI Changes ----------- diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index 540b106045..2fca9140d7 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -1395,8 +1395,7 @@ atl_dev_interrupt_action(struct rte_eth_dev *dev, /* Notify userapp if link status changed */ if (!atl_dev_link_update(dev, 0)) { atl_dev_link_status_print(dev); - _rte_eth_dev_callback_process(dev, - RTE_ETH_EVENT_INTR_LSC, NULL); + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); } else { if (hw->aq_fw_ops->send_macsec_req == NULL) goto done; @@ -1422,7 +1421,7 @@ atl_dev_interrupt_action(struct rte_eth_dev *dev, resp.stats.egress_expired || resp.stats.ingress_expired) { PMD_DRV_LOG(INFO, "RTE_ETH_EVENT_MACSEC"); - _rte_eth_dev_callback_process(dev, + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_MACSEC, NULL); } } diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 4d224bfa04..8c959ac913 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -1528,9 +1528,9 @@ int bnxt_link_update(struct rte_eth_dev *eth_dev, int wait_to_complete, new.link_speed != eth_dev->data->dev_link.link_speed) { rte_eth_linkstatus_set(eth_dev, &new); - _rte_eth_dev_callback_process(eth_dev, - RTE_ETH_EVENT_INTR_LSC, - NULL); + rte_eth_dev_callback_process(eth_dev, + RTE_ETH_EVENT_INTR_LSC, + NULL); bnxt_print_link_info(eth_dev); } diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c index eafc1d3868..d67db46c65 100644 --- a/drivers/net/bnxt/rte_pmd_bnxt.c +++ b/drivers/net/bnxt/rte_pmd_bnxt.c @@ -28,8 +28,8 @@ int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg) ret_param.vf_id = vf_id; ret_param.msg = msg; - _rte_eth_dev_callback_process(bp->eth_dev, RTE_ETH_EVENT_VF_MBOX, - &ret_param); + rte_eth_dev_callback_process(bp->eth_dev, RTE_ETH_EVENT_VF_MBOX, + &ret_param); /* Default to approve */ if (ret_param.retval == RTE_PMD_BNXT_MB_EVENT_PROCEED) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index cdbd8151ed..4ffd2ca4bb 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1879,7 +1879,7 @@ slave_remove(struct bond_dev_private *internals, internals->slave_count--; /* force reconfiguration of slave interfaces */ - _rte_eth_dev_reset(slave_eth_dev); + rte_eth_dev_internal_reset(slave_eth_dev); } static void @@ -2765,7 +2765,7 @@ bond_ethdev_delayed_lsc_propagation(void *arg) if (arg == NULL) return; - _rte_eth_dev_callback_process((struct rte_eth_dev *)arg, + rte_eth_dev_callback_process((struct rte_eth_dev *)arg, RTE_ETH_EVENT_INTR_LSC, NULL); } @@ -2900,7 +2900,7 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, bond_ethdev_delayed_lsc_propagation, (void *)bonded_eth_dev); else - _rte_eth_dev_callback_process(bonded_eth_dev, + rte_eth_dev_callback_process(bonded_eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL); @@ -2910,7 +2910,7 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, bond_ethdev_delayed_lsc_propagation, (void *)bonded_eth_dev); else - _rte_eth_dev_callback_process(bonded_eth_dev, + rte_eth_dev_callback_process(bonded_eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL); } diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index e2c3fd0368..a077b98c3e 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -335,7 +335,7 @@ static void dpaa_interrupt_handler(void *param) if (bytes_read < 0) DPAA_PMD_ERR("Error reading eventfd\n"); dpaa_eth_link_update(dev, 0); - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); } static int dpaa_eth_dev_start(struct rte_eth_dev *dev) diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 38cf0ab71c..0e9f836e55 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -1065,8 +1065,7 @@ dpaa2_interrupt_handler(void *param) clear = DPNI_IRQ_EVENT_LINK_CHANGED; dpaa2_dev_link_update(dev, 0); /* calling all the apps registered for link status event */ - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, - NULL); + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); } out: ret = dpni_clear_irq_status(dpni, CMD_PRI_LOW, priv->token, diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index 82766da882..1dc360713a 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -1630,7 +1630,7 @@ eth_em_interrupt_handler(void *param) eth_em_interrupt_get_status(dev); eth_em_interrupt_action(dev, dev->intr_handle); - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); } static int diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index fe0cea88c2..5ab74840aa 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -2920,8 +2920,7 @@ eth_igb_interrupt_action(struct rte_eth_dev *dev, pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function); - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, - NULL); + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); } return 0; @@ -2983,8 +2982,8 @@ void igbvf_mbx_process(struct rte_eth_dev *dev) /* dummy mbx read to ack pf */ if (mbx->ops.read(hw, &in_msg, 1, 0)) return; - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, - NULL); + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, + NULL); } } diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index da8c8ad922..8077519735 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -1621,7 +1621,7 @@ static void ena_timer_wd_callback(__rte_unused struct rte_timer *timer, if (unlikely(adapter->trigger_reset)) { PMD_DRV_LOG(ERR, "Trigger reset is on\n"); - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, NULL); } } @@ -2867,7 +2867,7 @@ static void ena_update_on_link_change(void *adapter_data, adapter->link_status = status; ena_link_update(eth_dev, 0); - _rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL); + rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL); } static void ena_notification(void *data, diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 7942b0df6b..8b0441c5cd 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -445,7 +445,7 @@ enic_intr_handler(void *arg) vnic_intr_return_all_credits(&enic->intr[ENICPMD_LSC_INTR_OFFSET]); enic_link_update(dev); - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); enic_log_q_error(enic); /* Re-enable irq in case of INTx */ rte_intr_ack(&enic->pdev->intr_handle); diff --git a/drivers/net/failsafe/failsafe_ether.c b/drivers/net/failsafe/failsafe_ether.c index 70972d6717..7c68bbdec0 100644 --- a/drivers/net/failsafe/failsafe_ether.c +++ b/drivers/net/failsafe/failsafe_ether.c @@ -602,9 +602,9 @@ failsafe_eth_lsc_event_callback(uint16_t port_id __rte_unused, ret = dev->dev_ops->link_update(dev, 0); /* We must pass on the LSC event */ if (ret) - return _rte_eth_dev_callback_process(dev, - RTE_ETH_EVENT_INTR_LSC, - NULL); + return rte_eth_dev_callback_process(dev, + RTE_ETH_EVENT_INTR_LSC, + NULL); else return 0; } diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index e6043e1455..5771d83b55 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -2621,7 +2621,7 @@ fm10k_dev_interrupt_handler_pf(void *param) true); dev_info->sm_down = 0; - _rte_eth_dev_callback_process(dev, + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); } @@ -2635,8 +2635,7 @@ fm10k_dev_interrupt_handler_pf(void *param) if (err == FM10K_ERR_RESET_REQUESTED) { PMD_INIT_LOG(INFO, "INT: Switch is down"); dev_info->sm_down = 1; - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, - NULL); + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); } /* Handle SRAM error */ @@ -2703,8 +2702,7 @@ fm10k_dev_interrupt_handler_vf(void *param) /* Setting reset flag */ dev_info->sm_down = 1; - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, - NULL); + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); } if (dev_info->sm_down == 1 && @@ -2732,8 +2730,7 @@ fm10k_dev_interrupt_handler_vf(void *param) fm10k_vlan_filter_set(dev, hw->mac.default_vid, true); dev_info->sm_down = 0; - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, - NULL); + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); } /* Re-enable interrupt from device side */ diff --git a/drivers/net/hinic/base/hinic_pmd_hwdev.c b/drivers/net/hinic/base/hinic_pmd_hwdev.c index ac2a72e388..41c99bdbf8 100644 --- a/drivers/net/hinic/base/hinic_pmd_hwdev.c +++ b/drivers/net/hinic/base/hinic_pmd_hwdev.c @@ -1362,9 +1362,9 @@ static void hinic_lsc_process(struct hinic_hwdev *hwdev, ret = hinic_link_event_process(hwdev, rte_dev, status); /* check if link has changed, notify callback */ if (ret == 0) - _rte_eth_dev_callback_process(rte_dev, - RTE_ETH_EVENT_INTR_LSC, - NULL); + rte_eth_dev_callback_process(rte_dev, + RTE_ETH_EVENT_INTR_LSC, + NULL); } void hinic_l2nic_async_event_handle(struct hinic_hwdev *hwdev, diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 80efd06cd9..563f21d9df 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -6846,7 +6846,7 @@ i40e_dev_handle_aq_msg(struct rte_eth_dev *dev) case i40e_aqc_opc_get_link_status: ret = i40e_dev_link_update(dev, 0); if (!ret) - _rte_eth_dev_callback_process(dev, + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); break; default: diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index be4b28fa45..8531cf6b12 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -1378,7 +1378,7 @@ i40evf_handle_pf_event(struct rte_eth_dev *dev, uint8_t *msg, switch (pf_msg->event) { case VIRTCHNL_EVENT_RESET_IMPENDING: PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_RESET_IMPENDING event"); - _rte_eth_dev_callback_process(dev, + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, NULL); break; case VIRTCHNL_EVENT_LINK_CHANGE: @@ -1425,7 +1425,7 @@ i40evf_handle_pf_event(struct rte_eth_dev *dev, uint8_t *msg, } i40evf_dev_link_update(dev, 0); - _rte_eth_dev_callback_process(dev, + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); break; case VIRTCHNL_EVENT_PF_DRIVER_CLOSE: diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index 7bf1e79410..03c2070c3f 100644 --- a/drivers/net/i40e/i40e_pf.c +++ b/drivers/net/i40e/i40e_pf.c @@ -1363,7 +1363,7 @@ i40e_pf_host_handle_vf_msg(struct rte_eth_dev *dev, * do nothing and send not_supported to VF. As PF must send a response * to VF and ACK/NACK is not defined. */ - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX, &ret_param); + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX, &ret_param); if (ret_param.retval != RTE_PMD_I40E_MB_EVENT_PROCEED) { PMD_DRV_LOG(WARNING, "VF to PF message(%d) is not permitted!", opcode); diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index 34c31a153a..29e4cae10c 100644 --- a/drivers/net/iavf/iavf_vchnl.c +++ b/drivers/net/iavf/iavf_vchnl.c @@ -187,7 +187,7 @@ iavf_handle_pf_event_msg(struct rte_eth_dev *dev, uint8_t *msg, switch (pf_msg->event) { case VIRTCHNL_EVENT_RESET_IMPENDING: PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_RESET_IMPENDING event"); - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, NULL); break; case VIRTCHNL_EVENT_LINK_CHANGE: @@ -202,8 +202,7 @@ iavf_handle_pf_event_msg(struct rte_eth_dev *dev, uint8_t *msg, vf->link_speed = iavf_convert_link_speed(speed); } iavf_dev_link_update(dev, 0); - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, - NULL); + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); break; case VIRTCHNL_EVENT_PF_DRIVER_CLOSE: PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_PF_DRIVER_CLOSE event"); diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index c8b16c7f87..724b2ee26c 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -1314,7 +1314,7 @@ ice_handle_aq_msg(struct rte_eth_dev *dev) case ice_aqc_opc_get_link_status: ret = ice_link_update(dev, 0); if (!ret) - _rte_eth_dev_callback_process + rte_eth_dev_callback_process (dev, RTE_ETH_EVENT_INTR_LSC, NULL); break; default: @@ -1379,7 +1379,7 @@ ice_interrupt_handler(void *param) PMD_DRV_LOG(INFO, "OICR: link state change event"); ret = ice_link_update(dev, 0); if (!ret) - _rte_eth_dev_callback_process + rte_eth_dev_callback_process (dev, RTE_ETH_EVENT_INTR_LSC, NULL); } #endif diff --git a/drivers/net/igc/igc_ethdev.c b/drivers/net/igc/igc_ethdev.c index aa37c11861..810568bc54 100644 --- a/drivers/net/igc/igc_ethdev.c +++ b/drivers/net/igc/igc_ethdev.c @@ -540,8 +540,7 @@ eth_igc_interrupt_action(struct rte_eth_dev *dev) pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function); - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, - NULL); + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); } } diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 337ce90fbf..0f065bbc04 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -4659,13 +4659,11 @@ ixgbe_dev_interrupt_delayed_handler(void *param) ixgbe_dev_link_update(dev, 0); intr->flags &= ~IXGBE_FLAG_NEED_LINK_UPDATE; ixgbe_dev_link_status_print(dev); - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, - NULL); + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); } if (intr->flags & IXGBE_FLAG_MACSEC) { - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_MACSEC, - NULL); + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_MACSEC, NULL); intr->flags &= ~IXGBE_FLAG_MACSEC; } @@ -8674,8 +8672,8 @@ static void ixgbevf_mbx_process(struct rte_eth_dev *dev) /* dummy mbx read to ack pf */ if (ixgbe_read_mbx(hw, &in_msg, 1, 0)) return; - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, - NULL); + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, + NULL); } } diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c index 67b5bef44f..ed5f96b1a4 100644 --- a/drivers/net/ixgbe/ixgbe_pf.c +++ b/drivers/net/ixgbe/ixgbe_pf.c @@ -832,7 +832,7 @@ ixgbe_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t vf) vfinfo[vf].clear_to_send = true; /* notify application about VF reset */ - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX, + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX, &ret_param); return ret; } @@ -844,8 +844,7 @@ ixgbe_rcv_msg_from_vf(struct rte_eth_dev *dev, uint16_t vf) * if 0, do nothing and send ACK to VF * if ret_param.retval > 1, do nothing and send NAK to VF */ - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX, - &ret_param); + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX, &ret_param); retval = ret_param.retval; diff --git a/drivers/net/mlx4/mlx4_intr.c b/drivers/net/mlx4/mlx4_intr.c index 19af9359c9..6786b12ab5 100644 --- a/drivers/net/mlx4/mlx4_intr.c +++ b/drivers/net/mlx4/mlx4_intr.c @@ -124,9 +124,9 @@ mlx4_link_status_alarm(struct mlx4_priv *priv) MLX4_ASSERT(priv->intr_alarm == 1); priv->intr_alarm = 0; if (intr_conf->lsc && !mlx4_link_status_check(priv)) - _rte_eth_dev_callback_process(ETH_DEV(priv), - RTE_ETH_EVENT_INTR_LSC, - NULL); + rte_eth_dev_callback_process(ETH_DEV(priv), + RTE_ETH_EVENT_INTR_LSC, + NULL); } /** @@ -207,8 +207,8 @@ mlx4_interrupt_handler(struct mlx4_priv *priv) } for (i = 0; i != RTE_DIM(caught); ++i) if (caught[i]) - _rte_eth_dev_callback_process(ETH_DEV(priv), type[i], - NULL); + rte_eth_dev_callback_process(ETH_DEV(priv), type[i], + NULL); } /** diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c index 3d3dd2e862..7256c1bcfe 100644 --- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c +++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c @@ -732,7 +732,7 @@ mlx5_dev_interrupt_device_fatal(struct mlx5_dev_ctx_shared *sh) dev = &rte_eth_devices[sh->port[i].ih_port_id]; MLX5_ASSERT(dev); if (dev->data->dev_conf.intr_conf.rmv) - _rte_eth_dev_callback_process + rte_eth_dev_callback_process (dev, RTE_ETH_EVENT_INTR_RMV, NULL); } } @@ -808,7 +808,7 @@ mlx5_dev_interrupt_handler(void *cb_arg) usleep(0); continue; } - _rte_eth_dev_callback_process + rte_eth_dev_callback_process (dev, RTE_ETH_EVENT_INTR_LSC, NULL); continue; } diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index eb55bd7f99..55cdc37f00 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -6085,7 +6085,7 @@ mlx5_flow_aging_check(struct mlx5_dev_ctx_shared *sh, if (!MLX5_AGE_GET(age_info, MLX5_AGE_EVENT_NEW)) continue; if (MLX5_AGE_GET(age_info, MLX5_AGE_TRIGGER)) - _rte_eth_dev_callback_process + rte_eth_dev_callback_process (&rte_eth_devices[sh->port[i].devx_ih_port_id], RTE_ETH_EVENT_FLOW_AGED, NULL); age_info->flags = 0; diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c index d186ddeabd..66d1966f29 100644 --- a/drivers/net/netvsc/hn_rndis.c +++ b/drivers/net/netvsc/hn_rndis.c @@ -292,7 +292,7 @@ static int hn_nvs_send_rndis_ctrl(struct vmbus_channel *chan, */ static void hn_rndis_link_alarm(void *arg) { - _rte_eth_dev_callback_process(arg, RTE_ETH_EVENT_INTR_LSC, NULL); + rte_eth_dev_callback_process(arg, RTE_ETH_EVENT_INTR_LSC, NULL); } void hn_rndis_link_status(struct rte_eth_dev *dev, const void *msg) diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index c556dedab6..4f03691989 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -1460,7 +1460,7 @@ nfp_net_dev_interrupt_delayed_handler(void *param) struct rte_eth_dev *dev = (struct rte_eth_dev *)param; nfp_net_link_update(dev, 0); - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); nfp_net_dev_link_status_print(dev); diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index 76c69294d0..808b761b96 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -227,9 +227,9 @@ octeontx_link_status_poll(void *arg) octeontx_link_status_update(nic, &link); octeontx_link_status_print(dev, &link); rte_eth_linkstatus_set(dev, &link); - _rte_eth_dev_callback_process(dev, - RTE_ETH_EVENT_INTR_LSC, - NULL); + rte_eth_dev_callback_process(dev, + RTE_ETH_EVENT_INTR_LSC, + NULL); } } diff --git a/drivers/net/octeontx2/otx2_link.c b/drivers/net/octeontx2/otx2_link.c index 12bf6c3231..439ec4fa89 100644 --- a/drivers/net/octeontx2/otx2_link.c +++ b/drivers/net/octeontx2/otx2_link.c @@ -82,7 +82,7 @@ otx2_eth_dev_link_status_update(struct otx2_dev *dev, rte_eth_linkstatus_set(eth_dev, ð_link); /* Set the flag and execute application callbacks */ - _rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL); + rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL); } static int diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c index 987a6f1e13..aecb98261b 100644 --- a/drivers/net/qede/qede_main.c +++ b/drivers/net/qede/qede_main.c @@ -650,8 +650,7 @@ void qed_link_update(struct ecore_hwfn *hwfn) struct rte_eth_dev *dev = (struct rte_eth_dev *)qdev->ethdev; if (!qede_link_update(dev, 0)) - _rte_eth_dev_callback_process(dev, - RTE_ETH_EVENT_INTR_LSC, NULL); + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); } static int qed_drain(struct ecore_dev *edev) diff --git a/drivers/net/sfc/sfc_intr.c b/drivers/net/sfc/sfc_intr.c index 80feab68f8..da32d393c2 100644 --- a/drivers/net/sfc/sfc_intr.c +++ b/drivers/net/sfc/sfc_intr.c @@ -89,9 +89,9 @@ sfc_intr_line_handler(void *cb_arg) sfc_notice(sa, "link status change event: link %s", sa->eth_dev->data->dev_link.link_status ? "UP" : "DOWN"); - _rte_eth_dev_callback_process(sa->eth_dev, - RTE_ETH_EVENT_INTR_LSC, - NULL); + rte_eth_dev_callback_process(sa->eth_dev, + RTE_ETH_EVENT_INTR_LSC, + NULL); } } @@ -131,9 +131,9 @@ sfc_intr_message_handler(void *cb_arg) exit: if (lsc_seq != sa->port.lsc_seq) { sfc_notice(sa, "link status change event"); - _rte_eth_dev_callback_process(sa->eth_dev, - RTE_ETH_EVENT_INTR_LSC, - NULL); + rte_eth_dev_callback_process(sa->eth_dev, + RTE_ETH_EVENT_INTR_LSC, + NULL); } } diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index 959c8e4ddc..83d9488360 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -83,9 +83,9 @@ nicvf_interrupt(void *arg) nicvf_link_status_update(nic, &link); rte_eth_linkstatus_set(dev, &link); - _rte_eth_dev_callback_process(dev, - RTE_ETH_EVENT_INTR_LSC, - NULL); + rte_eth_dev_callback_process(dev, + RTE_ETH_EVENT_INTR_LSC, + NULL); } } diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index fa365605ef..ce32be9ce3 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -832,7 +832,7 @@ new_device(int vid) VHOST_LOG(INFO, "Vhost device %d created\n", vid); - _rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL); + rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL); return 0; } @@ -889,7 +889,7 @@ destroy_device(int vid) VHOST_LOG(INFO, "Vhost device %d destroyed\n", vid); eth_vhost_uninstall_intr(eth_dev); - _rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL); + rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL); } static int @@ -968,7 +968,7 @@ vring_state_changed(int vid, uint16_t vring, int enable) VHOST_LOG(INFO, "vring%u is %s\n", vring, enable ? "enabled" : "disabled"); - _rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_QUEUE_STATE, NULL); + rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_QUEUE_STATE, NULL); return 0; } diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 4f2fa0d943..dac0f23052 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1489,9 +1489,9 @@ virtio_interrupt_handler(void *param) if (isr & VIRTIO_PCI_ISR_CONFIG) { if (virtio_dev_link_update(dev, 0) == 0) - _rte_eth_dev_callback_process(dev, - RTE_ETH_EVENT_INTR_LSC, - NULL); + rte_eth_dev_callback_process(dev, + RTE_ETH_EVENT_INTR_LSC, + NULL); if (vtpci_with_feature(hw, VIRTIO_NET_F_STATUS)) { vtpci_read_dev_config(hw, diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c index 815fba2f55..fa80e75a5b 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -1417,9 +1417,9 @@ vmxnet3_process_events(struct rte_eth_dev *dev) if (events & VMXNET3_ECR_LINK) { PMD_DRV_LOG(DEBUG, "Process events: VMXNET3_ECR_LINK event"); if (vmxnet3_dev_link_update(dev, 0) == 0) - _rte_eth_dev_callback_process(dev, - RTE_ETH_EVENT_INTR_LSC, - NULL); + rte_eth_dev_callback_process(dev, + RTE_ETH_EVENT_INTR_LSC, + NULL); } /* Check if there is an error on xmit/recv queues */ diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index f8d63c7e17..066751f287 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -549,7 +549,7 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev) rte_eth_dev_shared_data_prepare(); if (eth_dev->state != RTE_ETH_DEV_UNUSED) - _rte_eth_dev_callback_process(eth_dev, + rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_DESTROY, NULL); rte_spinlock_lock(&rte_eth_dev_shared_data->ownership_lock); @@ -1486,7 +1486,7 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, } void -_rte_eth_dev_reset(struct rte_eth_dev *dev) +rte_eth_dev_internal_reset(struct rte_eth_dev *dev) { if (dev->data->dev_started) { RTE_ETHDEV_LOG(ERR, "Port %u must be stopped to allow reset\n", @@ -4090,7 +4090,7 @@ rte_eth_dev_callback_unregister(uint16_t port_id, } int -_rte_eth_dev_callback_process(struct rte_eth_dev *dev, +rte_eth_dev_callback_process(struct rte_eth_dev *dev, enum rte_eth_event_type event, void *ret_param) { struct rte_eth_dev_callback *cb_lst; @@ -4122,7 +4122,7 @@ rte_eth_dev_probing_finish(struct rte_eth_dev *dev) if (dev == NULL) return; - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_NEW, NULL); + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_NEW, NULL); dev->state = RTE_ETH_DEV_ATTACHED; } diff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h index 5dfe9fdf1a..23cc1e0959 100644 --- a/lib/librte_ethdev/rte_ethdev_driver.h +++ b/lib/librte_ethdev/rte_ethdev_driver.h @@ -821,7 +821,7 @@ int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev); * void */ __rte_internal -void _rte_eth_dev_reset(struct rte_eth_dev *dev); +void rte_eth_dev_internal_reset(struct rte_eth_dev *dev); /** * @internal Executes all the user application registered callbacks for @@ -841,7 +841,7 @@ void _rte_eth_dev_reset(struct rte_eth_dev *dev); * int */ __rte_internal -int _rte_eth_dev_callback_process(struct rte_eth_dev *dev, +int rte_eth_dev_callback_process(struct rte_eth_dev *dev, enum rte_eth_event_type event, void *ret_param); /** diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map index a85986a2a2..b6630dfabe 100644 --- a/lib/librte_ethdev/rte_ethdev_version.map +++ b/lib/librte_ethdev/rte_ethdev_version.map @@ -228,17 +228,17 @@ EXPERIMENTAL { INTERNAL { global: - _rte_eth_dev_callback_process; - _rte_eth_dev_reset; rte_eth_dev_allocate; rte_eth_dev_allocated; rte_eth_dev_attach_secondary; + rte_eth_dev_callback_process; rte_eth_dev_create; rte_eth_dev_destroy; rte_eth_dev_is_rx_hairpin_queue; rte_eth_dev_is_tx_hairpin_queue; rte_eth_dev_probing_finish; rte_eth_dev_release_port; + rte_eth_dev_internal_reset; rte_eth_devargs_parse; rte_eth_dma_zone_free; rte_eth_dma_zone_reserve;