hide eth dev related structures
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
v6 cover hide eth dev related structures
v6 changes:
- Update comments (Andrew)
- Move callback related variables under corresponding ifdefs (Andrew)
- Few nits in rte_eth_macaddrs_get (Andrew)
- Rebased on top of next-net tree
v5 changes:
- Fix spelling (Thomas/David)
- Rename internal helper functions (David)
- Reorder patches and update commit messages (Thomas)
- Update comments (Thomas)
- Changed layout in rte_eth_fp_ops, to group functions and related data based on their functionality:
first 64B line for Rx, second one for Tx.
Didn't observe any real performance difference comparing to original layout. Though decided to keep a new one, as it seems a bit more plausible.
v4 changes:
- Fix secondary process attach (Pavan)
- Fix build failure (Ferruh)
- Update lib/ethdev/verion.map (Ferruh)
Note that moving newly added symbols from EXPERIMENTAL to DPDK_22 section makes checkpatch.sh to complain.
v3 changes:
- Changes in public struct naming (Jerin/Haiyue)
- Split patches
- Update docs
- Shamelessly included Andrew's patch:
https://patches.dpdk.org/project/dpdk/patch/[email protected]/
into these series.
I have to do similar thing here, so decided to avoid duplicated effort.
The aim of these patch series is to make rte_ethdev core data structures (rte_eth_dev, rte_eth_dev_data, rte_eth_rxtx_callback, etc.) internal to DPDK and not visible to the user.
That should allow future possible changes to core ethdev related structures to be transparent to the user and help to improve ABI/API stability. Note that current ethdev API is preserved, but it is a formal ABI break.
The work is based on previous discussions at:
https://www.mail-archive.com/[email protected]/msg211405.html
https://www.mail-archive.com/[email protected]/msg216685.html
and consists of the following main points:
1. Copy public 'fast' function pointers (rx_pkt_burst(), etc.) and related data pointer from rte_eth_dev into a separate flat array. We keep it public to still be able to use inline functions for these 'fast' calls (like rte_eth_rx_burst(), etc.) to avoid/minimize slowdown. Note that apart from function pointers itself, each element of this flat array also contains two opaque pointers for each ethdev:
1) a pointer to an array of internal queue data pointers
2) points to array of queue callback data pointers.
Note that exposing this extra information allows us to avoid extra changes inside PMD level, plus should help to avoid possible performance degradation.
2. Change implementation of 'fast' inline ethdev functions (rte_eth_rx_burst(), etc.) to use new public flat array. While it is an ABI breakage, this change is intended to be transparent for both users (no changes in user app is required) and PMD developers (no changes in PMD is required).
One extra note - with new implementation RX/TX callback invocation will cost one extra function call with this changes. That might cause some slowdown for code-path with RX/TX callbacks heavily involved. Hope such trade-off is acceptable for the community.
3. Move rte_eth_dev, rte_eth_dev_data, rte_eth_rxtx_callback and related things into internal header: <ethdev_driver.h>.
That approach was selected to:
- Avoid(/minimize) possible performance losses.
- Minimize required changes inside PMDs.
Performance testing results (ICX 2.0GHz, E810 (ice)):
- testpmd macswap fwd mode, plus
a) no RX/TX callbacks:
no actual slowdown observed
b) bpf-load rx 0 0 JM ./dpdk.org/examples/bpf/t3.o:
~2% slowdown
- l3fwd: no actual slowdown observed
Would like to thank everyone who already reviewed and tested previous versions of these series. All other interested parties please don't be shy and provide your feedback.
Konstantin Ananyev (6):
ethdev: allocate max space for internal queue array
ethdev: change input parameters for rx_queue_count
ethdev: copy fast-path API into separate structure
ethdev: make fast-path functions to use new flat array
ethdev: add API to retrieve multiple ethernet addresses
ethdev: hide eth dev related structures
app/test-pmd/config.c | 23 +- doc/guides/rel_notes/release_21_11.rst | 17 + drivers/common/octeontx2/otx2_sec_idev.c | 2 +- drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 2 +- drivers/net/ark/ark_ethdev_rx.c | 4 +- drivers/net/ark/ark_ethdev_rx.h | 3 +- drivers/net/atlantic/atl_ethdev.h | 2 +- drivers/net/atlantic/atl_rxtx.c | 9 +- drivers/net/bnxt/bnxt_ethdev.c | 8 +- drivers/net/cxgbe/base/adapter.h | 2 +- drivers/net/dpaa/dpaa_ethdev.c | 9 +- drivers/net/dpaa2/dpaa2_ethdev.c | 9 +- drivers/net/dpaa2/dpaa2_ptp.c | 2 +- drivers/net/e1000/e1000_ethdev.h | 6 +- drivers/net/e1000/em_rxtx.c | 4 +- drivers/net/e1000/igb_rxtx.c | 4 +- drivers/net/enic/enic_ethdev.c | 12 +- drivers/net/fm10k/fm10k.h | 2 +- drivers/net/fm10k/fm10k_rxtx.c | 4 +- drivers/net/hns3/hns3_rxtx.c | 7 +- drivers/net/hns3/hns3_rxtx.h | 2 +- drivers/net/i40e/i40e_rxtx.c | 4 +- drivers/net/i40e/i40e_rxtx.h | 3 +- drivers/net/iavf/iavf_rxtx.c | 4 +- drivers/net/iavf/iavf_rxtx.h | 2 +- drivers/net/ice/ice_rxtx.c | 4 +- drivers/net/ice/ice_rxtx.h | 2 +- drivers/net/igc/igc_txrx.c | 5 +- drivers/net/igc/igc_txrx.h | 3 +- drivers/net/ixgbe/ixgbe_ethdev.h | 3 +- drivers/net/ixgbe/ixgbe_rxtx.c | 4 +- drivers/net/mlx5/mlx5_rx.c | 26 +- drivers/net/mlx5/mlx5_rx.h | 2 +- drivers/net/netvsc/hn_rxtx.c | 4 +- drivers/net/netvsc/hn_var.h | 3 +- drivers/net/nfp/nfp_rxtx.c | 4 +- drivers/net/nfp/nfp_rxtx.h | 3 +- drivers/net/octeontx2/otx2_ethdev.h | 2 +- drivers/net/octeontx2/otx2_ethdev_ops.c | 8 +- drivers/net/sfc/sfc_ethdev.c | 12 +- drivers/net/thunderx/nicvf_ethdev.c | 3 +- drivers/net/thunderx/nicvf_rxtx.c | 4 +- drivers/net/thunderx/nicvf_rxtx.h | 2 +- drivers/net/txgbe/txgbe_ethdev.h | 3 +- drivers/net/txgbe/txgbe_rxtx.c | 4 +- drivers/net/vhost/rte_eth_vhost.c | 4 +- lib/ethdev/ethdev_driver.h | 154 +++++++++ lib/ethdev/ethdev_private.c | 83 +++++ lib/ethdev/ethdev_private.h | 7 + lib/ethdev/rte_ethdev.c | 90 ++++-- lib/ethdev/rte_ethdev.h | 291 +++++++++++++----- lib/ethdev/rte_ethdev_core.h | 177 +++-------- lib/ethdev/version.map | 6 +- lib/eventdev/rte_event_eth_rx_adapter.c | 2 +- lib/eventdev/rte_event_eth_tx_adapter.c | 2 +- lib/eventdev/rte_eventdev.c | 2 +- lib/metrics/rte_metrics_telemetry.c | 2 +- 57 files changed, 694 insertions(+), 373 deletions(-)
Signature · 1 line
2.26.3
PATCH v6 1/6 ethdev: allocate max space for internal queue array
At queue configure stage always allocate space for maximum possible number (RTE_MAX_QUEUES_PER_PORT) of queue pointers.
That will allow 'fast' inline functions (eth_rx_burst, etc.) to refer pointer to internal queue data without extra checking of current number of configured queues.
That would help in future to hide rte_eth_dev and related structures. It means that from now on, each ethdev port will always consume:
((2*sizeof(uintptr_t))* RTE_MAX_QUEUES_PER_PORT)
bytes of memory for its queue pointers.
With RTE_MAX_QUEUES_PER_PORT==1024 (default value) it is 16KB per port.
--- lib/ethdev/rte_ethdev.c | 38 +++++--------------------------------- 1 file changed, 5 insertions(+), 33 deletions(-)
lib/ethdev/rte_ethdev.c +5 -33
@@ -919,12 +919,12 @@ static int eth_dev_rx_queue_config(struct rte_eth_dev *dev, uint16_t nb_queues) { uint16_t old_nb_queues = dev->data->nb_rx_queues; -void **rxq;unsigned i;if (dev->data->rx_queues ==NULL && nb_queues !=0 ) {/* first time configuration */ dev->data->rx_queues =rte_zmalloc ("ethdev->rx_queues" , -sizeof (dev->data->rx_queues[0 ]) * nb_queues, +sizeof (dev->data->rx_queues[0 ]) * +RTE_MAX_QUEUES_PER_PORT ,RTE_CACHE_LINE_SIZE );if (dev->data->rx_queues ==NULL ) { dev->data->nb_rx_queues =0 ;
@@ -934,20 +934,6 @@ eth_dev_rx_queue_config(struct rte_eth_dev *dev, uint16_t nb_queues)for (i = nb_queues; i < old_nb_queues; i++)eth_dev_rxq_release (dev, i); - rxq = dev->data->rx_queues; - rxq =rte_realloc (rxq,sizeof (rxq[0 ]) * nb_queues, -RTE_CACHE_LINE_SIZE ); -if (rxq ==NULL ) -return -(ENOMEM ); -if (nb_queues > old_nb_queues) { -uint16_t new_qs = nb_queues - old_nb_queues; - -memset (rxq + old_nb_queues,0 , -sizeof (rxq[0 ]) * new_qs); - } - - dev->data->rx_queues = rxq; - }else if (dev->data->rx_queues !=NULL && nb_queues ==0 ) {for (i = nb_queues; i < old_nb_queues; i++)eth_dev_rxq_release (dev, i);
@@ -1153,13 +1139,13 @@ static int eth_dev_tx_queue_config(struct rte_eth_dev *dev, uint16_t nb_queues) { uint16_t old_nb_queues = dev->data->nb_tx_queues; -void **txq;unsigned i;if (dev->data->tx_queues ==NULL && nb_queues !=0 ) {/* first time configuration */ dev->data->tx_queues =rte_zmalloc ("ethdev->tx_queues" , -sizeof (dev->data->tx_queues[0 ]) * nb_queues, -RTE_CACHE_LINE_SIZE ); +sizeof (dev->data->tx_queues[0 ]) * +RTE_MAX_QUEUES_PER_PORT , +RTE_CACHE_LINE_SIZE );if (dev->data->tx_queues ==NULL ) { dev->data->nb_tx_queues =0 ;return -(ENOMEM );
@@ -1168,20 +1154,6 @@ eth_dev_tx_queue_config(struct rte_eth_dev *dev, uint16_t nb_queues)for (i = nb_queues; i < old_nb_queues; i++)eth_dev_txq_release (dev, i); - txq = dev->data->tx_queues; - txq =rte_realloc (txq,sizeof (txq[0 ]) * nb_queues, -RTE_CACHE_LINE_SIZE ); -if (txq ==NULL ) -return -ENOMEM ; -if (nb_queues > old_nb_queues) { -uint16_t new_qs = nb_queues - old_nb_queues; - -memset (txq + old_nb_queues,0 , -sizeof (txq[0 ]) * new_qs); - } - - dev->data->tx_queues = txq; - }else if (dev->data->tx_queues !=NULL && nb_queues ==0 ) {for (i = nb_queues; i < old_nb_queues; i++)eth_dev_txq_release (dev, i);
Signature · 1 line
2.26.3
Re: [dpdk-dev] [PATCH v6 1/6] ethdev: allocate max space for internal queue array
Quoted 11 lines · Konstantin Ananyev
At queue configure stage always allocate space for maximum possible number (
RTE_MAX_QUEUES_PER_PORT) of queue pointers.
That will allow 'fast' inline functions (eth_rx_burst, etc.) to refer pointer to internal queue data without extra checking of current number of configured queues.
That would help in future to hiderte_eth_devand related structures. It means that from now on, each ethdev port will always consume:
((2*sizeof(uintptr_t))*RTE_MAX_QUEUES_PER_PORT)
bytes of memory for its queue pointers.
With RTE_MAX_QUEUES_PER_PORT==1024 (default value) it is 16KB per port.
Quoted 1 line
Signed-off-by Konstantin Ananyev <[email protected]>
PATCH v6 2/6 ethdev: change input parameters for rx_queue_count
In reply to Konstantin AnanyevCurrently majority of fast-path ethdev ops take pointers to internal queue data structures as an input parameter.
While eth_rx_queue_count() takes a pointer to rte_eth_dev and queue index.
For future work to hide rte_eth_devices[] and friends it would be plausible to unify parameters list of all fast-path ethdev ops. This patch changes eth_rx_queue_count() to accept pointer to internal queue data as input parameter.
While this change is transparent to user, it still counts as an ABI change, as eth_rx_queue_count_t is used by ethdev public inline function rte_eth_rx_queue_count().
--- doc/guides/rel_notes/release_21_11.rst | 6 ++++++ drivers/net/ark/ark_ethdev_rx.c | 4 ++-- drivers/net/ark/ark_ethdev_rx.h | 3 +-- drivers/net/atlantic/atl_ethdev.h | 2 +- drivers/net/atlantic/atl_rxtx.c | 9 ++------- drivers/net/bnxt/bnxt_ethdev.c | 8 +++++--- drivers/net/dpaa/dpaa_ethdev.c | 9 ++++----- drivers/net/dpaa2/dpaa2_ethdev.c | 9 ++++----- drivers/net/e1000/e1000_ethdev.h | 6 ++---- drivers/net/e1000/em_rxtx.c | 4 ++-- drivers/net/e1000/igb_rxtx.c | 4 ++-- drivers/net/enic/enic_ethdev.c | 12 ++++++------ drivers/net/fm10k/fm10k.h | 2 +- drivers/net/fm10k/fm10k_rxtx.c | 4 ++-- drivers/net/hns3/hns3_rxtx.c | 7 +++++-- drivers/net/hns3/hns3_rxtx.h | 2 +- drivers/net/i40e/i40e_rxtx.c | 4 ++-- drivers/net/i40e/i40e_rxtx.h | 3 +-- drivers/net/iavf/iavf_rxtx.c | 4 ++-- drivers/net/iavf/iavf_rxtx.h | 2 +- drivers/net/ice/ice_rxtx.c | 4 ++-- drivers/net/ice/ice_rxtx.h | 2 +- drivers/net/igc/igc_txrx.c | 5 ++--- drivers/net/igc/igc_txrx.h | 3 +-- drivers/net/ixgbe/ixgbe_ethdev.h | 3 +-- drivers/net/ixgbe/ixgbe_rxtx.c | 4 ++-- drivers/net/mlx5/mlx5_rx.c | 26 ++++++++++++------------- drivers/net/mlx5/mlx5_rx.h | 2 +- drivers/net/netvsc/hn_rxtx.c | 4 ++-- drivers/net/netvsc/hn_var.h | 2 +- drivers/net/nfp/nfp_rxtx.c | 4 ++-- drivers/net/nfp/nfp_rxtx.h | 3 +-- drivers/net/octeontx2/otx2_ethdev.h | 2 +- drivers/net/octeontx2/otx2_ethdev_ops.c | 8 ++++---- drivers/net/sfc/sfc_ethdev.c | 12 ++++++------ drivers/net/thunderx/nicvf_ethdev.c | 3 +-- drivers/net/thunderx/nicvf_rxtx.c | 4 ++-- drivers/net/thunderx/nicvf_rxtx.h | 2 +- drivers/net/txgbe/txgbe_ethdev.h | 3 +-- drivers/net/txgbe/txgbe_rxtx.c | 4 ++-- drivers/net/vhost/rte_eth_vhost.c | 4 ++-- lib/ethdev/rte_ethdev.h | 2 +- lib/ethdev/rte_ethdev_core.h | 3 +-- 43 files changed, 103 insertions(+), 110 deletions(-)
doc/guides/rel_notes/release_21_11.rst +6 -0
@@ -299,6 +299,12 @@ ABI Changes * bbdev: Added capability related to more comprehensive CRC options, shifting values of the ``enum rte_bbdev_op_ldpcdec_flag_bitmasks``. +* ethdev: Input parameters for ``eth_rx_queue_count_t`` was changed. + Instead of pointer to ``rte_eth_dev`` and queue index, now it accepts pointer + to internal queue data as input parameter. While this change is transparent + to user, it still counts as an ABI change, as ``eth_rx_queue_count_t`` + is used by public inline function ``rte_eth_rx_queue_count``. + Known Issues ------------
drivers/net/ark/ark_ethdev_rx.c +2 -2
@@ -388,11 +388,11 @@ eth_ark_rx_queue_drain(struct ark_rx_queue *queue) }uint32_t -eth_ark_dev_rx_queue_count (struct rte_eth_dev *dev,uint16_t queue_id) +eth_ark_dev_rx_queue_count (void *rx_queue) {struct ark_rx_queue *queue; - queue = dev->data->rx_queues[queue_id]; + queue = rx_queue;return (queue->prod_index - queue->cons_index);/* mod arith */ }
drivers/net/ark/ark_ethdev_rx.h +1 -2
@@ -17,8 +17,7 @@ int eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,unsigned int socket_id, const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mp); -uint32_t eth_ark_dev_rx_queue_count (struct rte_eth_dev *dev, -uint16_t rx_queue_id); +uint32_t eth_ark_dev_rx_queue_count (void *rx_queue);int eth_ark_rx_stop_queue (struct rte_eth_dev *dev,uint16_t queue_id);int eth_ark_rx_start_queue (struct rte_eth_dev *dev,uint16_t queue_id); uint16_t eth_ark_recv_pkts_noop(void *rx_queue, struct rte_mbuf **rx_pkts,
drivers/net/atlantic/atl_ethdev.h +1 -1
@@ -66,7 +66,7 @@ int atl_tx_queue_setup(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); -uint32_t atl_rx_queue_count (struct rte_eth_dev *dev,uint16_t rx_queue_id); +uint32_t atl_rx_queue_count (void *rx_queue);int atl_dev_rx_descriptor_status (void *rx_queue,uint16_t offset);int atl_dev_tx_descriptor_status (void *tx_queue,uint16_t offset);
drivers/net/atlantic/atl_rxtx.c +2 -7
@@ -689,18 +689,13 @@ atl_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,/* Return Rx queue avail count */ uint32_t -atl_rx_queue_count (struct rte_eth_dev *dev,uint16_t rx_queue_id) +atl_rx_queue_count (void *rx_queue) {struct atl_rx_queue *rxq;PMD_INIT_FUNC_TRACE (); -if (rx_queue_id >= dev->data->nb_rx_queues) { -PMD_DRV_LOG (ERR ,"Invalid RX queue id=%d" , rx_queue_id); -return 0 ; - } - - rxq = dev->data->rx_queues[rx_queue_id]; + rxq = rx_queue;if (rxq ==NULL )return 0 ;
drivers/net/bnxt/bnxt_ethdev.c +5 -3
@@ -3154,20 +3154,22 @@ bnxt_dev_led_off_op(struct rte_eth_dev *dev) }static uint32_t -bnxt_rx_queue_count_op (struct rte_eth_dev *dev,uint16_t rx_queue_id) +bnxt_rx_queue_count_op (void *rx_queue) { -struct bnxt *bp = (struct bnxt *)dev->data->dev_private; +struct bnxt *bp;struct bnxt_cp_ring_info *cpr;uint32_t desc =0 , raw_cons, cp_ring_size;struct bnxt_rx_queue *rxq;struct rx_pkt_cmpl *rxcmp;int rc; + rxq = rx_queue; + bp = rxq->bp; + rc =is_bnxt_in_error (bp);if (rc)return rc; - rxq = dev->data->rx_queues[rx_queue_id]; cpr = rxq->cp_ring; raw_cons = cpr->cp_raw_cons; cp_ring_size = cpr->cp_ring_struct->ring_size;
drivers/net/dpaa/dpaa_ethdev.c +4 -5
@@ -1267,17 +1267,16 @@ int dpaa_eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, }static uint32_t -dpaa_dev_rx_queue_count (struct rte_eth_dev *dev,uint16_t rx_queue_id) +dpaa_dev_rx_queue_count (void *rx_queue) { -struct dpaa_if *dpaa_intf = dev->data->dev_private; -struct qman_fq *rxq = &dpaa_intf->rx_queues[rx_queue_id]; +struct qman_fq *rxq = rx_queue;u32 frm_cnt =0 ;PMD_INIT_FUNC_TRACE ();if (qman_query_fq_frm_cnt (rxq, &frm_cnt) ==0 ) { -DPAA_PMD_DEBUG ("RX frame count for q(%d) is %u" , - rx_queue_id, frm_cnt); +DPAA_PMD_DEBUG ("RX frame count for q(%p) is %u" , + rx_queue, frm_cnt); }return frm_cnt; }
drivers/net/dpaa2/dpaa2_ethdev.c +4 -5
@@ -1007,10 +1007,9 @@ dpaa2_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t rx_queue_id) }static uint32_t -dpaa2_dev_rx_queue_count (struct rte_eth_dev *dev,uint16_t rx_queue_id) +dpaa2_dev_rx_queue_count (void *rx_queue) {int32_t ret; -struct dpaa2_dev_priv *priv = dev->data->dev_private;struct dpaa2_queue *dpaa2_q;struct qbman_swp *swp;struct qbman_fq_query_np_rslt state;
@@ -1027,12 +1026,12 @@ dpaa2_dev_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id) } swp =DPAA2_PER_LCORE_PORTAL ; - dpaa2_q = (struct dpaa2_queue *)priv->rx_vq[rx_queue_id]; + dpaa2_q = rx_queue;if (qbman_fq_query_state (swp, dpaa2_q->fqid, &state) ==0 ) { frame_cnt =qbman_fq_state_frame_count (&state); -DPAA2_PMD_DP_DEBUG ("RX frame count for q(%d) is %u" , - rx_queue_id, frame_cnt); +DPAA2_PMD_DP_DEBUG ("RX frame count for q(%p) is %u" , + rx_queue, frame_cnt); }return frame_cnt; }
drivers/net/e1000/e1000_ethdev.h +2 -4
@@ -399,8 +399,7 @@ int eth_igb_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mb_pool); -uint32_t eth_igb_rx_queue_count (struct rte_eth_dev *dev, -uint16_t rx_queue_id); +uint32_t eth_igb_rx_queue_count (void *rx_queue);int eth_igb_rx_descriptor_status (void *rx_queue,uint16_t offset);int eth_igb_tx_descriptor_status (void *tx_queue,uint16_t offset);
@@ -474,8 +473,7 @@ int eth_em_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mb_pool); -uint32_t eth_em_rx_queue_count (struct rte_eth_dev *dev, -uint16_t rx_queue_id); +uint32_t eth_em_rx_queue_count (void *rx_queue);int eth_em_rx_descriptor_status (void *rx_queue,uint16_t offset);int eth_em_tx_descriptor_status (void *tx_queue,uint16_t offset);
drivers/net/e1000/em_rxtx.c +2 -2
@@ -1495,14 +1495,14 @@ eth_em_rx_queue_setup(struct rte_eth_dev *dev, }uint32_t -eth_em_rx_queue_count (struct rte_eth_dev *dev,uint16_t rx_queue_id) +eth_em_rx_queue_count (void *rx_queue) {#define EM_RXQ_SCAN_INTERVAL 4volatile struct e1000_rx_desc *rxdp;struct em_rx_queue *rxq;uint32_t desc =0 ; - rxq = dev->data->rx_queues[rx_queue_id]; + rxq = rx_queue; rxdp = &(rxq->rx_ring[rxq->rx_tail]); while ((desc < rxq->nb_rx_desc) &&
drivers/net/e1000/igb_rxtx.c +2 -2
@@ -1776,14 +1776,14 @@ eth_igb_rx_queue_setup(struct rte_eth_dev *dev, }uint32_t -eth_igb_rx_queue_count (struct rte_eth_dev *dev,uint16_t rx_queue_id) +eth_igb_rx_queue_count (void *rx_queue) {#define IGB_RXQ_SCAN_INTERVAL 4volatile union e1000_adv_rx_desc *rxdp;struct igb_rx_queue *rxq;uint32_t desc =0 ; - rxq = dev->data->rx_queues[rx_queue_id]; + rxq = rx_queue; rxdp = &(rxq->rx_ring[rxq->rx_tail]); while ((desc < rxq->nb_rx_desc) &&
drivers/net/enic/enic_ethdev.c +6 -6
@@ -237,18 +237,18 @@ static void enicpmd_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid)enic_free_rq (rxq); } -static uint32_t enicpmd_dev_rx_queue_count (struct rte_eth_dev *dev, -uint16_t rx_queue_id) +static uint32_t enicpmd_dev_rx_queue_count (void *rx_queue) { -struct enic *enic =pmd_priv (dev); +struct enic *enic; +struct vnic_rq *sop_rq;uint32_t queue_count =0 ;struct vnic_cq *cq;uint32_t cq_tail;uint16_t cq_idx; -int rq_num; - rq_num =enic_rte_rq_idx_to_sop_idx (rx_queue_id); - cq = &enic->cq[enic_cq_rq (enic, rq_num)]; + sop_rq = rx_queue; + enic =vnic_dev_priv (sop_rq->vdev); + cq = &enic->cq[enic_cq_rq (enic, sop_rq->index)]; cq_idx = cq->to_clean; cq_tail =ioread32 (&cq->ctrl->cq_tail);
drivers/net/fm10k/fm10k.h +1 -1
@@ -324,7 +324,7 @@ uint16_t fm10k_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts);uint32_t -fm10k_dev_rx_queue_count (struct rte_eth_dev *dev,uint16_t rx_queue_id); +fm10k_dev_rx_queue_count (void *rx_queue);int fm10k_dev_rx_descriptor_status (void *rx_queue,uint16_t offset);
drivers/net/fm10k/fm10k_rxtx.c +2 -2
@@ -367,14 +367,14 @@ fm10k_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, }uint32_t -fm10k_dev_rx_queue_count (struct rte_eth_dev *dev,uint16_t rx_queue_id) +fm10k_dev_rx_queue_count (void *rx_queue) {#define FM10K_RXQ_SCAN_INTERVAL 4volatile union fm10k_rx_desc *rxdp;struct fm10k_rx_queue *rxq;uint16_t desc =0 ; - rxq = dev->data->rx_queues[rx_queue_id]; + rxq = rx_queue; rxdp = &rxq->hw_ring[rxq->next_dd];while ((desc < rxq->nb_desc) && rxdp->w.status &rte_cpu_to_le_16 (FM10K_RXD_STATUS_DD )) {
drivers/net/hns3/hns3_rxtx.c +5 -2
@@ -4685,7 +4685,7 @@ hns3_dev_tx_descriptor_status(void *tx_queue, uint16_t offset) }uint32_t -hns3_rx_queue_count (struct rte_eth_dev *dev,uint16_t rx_queue_id) +hns3_rx_queue_count (void *rx_queue) {/* * Number of BDs that have been processed by the driver
@@ -4693,9 +4693,12 @@ hns3_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)*/ uint32_t driver_hold_bd_num;struct hns3_rx_queue *rxq; +const struct rte_eth_dev *dev;uint32_t fbd_num; - rxq = dev->data->rx_queues[rx_queue_id]; + rxq = rx_queue; + dev = &rte_eth_devices[rxq->port_id]; + fbd_num =hns3_read_dev (rxq,HNS3_RING_RX_FBDNUM_REG );if (dev->rx_pkt_burst == hns3_recv_pkts_vec || dev->rx_pkt_burst == hns3_recv_pkts_vec_sve)
drivers/net/hns3/hns3_rxtx.h +1 -1
@@ -696,7 +696,7 @@ int hns3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc, struct rte_mempool *mp);int hns3_tx_queue_setup (struct rte_eth_dev *dev,uint16_t idx,uint16_t nb_desc,unsigned int socket,const struct rte_eth_txconf *conf); -uint32_t hns3_rx_queue_count (struct rte_eth_dev *dev,uint16_t rx_queue_id); +uint32_t hns3_rx_queue_count (void *rx_queue);int hns3_dev_rx_queue_start (struct rte_eth_dev *dev,uint16_t rx_queue_id);int hns3_dev_rx_queue_stop (struct rte_eth_dev *dev,uint16_t rx_queue_id);int hns3_dev_tx_queue_start (struct rte_eth_dev *dev,uint16_t tx_queue_id);
drivers/net/i40e/i40e_rxtx.c +2 -2
@@ -2121,14 +2121,14 @@ i40e_rx_queue_release(void *rxq) }uint32_t -i40e_dev_rx_queue_count (struct rte_eth_dev *dev,uint16_t rx_queue_id) +i40e_dev_rx_queue_count (void *rx_queue) {#define I40E_RXQ_SCAN_INTERVAL 4volatile union i40e_rx_desc *rxdp;struct i40e_rx_queue *rxq;uint16_t desc =0 ; - rxq = dev->data->rx_queues[rx_queue_id]; + rxq = rx_queue; rxdp = &(rxq->rx_ring[rxq->rx_tail]); while ((desc < rxq->nb_rx_desc) && ((rte_le_to_cpu_64(rxdp->wb.qword1.status_error_len) &
drivers/net/i40e/i40e_rxtx.h +1 -2
@@ -229,8 +229,7 @@ int i40e_tx_done_cleanup(void *txq, uint32_t free_cnt);int i40e_alloc_rx_queue_mbufs (struct i40e_rx_queue *rxq);void i40e_rx_queue_release_mbufs (struct i40e_rx_queue *rxq); -uint32_t i40e_dev_rx_queue_count (struct rte_eth_dev *dev, -uint16_t rx_queue_id); +uint32_t i40e_dev_rx_queue_count (void *rx_queue);int i40e_dev_rx_descriptor_status (void *rx_queue,uint16_t offset);int i40e_dev_tx_descriptor_status (void *tx_queue,uint16_t offset);
drivers/net/iavf/iavf_rxtx.c +2 -2
@@ -2799,14 +2799,14 @@ iavf_dev_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,/* Get the number of used descriptors of a rx queue */ uint32_t -iavf_dev_rxq_count (struct rte_eth_dev *dev,uint16_t queue_id) +iavf_dev_rxq_count (void *rx_queue) {#define IAVF_RXQ_SCAN_INTERVAL 4volatile union iavf_rx_desc *rxdp;struct iavf_rx_queue *rxq;uint16_t desc =0 ; - rxq = dev->data->rx_queues[queue_id]; + rxq = rx_queue; rxdp = &rxq->rx_ring[rxq->rx_tail]; while ((desc < rxq->nb_rx_desc) &&
drivers/net/iavf/iavf_rxtx.h +1 -1
@@ -453,7 +453,7 @@ void iavf_dev_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, struct rte_eth_rxq_info *qinfo);void iavf_dev_txq_info_get (struct rte_eth_dev *dev,uint16_t queue_id,struct rte_eth_txq_info *qinfo); -uint32_t iavf_dev_rxq_count (struct rte_eth_dev *dev,uint16_t queue_id); +uint32_t iavf_dev_rxq_count (void *rx_queue);int iavf_dev_rx_desc_status (void *rx_queue,uint16_t offset);int iavf_dev_tx_desc_status (void *tx_queue,uint16_t offset);
drivers/net/ice/ice_rxtx.c +2 -2
@@ -1460,14 +1460,14 @@ ice_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, } uint32_t -ice_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id) +ice_rx_queue_count(void *rx_queue) { #define ICE_RXQ_SCAN_INTERVAL 4 volatile union ice_rx_flex_desc *rxdp; struct ice_rx_queue *rxq; uint16_t desc = 0; - rxq = dev->data->rx_queues[rx_queue_id]; + rxq = rx_queue; rxdp = &rxq->rx_ring[rxq->rx_tail]; while ((desc < rxq->nb_rx_desc) && rte_le_to_cpu_16(rxdp->wb.status_error0) &
drivers/net/ice/ice_rxtx.h +1 -1
@@ -230,7 +230,7 @@ uint16_t ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,void ice_set_tx_function_flag (struct rte_eth_dev *dev,struct ice_tx_queue *txq);void ice_set_tx_function (struct rte_eth_dev *dev); -uint32_t ice_rx_queue_count (struct rte_eth_dev *dev,uint16_t rx_queue_id); +uint32_t ice_rx_queue_count (void *rx_queue);void ice_rxq_info_get (struct rte_eth_dev *dev,uint16_t queue_id,struct rte_eth_rxq_info *qinfo); void ice_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
drivers/net/igc/igc_txrx.c +2 -3
@@ -722,8 +722,7 @@ void eth_igc_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid)igc_rx_queue_release (dev->data->rx_queues[qid]); } -uint32_t eth_igc_rx_queue_count (struct rte_eth_dev *dev, -uint16_t rx_queue_id) +uint32_t eth_igc_rx_queue_count (void *rx_queue) {/** * Check the DD bit of a rx descriptor of each 4 in a group,
@@ -736,7 +735,7 @@ uint32_t eth_igc_rx_queue_count(struct rte_eth_dev *dev,struct igc_rx_queue *rxq;uint16_t desc =0 ; - rxq = dev->data->rx_queues[rx_queue_id]; + rxq = rx_queue; rxdp = &rxq->rx_ring[rxq->rx_tail];while (desc < rxq->nb_rx_desc - rxq->rx_tail) {
drivers/net/igc/igc_txrx.h +1 -2
@@ -22,8 +22,7 @@ int eth_igc_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mb_pool); -uint32_t eth_igc_rx_queue_count (struct rte_eth_dev *dev, -uint16_t rx_queue_id); +uint32_t eth_igc_rx_queue_count (void *rx_queue);int eth_igc_rx_descriptor_status (void *rx_queue,uint16_t offset);
drivers/net/ixgbe/ixgbe_ethdev.h +1 -2
@@ -594,8 +594,7 @@ int ixgbe_dev_tx_queue_setup(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); -uint32_t ixgbe_dev_rx_queue_count (struct rte_eth_dev *dev, -uint16_t rx_queue_id); +uint32_t ixgbe_dev_rx_queue_count (void *rx_queue);int ixgbe_dev_rx_descriptor_status (void *rx_queue,uint16_t offset);int ixgbe_dev_tx_descriptor_status (void *tx_queue,uint16_t offset);
drivers/net/ixgbe/ixgbe_rxtx.c +2 -2
@@ -3262,14 +3262,14 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev, }uint32_t -ixgbe_dev_rx_queue_count (struct rte_eth_dev *dev,uint16_t rx_queue_id) +ixgbe_dev_rx_queue_count (void *rx_queue) {#define IXGBE_RXQ_SCAN_INTERVAL 4volatile union ixgbe_adv_rx_desc *rxdp;struct ixgbe_rx_queue *rxq;uint32_t desc =0 ; - rxq = dev->data->rx_queues[rx_queue_id]; + rxq = rx_queue; rxdp = &(rxq->rx_ring[rxq->rx_tail]); while ((desc < rxq->nb_rx_desc) &&
drivers/net/mlx5/mlx5_rx.c +13 -13
@@ -240,32 +240,32 @@ mlx5_rx_burst_mode_get(struct rte_eth_dev *dev,/** * DPDK callback to get the number of used descriptors in a RX queue. * -* @param dev -* Pointer to the device structure. -* -* @param rx_queue_id -* The Rx queue. +* @param rx_queue +* The Rx queue pointer. * * @return * The number of used rx descriptor. * -EINVAL if the queue is invalid */ uint32_t -mlx5_rx_queue_count (struct rte_eth_dev *dev,uint16_t rx_queue_id) +mlx5_rx_queue_count (void *rx_queue) { -struct mlx5_priv *priv = dev->data->dev_private; -struct mlx5_rxq_data *rxq; +struct mlx5_rxq_data *rxq = rx_queue; +struct rte_eth_dev *dev; + +if (!rxq) { + rte_errno =EINVAL ; +return -rte_errno; + } + + dev = &rte_eth_devices[rxq->port_id];if (dev->rx_pkt_burst ==NULL || dev->rx_pkt_burst == removed_rx_burst) { rte_errno =ENOTSUP ;return -rte_errno; } - rxq = (*priv->rxqs)[rx_queue_id]; -if (!rxq) { - rte_errno =EINVAL ; -return -rte_errno; - } +return rx_queue_count (rxq); }
drivers/net/mlx5/mlx5_rx.h +1 -1
@@ -260,7 +260,7 @@ uint16_t mlx5_rx_burst_mprq(void *dpdk_rxq, struct rte_mbuf **pkts,uint16_t removed_rx_burst (void *dpdk_rxq,struct rte_mbuf **pkts,uint16_t pkts_n);int mlx5_rx_descriptor_status (void *rx_queue,uint16_t offset); -uint32_t mlx5_rx_queue_count (struct rte_eth_dev *dev,uint16_t rx_queue_id); +uint32_t mlx5_rx_queue_count (void *rx_queue);void mlx5_rxq_info_get (struct rte_eth_dev *dev,uint16_t queue_id,struct rte_eth_rxq_info *qinfo); int mlx5_rx_burst_mode_get(struct rte_eth_dev *dev, uint16_t rx_queue_id,
drivers/net/netvsc/hn_rxtx.c +2 -2
@@ -1018,9 +1018,9 @@ hn_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid)* For this device that means how many packets are pending in the ring. */ uint32_t -hn_dev_rx_queue_count (struct rte_eth_dev *dev,uint16_t queue_id) +hn_dev_rx_queue_count (void *rx_queue) { -struct hn_rx_queue *rxq = dev->data->rx_queues[queue_id]; +struct hn_rx_queue *rxq = rx_queue;return rte_ring_count (rxq->rx_ring); }
drivers/net/netvsc/hn_var.h +1 -1
@@ -215,7 +215,7 @@ int hn_dev_rx_queue_setup(struct rte_eth_dev *dev,void hn_dev_rx_queue_info (struct rte_eth_dev *dev,uint16_t queue_id,struct rte_eth_rxq_info *qinfo);void hn_dev_rx_queue_release (struct rte_eth_dev *dev,uint16_t qid); -uint32_t hn_dev_rx_queue_count (struct rte_eth_dev *dev,uint16_t queue_id); +uint32_t hn_dev_rx_queue_count (void *rx_queue);int hn_dev_rx_queue_status (void *rxq,uint16_t offset);void hn_dev_free_queues (struct rte_eth_dev *dev);
drivers/net/nfp/nfp_rxtx.c +2 -2
@@ -97,14 +97,14 @@ nfp_net_rx_freelist_setup(struct rte_eth_dev *dev) }uint32_t -nfp_net_rx_queue_count (struct rte_eth_dev *dev,uint16_t queue_idx) +nfp_net_rx_queue_count (void *rx_queue) {struct nfp_net_rxq *rxq;struct nfp_net_rx_desc *rxds;uint32_t idx;uint32_t count; - rxq = (struct nfp_net_rxq *)dev->data->rx_queues[queue_idx]; + rxq = rx_queue; idx = rxq->rd_p;
drivers/net/nfp/nfp_rxtx.h +1 -2
@@ -275,8 +275,7 @@ struct nfp_net_rxq { }__rte_aligned (64 );int nfp_net_rx_freelist_setup (struct rte_eth_dev *dev); -uint32_t nfp_net_rx_queue_count (struct rte_eth_dev *dev, -uint16_t queue_idx); +uint32_t nfp_net_rx_queue_count (void *rx_queue);uint16_t nfp_net_recv_pkts (void *rx_queue,struct rte_mbuf **rx_pkts,uint16_t nb_pkts);void nfp_net_rx_queue_release (struct rte_eth_dev *dev,uint16_t queue_idx);
drivers/net/octeontx2/otx2_ethdev.h +1 -1
@@ -431,7 +431,7 @@ int otx2_rx_burst_mode_get(struct rte_eth_dev *dev, uint16_t queue_id, struct rte_eth_burst_mode *mode);int otx2_tx_burst_mode_get (struct rte_eth_dev *dev,uint16_t queue_id,struct rte_eth_burst_mode *mode); -uint32_t otx2_nix_rx_queue_count (struct rte_eth_dev *eth_dev,uint16_t qidx); +uint32_t otx2_nix_rx_queue_count (void *rx_queue);int otx2_nix_tx_done_cleanup (void *txq,uint32_t free_cnt);int otx2_nix_rx_descriptor_status (void *rx_queue,uint16_t offset);int otx2_nix_tx_descriptor_status (void *tx_queue,uint16_t offset);
drivers/net/octeontx2/otx2_ethdev_ops.c +4 -4
@@ -342,13 +342,13 @@ nix_rx_head_tail_get(struct otx2_eth_dev *dev, }uint32_t -otx2_nix_rx_queue_count (struct rte_eth_dev *eth_dev,uint16_t queue_idx) +otx2_nix_rx_queue_count (void *rx_queue) { -struct otx2_eth_rxq *rxq = eth_dev->data->rx_queues[queue_idx]; -struct otx2_eth_dev *dev =otx2_eth_pmd_priv (eth_dev); +struct otx2_eth_rxq *rxq = rx_queue; +struct otx2_eth_dev *dev =otx2_eth_pmd_priv (rxq->eth_dev);uint32_t head, tail; -nix_rx_head_tail_get (dev, &head, &tail, queue_idx); +nix_rx_head_tail_get (dev, &head, &tail, rxq->rq);return (tail - head) % rxq->qlen; }
drivers/net/sfc/sfc_ethdev.c +6 -6
@@ -1356,19 +1356,19 @@ sfc_tx_queue_info_get(struct rte_eth_dev *dev, uint16_t ethdev_qid,* use any process-local pointers from the adapter data. */ static uint32_t -sfc_rx_queue_count (struct rte_eth_dev *dev,uint16_t ethdev_qid) +sfc_rx_queue_count (void *rx_queue) { -const struct sfc_adapter_priv *sap =sfc_adapter_priv_by_eth_dev (dev); -struct sfc_adapter_shared *sas =sfc_adapter_shared_by_eth_dev (dev); -sfc_ethdev_qid_t sfc_ethdev_qid = ethdev_qid; +struct sfc_dp_rxq *dp_rxq = rx_queue; +const struct sfc_dp_rx *dp_rx;struct sfc_rxq_info *rxq_info; - rxq_info =sfc_rxq_info_by_ethdev_qid (sas, sfc_ethdev_qid); + dp_rx =sfc_dp_rx_by_dp_rxq (dp_rxq); + rxq_info =sfc_rxq_info_by_dp_rxq (dp_rxq);if ((rxq_info->state &SFC_RXQ_STARTED ) ==0 )return 0 ; -return sap->dp_rx->qdesc_npending (rxq_info->dp); +return dp_rx->qdesc_npending (dp_rxq); }/*
drivers/net/thunderx/nicvf_ethdev.c +1 -2
@@ -1060,8 +1060,7 @@ nicvf_rx_queue_release_mbufs(struct rte_eth_dev *dev, struct nicvf_rxq *rxq)if (dev->rx_pkt_burst ==NULL )return ; -while ((rxq_cnt =nicvf_dev_rx_queue_count (dev, -nicvf_netdev_qidx (rxq->nic, rxq->queue_id)))) { +while ((rxq_cnt =nicvf_dev_rx_queue_count (rxq))) { nb_pkts = dev->rx_pkt_burst (rxq, rx_pkts,NICVF_MAX_RX_FREE_THRESH );PMD_DRV_LOG (INFO ,"nb_pkts=%d rxq_cnt=%d" , nb_pkts, rxq_cnt);
drivers/net/thunderx/nicvf_rxtx.c +2 -2
@@ -649,11 +649,11 @@ nicvf_recv_pkts_multiseg_cksum_vlan_strip(void *rx_queue, }uint32_t -nicvf_dev_rx_queue_count (struct rte_eth_dev *dev,uint16_t queue_idx) +nicvf_dev_rx_queue_count (void *rx_queue) {struct nicvf_rxq *rxq; - rxq = dev->data->rx_queues[queue_idx]; + rxq = rx_queue;return nicvf_addr_read (rxq->cq_status) &NICVF_CQ_CQE_COUNT_MASK ; }
drivers/net/thunderx/nicvf_rxtx.h +1 -1
@@ -83,7 +83,7 @@ nicvf_mbuff_init_mseg_update(struct rte_mbuf *pkt, const uint64_t mbuf_init, *(uint64_t *)(&pkt->rearm_data) = init.value; } -uint32_t nicvf_dev_rx_queue_count (struct rte_eth_dev *dev,uint16_t queue_idx); +uint32_t nicvf_dev_rx_queue_count (void *rx_queue);uint32_t nicvf_dev_rbdr_refill (struct rte_eth_dev *dev,uint16_t queue_idx); uint16_t nicvf_recv_pkts_no_offload(void *rxq, struct rte_mbuf **rx_pkts,
drivers/net/txgbe/txgbe_ethdev.h +1 -2
@@ -438,8 +438,7 @@ int txgbe_dev_tx_queue_setup(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); -uint32_t txgbe_dev_rx_queue_count (struct rte_eth_dev *dev, -uint16_t rx_queue_id); +uint32_t txgbe_dev_rx_queue_count (void *rx_queue);int txgbe_dev_rx_descriptor_status (void *rx_queue,uint16_t offset);int txgbe_dev_tx_descriptor_status (void *tx_queue,uint16_t offset);
drivers/net/txgbe/txgbe_rxtx.c +2 -2
@@ -2688,14 +2688,14 @@ txgbe_dev_rx_queue_setup(struct rte_eth_dev *dev, }uint32_t -txgbe_dev_rx_queue_count (struct rte_eth_dev *dev,uint16_t rx_queue_id) +txgbe_dev_rx_queue_count (void *rx_queue) {#define TXGBE_RXQ_SCAN_INTERVAL 4volatile struct txgbe_rx_desc *rxdp;struct txgbe_rx_queue *rxq;uint32_t desc =0 ; - rxq = dev->data->rx_queues[rx_queue_id]; + rxq = rx_queue; rxdp = &rxq->rx_ring[rxq->rx_tail]; while ((desc < rxq->nb_rx_desc) &&
drivers/net/vhost/rte_eth_vhost.c +2 -2
@@ -1375,11 +1375,11 @@ eth_link_update(struct rte_eth_dev *dev __rte_unused, }static uint32_t -eth_rx_queue_count (struct rte_eth_dev *dev,uint16_t rx_queue_id) +eth_rx_queue_count (void *rx_queue) {struct vhost_queue *vq; - vq = dev->data->rx_queues[rx_queue_id]; + vq = rx_queue;if (vq ==NULL )return 0 ;
lib/ethdev/rte_ethdev.h +1 -1
@@ -5040,7 +5040,7 @@ rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id) dev->data->rx_queues[queue_id] == NULL)return -EINVAL ; -return (int )(*dev->rx_queue_count)(dev, queue_id); +return (int )(*dev->rx_queue_count)(dev->data->rx_queues[queue_id]); }/**@{@name Rx hardware descriptor states
lib/ethdev/rte_ethdev_core.h +1 -2
@@ -41,8 +41,7 @@ typedef uint16_t (*eth_tx_prep_t)(void *txq,/**< @internal Prepare output packets on a transmit queue of an Ethernet device. */ -typedef uint32_t (*eth_rx_queue_count_t )(struct rte_eth_dev *dev, -uint16_t rx_queue_id); +typedef uint32_t (*eth_rx_queue_count_t )(void *rxq);/**< @internal Get number of used descriptors on a receive queue. */ typedef int (*eth_rx_descriptor_status_t )(void *rxq,uint16_t offset);
Signature · 1 line
2.26.3
PATCH v6 3/6 ethdev: copy fast-path API into separate structure
In reply to Konstantin AnanyevCopy public function pointers (rx_pkt_burst(), etc.) and related pointers to internal data from rte_eth_dev structure into a separate flat array. That array will remain in a public header. The intention here is to make rte_eth_dev and related structures internal. That should allow future possible changes to core eth_dev structures to be transparent to the user and help to avoid ABI/API breakages. The plan is to keep minimal part of data from rte_eth_dev public, so we still can use inline functions for fast-path calls
(like rte_eth_rx_burst(), etc.) to avoid/minimize slowdown. The whole idea beyond this new schema:
1. PMDs keep to setup fast-path function pointers and related data inside rte_eth_dev struct in the same way they did it before.
2. Inside rte_eth_dev_start() and inside rte_eth_dev_probing_finish() (for secondary process) we call eth_dev_fp_ops_setup, which copies these function and data pointers into rte_eth_fp_ops[port_id].
3. Inside rte_eth_dev_stop() and inside rte_eth_dev_release_port() we call eth_dev_fp_ops_reset(), which resets rte_eth_fp_ops[port_id] into some dummy values.
4. fast-path ethdev API (rte_eth_rx_burst(), etc.) will use that new flat array to call PMD specific functions.
That approach should allow us to make rte_eth_devices[] private without introducing regression and help to avoid changes in drivers code.
--- lib/ethdev/ethdev_private.c | 52 +++++++++++++++++++++++++++++++ lib/ethdev/ethdev_private.h | 7 +++++ lib/ethdev/rte_ethdev.c | 27 +++++++++++++++++ lib/ethdev/rte_ethdev_core.h | 59 ++++++++++++++++++++++++++++++++++++ 4 files changed, 145 insertions(+)
lib/ethdev/ethdev_private.c +52 -0
@@ -174,3 +174,55 @@ rte_eth_devargs_parse_representor_ports(char *str, void *data)RTE_LOG (ERR ,EAL ,"wrong representor format: %s\n" , str);return str ==NULL ?-1 :0 ; } + +static uint16_t +dummy_eth_rx_burst(__rte_unused void *rxq, + __rte_unused struct rte_mbuf **rx_pkts, + __rte_unused uint16_t nb_pkts) +{ +RTE_ETHDEV_LOG (ERR ,"rx_pkt_burst for not ready port\n" ); + rte_errno =ENOTSUP ; +return 0 ; +} + +static uint16_t +dummy_eth_tx_burst(__rte_unused void *txq, + __rte_unused struct rte_mbuf **tx_pkts, + __rte_unused uint16_t nb_pkts) +{ +RTE_ETHDEV_LOG (ERR ,"tx_pkt_burst for not ready port\n" ); + rte_errno =ENOTSUP ; +return 0 ; +} + +void +eth_dev_fp_ops_reset (struct rte_eth_fp_ops *fpo) +{ +static void *dummy_data[RTE_MAX_QUEUES_PER_PORT ]; +static const struct rte_eth_fp_ops dummy_ops = { + .rx_pkt_burst = dummy_eth_rx_burst, + .tx_pkt_burst = dummy_eth_tx_burst, + .rxq = {.data = dummy_data, .clbk = dummy_data,}, + .txq = {.data = dummy_data, .clbk = dummy_data,}, + }; + + *fpo = dummy_ops; +} + +void +eth_dev_fp_ops_setup (struct rte_eth_fp_ops *fpo, +const struct rte_eth_dev *dev) +{ + fpo->rx_pkt_burst = dev->rx_pkt_burst; + fpo->tx_pkt_burst = dev->tx_pkt_burst; + fpo->tx_pkt_prepare = dev->tx_pkt_prepare; + fpo->rx_queue_count = dev->rx_queue_count; + fpo->rx_descriptor_status = dev->rx_descriptor_status; + fpo->tx_descriptor_status = dev->tx_descriptor_status; + + fpo->rxq.data = dev->data->rx_queues; + fpo->rxq.clbk = (void **)(uintptr_t )dev->post_rx_burst_cbs; + + fpo->txq.data = dev->data->tx_queues; + fpo->txq.clbk = (void **)(uintptr_t )dev->pre_tx_burst_cbs; +}
lib/ethdev/ethdev_private.h +7 -0
@@ -26,4 +26,11 @@ eth_find_device(const struct rte_eth_dev *_start, rte_eth_cmp_t cmp,/* Parse devargs value for representor parameter. */ int rte_eth_devargs_parse_representor_ports (char *str,void *data); +/* reset eth fast-path API to dummy values */ +void eth_dev_fp_ops_reset (struct rte_eth_fp_ops *fpo); + +/* setup eth fast-path API to ethdev values */ +void eth_dev_fp_ops_setup (struct rte_eth_fp_ops *fpo, +const struct rte_eth_dev *dev); +#endif /* _ETH_PRIVATE_H_ */
lib/ethdev/rte_ethdev.c +27 -0
@@ -44,6 +44,9 @@static const char *MZ_RTE_ETH_DEV_DATA ="rte_eth_dev_data" ;struct rte_eth_dev rte_eth_devices[RTE_MAX_ETHPORTS ]; +/* public fast-path API */ +struct rte_eth_fp_ops rte_eth_fp_ops[RTE_MAX_ETHPORTS ]; +/* spinlock for eth device callbacks */ static rte_spinlock_t eth_dev_cb_lock =RTE_SPINLOCK_INITIALIZER ;
@@ -579,6 +582,8 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev)rte_eth_dev_callback_process (eth_dev,RTE_ETH_EVENT_DESTROY ,NULL ); +eth_dev_fp_ops_reset (rte_eth_fp_ops + eth_dev->data->port_id); +rte_spinlock_lock (ð_dev_shared_data->ownership_lock); eth_dev->state =RTE_ETH_DEV_UNUSED ;
@@ -1792,6 +1797,9 @@ rte_eth_dev_start(uint16_t port_id) (*dev->dev_ops->link_update)(dev,0 ); } +/* expose selection of PMD fast-path functions */ +eth_dev_fp_ops_setup (rte_eth_fp_ops + port_id, dev); +rte_ethdev_trace_start (port_id);return 0 ; }
@@ -1814,6 +1822,9 @@ rte_eth_dev_stop(uint16_t port_id)return 0 ; } +/* point fast-path functions to dummy ones */ +eth_dev_fp_ops_reset (rte_eth_fp_ops + port_id); + dev->data->dev_started =0 ; ret = (*dev->dev_ops->dev_stop)(dev);rte_ethdev_trace_stop (port_id, ret);
@@ -4477,6 +4488,14 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, queue_idx, tx_rate)); } +RTE_INIT (eth_dev_init_fp_ops) +{ +uint32_t i; + +for (i =0 ; i !=RTE_DIM (rte_eth_fp_ops); i++) +eth_dev_fp_ops_reset (rte_eth_fp_ops + i); +} +RTE_INIT (eth_dev_init_cb_lists) {uint16_t i;
@@ -4645,6 +4664,14 @@ rte_eth_dev_probing_finish(struct rte_eth_dev *dev)if (dev ==NULL )return ; +/* +* for secondary process, at that point we expect device +* to be already 'usable', so shared data and all function pointers +* for fast-path devops have to be setup properly inside rte_eth_dev. +*/ +if (rte_eal_process_type () ==RTE_PROC_SECONDARY ) +eth_dev_fp_ops_setup (rte_eth_fp_ops + dev->data->port_id, dev); +rte_eth_dev_callback_process (dev,RTE_ETH_EVENT_NEW ,NULL ); dev->state =RTE_ETH_DEV_ATTACHED ;
lib/ethdev/rte_ethdev_core.h +59 -0
65 lines not on this page · raw message
Signature · 1 line
2.26.3
Re: [dpdk-dev] [PATCH v6 3/6] ethdev: copy fast-path API into separate structure
Quoted 23 lines · Konstantin Ananyev
Copy public function pointers (
rx_pkt_burst(), etc.) and related pointers to internal data fromrte_eth_devstructure into a separate flat array. That array will remain in a public header. The intention here is to makerte_eth_devand related structures internal. That should allow future possible changes to coreeth_devstructures to be transparent to the user and help to avoid ABI/API breakages. The plan is to keep minimal part of data fromrte_eth_devpublic, so we still can use inline functions for fast-path calls
(likerte_eth_rx_burst(), etc.) to avoid/minimize slowdown. The whole idea beyond this new schema:
1. PMDs keep to setup fast-path function pointers and related data insiderte_eth_devstruct in the same way they did it before.
2. Insiderte_eth_dev_start()and insiderte_eth_dev_probing_finish()(for secondary process) we calleth_dev_fp_ops_setup, which copies these function and data pointers into rte_eth_fp_ops[port_id].
3. Insiderte_eth_dev_stop()and insiderte_eth_dev_release_port()we calleth_dev_fp_ops_reset(), which resets rte_eth_fp_ops[port_id] into some dummy values.
4. fast-path ethdev API (rte_eth_rx_burst(), etc.) will use that new flat array to call PMD specific functions.
That approach should allow us to make rte_eth_devices[] private without introducing regression and help to avoid changes in drivers code.
Quoted 1 line
Signed-off-by Konstantin Ananyev <[email protected]>
PATCH v6 4/6 ethdev: make fast-path functions to use new flat array
In reply to Konstantin AnanyevRework fast-path ethdev functions to use rte_eth_fp_ops[]. While it is an API/ABI breakage, this change is intended to be transparent for both users (no changes in user app is required) and PMD developers (no changes in PMD is required).
One extra thing to note - RX/TX callback invocation will cause extra function call with these changes. That might cause some insignificant slowdown for code-path where RX/TX callbacks are heavily involved.
--- lib/ethdev/ethdev_private.c | 31 +++++ lib/ethdev/rte_ethdev.h | 270 +++++++++++++++++++++++++----------- lib/ethdev/version.map | 3 + 3 files changed, 226 insertions(+), 78 deletions(-)
lib/ethdev/ethdev_private.c +31 -0
@@ -226,3 +226,34 @@ eth_dev_fp_ops_setup(struct rte_eth_fp_ops *fpo, fpo->txq.data = dev->data->tx_queues; fpo->txq.clbk = (void **)(uintptr_t )dev->pre_tx_burst_cbs; } + +uint16_t +rte_eth_call_rx_callbacks (uint16_t port_id,uint16_t queue_id, +struct rte_mbuf **rx_pkts,uint16_t nb_rx,uint16_t nb_pkts, +void *opaque) +{ +const struct rte_eth_rxtx_callback *cb = opaque; + +while (cb !=NULL ) { + nb_rx = cb->fn.rx (port_id, queue_id, rx_pkts, nb_rx, + nb_pkts, cb->param); + cb = cb->next; + } + +return nb_rx; +} + +uint16_t +rte_eth_call_tx_callbacks (uint16_t port_id,uint16_t queue_id, +struct rte_mbuf **tx_pkts,uint16_t nb_pkts,void *opaque) +{ +const struct rte_eth_rxtx_callback *cb = opaque; + +while (cb !=NULL ) { + nb_pkts = cb->fn.tx (port_id, queue_id, tx_pkts, nb_pkts, + cb->param); + cb = cb->next; + } + +return nb_pkts; +}
lib/ethdev/rte_ethdev.h +192 -78
370 lines not on this page · raw message
lib/ethdev/version.map +3 -0
@@ -7,6 +7,8 @@ DPDK_22 { rte_eth_allmulticast_disable; rte_eth_allmulticast_enable; rte_eth_allmulticast_get; + rte_eth_call_rx_callbacks; + rte_eth_call_tx_callbacks; rte_eth_dev_adjust_nb_rx_tx_desc; rte_eth_dev_callback_register; rte_eth_dev_callback_unregister;
@@ -76,6 +78,7 @@ DPDK_22 { rte_eth_find_next_of; rte_eth_find_next_owned_by; rte_eth_find_next_sibling; + rte_eth_fp_ops; rte_eth_iterator_cleanup; rte_eth_iterator_init; rte_eth_iterator_next;
Signature · 1 line
2.26.3
PATCH v6 5/6 ethdev: add API to retrieve multiple ethernet addresses
In reply to Konstantin AnanyevIntroduce rte_eth_macaddrs_get() to allow user to retrieve all ethernet addresses assigned to given port.
Change testpmd to use this new function and avoid referencing directly rte_eth_devices[].
--- app/test-pmd/config.c | 23 +++++++++++------------ doc/guides/rel_notes/release_21_11.rst | 5 +++++ lib/ethdev/rte_ethdev.c | 25 +++++++++++++++++++++++++ lib/ethdev/rte_ethdev.h | 21 +++++++++++++++++++++ lib/ethdev/version.map | 1 + 5 files changed, 63 insertions(+), 12 deletions(-)
app/test-pmd/config.c +11 -12
@@ -5215,20 +5215,20 @@ show_macs(portid_t port_id) {char buf[RTE_ETHER_ADDR_FMT_SIZE ];struct rte_eth_dev_info dev_info; -struct rte_ether_addr *addr; -uint32_t i, num_macs =0 ; -struct rte_eth_dev *dev; - - dev = &rte_eth_devices[port_id]; +int32_t i, rc, num_macs =0 ;if (eth_dev_info_get_print_err (port_id, &dev_info))return ; -for (i =0 ; i < dev_info.max_mac_addrs; i++) { - addr = &dev->data->mac_addrs[i]; +struct rte_ether_addr addr[dev_info.max_mac_addrs]; + rc =rte_eth_macaddrs_get (port_id, addr, dev_info.max_mac_addrs); +if (rc <0 ) +return ; + +for (i =0 ; i < rc; i++) {/* skip zero address */ -if (rte_is_zero_ether_addr (addr)) +if (rte_is_zero_ether_addr (&addr[i]))continue ; num_macs++;
@@ -5236,14 +5236,13 @@ show_macs(portid_t port_id)printf ("Number of MAC address added: %d\n" , num_macs); -for (i =0 ; i < dev_info.max_mac_addrs; i++) { - addr = &dev->data->mac_addrs[i]; +for (i =0 ; i < rc; i++) {/* skip zero address */ -if (rte_is_zero_ether_addr (addr)) +if (rte_is_zero_ether_addr (&addr[i]))continue ; -rte_ether_format_addr (buf,RTE_ETHER_ADDR_FMT_SIZE , addr); +rte_ether_format_addr (buf,RTE_ETHER_ADDR_FMT_SIZE , &addr[i]);printf (" %s\n" , buf); } }
doc/guides/rel_notes/release_21_11.rst +5 -0
@@ -177,6 +177,11 @@ New Features * Added tests to verify tunnel header verification in IPsec inbound. * Added tests to verify inner checksum. +* **Add new function into ethdev lib.** + + * Added ``rte_eth_macaddrs_get`` to allow user to retrieve all Ethernet + addresses assigned to given ethernet port. + Removed Items -------------
lib/ethdev/rte_ethdev.c +25 -0
@@ -3544,6 +3544,31 @@ rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask,return ret; } +int +rte_eth_macaddrs_get (uint16_t port_id,struct rte_ether_addr *ma, +unsigned int num) +{ +int32_t ret; +struct rte_eth_dev *dev; +struct rte_eth_dev_info dev_info; + +if (ma ==NULL ) { +RTE_ETHDEV_LOG (ERR ,"%s: invalid parameters\n" , __func__); +return -EINVAL ; + } + +/* will check for us that port_id is a valid one */ + ret =rte_eth_dev_info_get (port_id, &dev_info); +if (ret !=0 ) +return ret; + + dev = &rte_eth_devices[port_id]; + num =RTE_MIN (dev_info.max_mac_addrs, num); +memcpy (ma, dev->data->mac_addrs, num *sizeof (ma[0 ])); + +return num; +} +int rte_eth_macaddr_get (uint16_t port_id,struct rte_ether_addr *mac_addr) {
lib/ethdev/rte_ethdev.h +21 -0
@@ -3007,6 +3007,27 @@ int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id,*/ int rte_eth_macaddr_get (uint16_t port_id,struct rte_ether_addr *mac_addr); +/** +* Retrieve the Ethernet addresses of an Ethernet device. +* +* @param port_id +* The port identifier of the Ethernet device. +* @param ma +* A pointer to an array of structures of type *ether_addr* to be filled with +* the Ethernet addresses of the Ethernet device. +* @param num +* Number of elements in the @p ma array. +* Note that rte_eth_dev_info::max_mac_addrs can be used to retrieve +* max number of Ethernet addresses for given port. +* @return +* - number of retrieved addresses if successful +* - (-ENODEV) if *port_id* invalid. +* - (-EINVAL) if bad parameter. +*/ +__rte_experimental +int rte_eth_macaddrs_get(uint16_t port_id, struct rte_ether_addr *ma, +unsigned int num); +/** * Retrieve the contextual information of an Ethernet device. *
lib/ethdev/version.map +1 -0
@@ -250,6 +250,7 @@ EXPERIMENTAL { rte_mtr_meter_policy_validate; # added in 21.11 + rte_eth_macaddrs_get; rte_eth_rx_metadata_negotiate; };
Signature · 1 line
2.26.3
Re: [dpdk-dev] [PATCH v6 5/6] ethdev: add API to retrieve multiple ethernet addresses
Quoted 1 line · Konstantin Ananyev
Introduce
rte_eth_macaddrs_get()to allow user to retrieve all ethernet
ethernet -> Ethernet
Quoted 5 lines
addresses assigned to given port.
Change testpmd to use this new function and avoid referencing directly rte_eth_devices[].Signed-off-by Konstantin Ananyev <[email protected]>
except one nit below
[snip]
lib/ethdev/rte_ethdev.h int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, · line 3010
Quoted 9 lines
lib/ethdev/rte_ethdev.h +1
-0@@ -3007,6 +3007,27 @@ int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id,*/ int rte_eth_macaddr_get (uint16_t port_id,struct rte_ether_addr *mac_addr); +/**
Experimental header is missing
Quoted 23 lines
lib/ethdev/rte_ethdev.h +20
-0+* Retrieve the Ethernet addresses of an Ethernet device. +* +* @param port_id +* The port identifier of the Ethernet device. +* @param ma +* A pointer to an array of structures of type *ether_addr* to be filled with +* the Ethernet addresses of the Ethernet device. +* @param num +* Number of elements in the @p ma array. +* Note that rte_eth_dev_info::max_mac_addrs can be used to retrieve +* max number of Ethernet addresses for given port. +* @return +* - number of retrieved addresses if successful +* - (-ENODEV) if *port_id* invalid. +* - (-EINVAL) if bad parameter. +*/ +__rte_experimental +int rte_eth_macaddrs_get(uint16_t port_id, struct rte_ether_addr *ma, +unsigned int num); +/** * Retrieve the contextual information of an Ethernet device. *
[snip]
Re: [dpdk-dev] [PATCH v6 5/6] ethdev: add API to retrieve multiple ethernet addresses
Quoted 25 lines · Andrew Rybchenko
Quoted 1 line · Konstantin Ananyev
Introduce
rte_eth_macaddrs_get()to allow user to retrieve all ethernetethernet -> Ethernet
Quoted 5 lines
addresses assigned to given port.
Change testpmd to use this new function and avoid referencing directly rte_eth_devices[].Signed-off-by Konstantin Ananyev <[email protected]>Reviewed-by Andrew Rybchenko <[email protected]>except one nit below
[snip]
Quoted 8 lines
lib/ethdev/rte_ethdev.h +0
-0@@ -3007,6 +3007,27 @@ int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id,*/ int rte_eth_macaddr_get (uint16_t port_id,struct rte_ether_addr *mac_addr);
Quoted 4 lines
lib/ethdev/rte_ethdev.h int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, · line 3010
Quoted 1 line
lib/ethdev/rte_ethdev.h +1
-0+/** Experimental header is missing
I can add while merging to next-net.
Quoted 26 lines
Quoted 23 lines
lib/ethdev/rte_ethdev.h +20
-0+* Retrieve the Ethernet addresses of an Ethernet device. +* +* @param port_id +* The port identifier of the Ethernet device. +* @param ma +* A pointer to an array of structures of type *ether_addr* to be filled with +* the Ethernet addresses of the Ethernet device. +* @param num +* Number of elements in the @p ma array. +* Note that rte_eth_dev_info::max_mac_addrs can be used to retrieve +* max number of Ethernet addresses for given port. +* @return +* - number of retrieved addresses if successful +* - (-ENODEV) if *port_id* invalid. +* - (-EINVAL) if bad parameter. +*/ +__rte_experimental +int rte_eth_macaddrs_get(uint16_t port_id, struct rte_ether_addr *ma, +unsigned int num); +/** * Retrieve the contextual information of an Ethernet device. * [snip]
PATCH v6 6/6 ethdev: hide eth dev related structures
In reply to Konstantin AnanyevMove rte_eth_dev, rte_eth_dev_data, rte_eth_rxtx_callback and related data into private header (ethdev_driver.h).
Few minor changes to keep DPDK building after that.
--- doc/guides/rel_notes/release_21_11.rst | 6 + drivers/common/octeontx2/otx2_sec_idev.c | 2 +- drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 2 +- drivers/net/cxgbe/base/adapter.h | 2 +- drivers/net/dpaa2/dpaa2_ptp.c | 2 +- drivers/net/netvsc/hn_var.h | 1 + lib/ethdev/ethdev_driver.h | 154 ++++++++++++++++++ lib/ethdev/rte_ethdev_core.h | 149 ----------------- lib/ethdev/version.map | 2 +- lib/eventdev/rte_event_eth_rx_adapter.c | 2 +- lib/eventdev/rte_event_eth_tx_adapter.c | 2 +- lib/eventdev/rte_eventdev.c | 2 +- lib/metrics/rte_metrics_telemetry.c | 2 +- 13 files changed, 170 insertions(+), 158 deletions(-)
doc/guides/rel_notes/release_21_11.rst +6 -0
@@ -310,6 +310,12 @@ ABI Changes to user, it still counts as an ABI change, as ``eth_rx_queue_count_t`` is used by public inline function ``rte_eth_rx_queue_count``. +* ethdev: Made ``rte_eth_dev``, ``rte_eth_dev_data``, ``rte_eth_rxtx_callback`` + private data structures. ``rte_eth_devices[]`` can't be accessed directly + by user any more. While it is an ABI breakage, this change is intended + to be transparent for both users (no changes in user app is required) and + PMD developers (no changes in PMD is required). + Known Issues ------------
drivers/common/octeontx2/otx2_sec_idev.c +1 -1
@@ -4,7 +4,7 @@#include <rte_atomic.h> #include <rte_bus_pci.h> -#include <rte_ethdev.h> +#include <ethdev_driver.h> #include <rte_spinlock.h> #include "otx2_common.h"
drivers/crypto/octeontx2/otx2_cryptodev_ops.c +1 -1
@@ -6,7 +6,7 @@#include <cryptodev_pmd.h> #include <rte_errno.h> -#include <rte_ethdev.h> +#include <ethdev_driver.h> #include <rte_event_crypto_adapter.h> #include "otx2_cryptodev.h"
drivers/net/cxgbe/base/adapter.h +1 -1
@@ -12,7 +12,7 @@#include <rte_mbuf.h> #include <rte_io.h> #include <rte_rwlock.h> -#include <rte_ethdev.h> +#include <ethdev_driver.h> #include "../cxgbe_compat.h" #include "../cxgbe_ofld.h"
drivers/net/dpaa2/dpaa2_ptp.c +1 -1
@@ -10,7 +10,7 @@#include <unistd.h> #include <stdarg.h> -#include <rte_ethdev.h> +#include <ethdev_driver.h> #include <rte_log.h> #include <rte_eth_ctrl.h> #include <rte_malloc.h>
drivers/net/netvsc/hn_var.h +1 -0
@@ -7,6 +7,7 @@*/ #include <rte_eal_paging.h> +#include <ethdev_driver.h> /* * Tunable ethdev params
lib/ethdev/ethdev_driver.h +154 -0
160 lines not on this page · raw message
lib/ethdev/rte_ethdev_core.h +0 -149
153 lines not on this page · raw message
lib/ethdev/version.map +1 -1
@@ -73,7 +73,6 @@ DPDK_22 { rte_eth_dev_udp_tunnel_port_add; rte_eth_dev_udp_tunnel_port_delete; rte_eth_dev_vlan_filter; - rte_eth_devices; rte_eth_find_next; rte_eth_find_next_of; rte_eth_find_next_owned_by;
@@ -269,6 +268,7 @@ INTERNAL { rte_eth_dev_release_port; rte_eth_dev_internal_reset; rte_eth_devargs_parse; + rte_eth_devices; rte_eth_dma_zone_free; rte_eth_dma_zone_reserve; rte_eth_hairpin_queue_peer_bind;
lib/eventdev/rte_event_eth_rx_adapter.c +1 -1
@@ -11,7 +11,7 @@#include <rte_common.h> #include <rte_dev.h> #include <rte_errno.h> -#include <rte_ethdev.h> +#include <ethdev_driver.h> #include <rte_log.h> #include <rte_malloc.h> #include <rte_service_component.h>
lib/eventdev/rte_event_eth_tx_adapter.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_spinlock.h> #include <rte_service_component.h> -#include <rte_ethdev.h> +#include <ethdev_driver.h> #include "eventdev_pmd.h" #include "rte_eventdev_trace.h"
lib/eventdev/rte_eventdev.c +1 -1
@@ -29,7 +29,7 @@#include <rte_common.h> #include <rte_malloc.h> #include <rte_errno.h> -#include <rte_ethdev.h> +#include <ethdev_driver.h> #include <rte_cryptodev.h> #include <cryptodev_pmd.h> #include <rte_telemetry.h>
lib/metrics/rte_metrics_telemetry.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2020 Intel Corporation */ -#include <rte_ethdev.h> +#include <ethdev_driver.h> #include <rte_string_fns.h> #ifdef RTE_LIB_TELEMETRY #include <telemetry_internal.h>
Signature · 1 line
2.26.3
Re: [dpdk-dev] [PATCH v6 6/6] ethdev: hide eth dev related structures
Quoted 5 lines · Konstantin Ananyev
Move
rte_eth_dev,rte_eth_dev_data,rte_eth_rxtx_callbackand related data into private header (ethdev_driver.h).
Few minor changes to keep DPDK building after that.Signed-off-by Konstantin Ananyev <[email protected]>
I'll do structures documenation cleanup when pathes are in.
Quoted 84 lines · Konstantin Ananyev
v6 changes:
- Update comments (Andrew)
- Move callback related variables under corresponding ifdefs (Andrew)
- Few nits inrte_eth_macaddrs_get(Andrew)
- Rebased on top of next-net treev5 changes:
- Fix spelling (Thomas/David)
- Rename internal helper functions (David)
- Reorder patches and update commit messages (Thomas)
- Update comments (Thomas)
- Changed layout inrte_eth_fp_ops, to group functions and related data based on their functionality:
first 64B line for Rx, second one for Tx.
Didn't observe any real performance difference comparing to original layout. Though decided to keep a new one, as it seems a bit more plausible.v4 changes:
- Fix secondary process attach (Pavan)
- Fix build failure (Ferruh)
- Updatelib/ethdev/verion.map(Ferruh)
Note that moving newly added symbols from EXPERIMENTAL toDPDK_22section makescheckpatch.shto complain.v3 changes:
- Changes in public struct naming (Jerin/Haiyue)
- Split patches
- Update docs
- Shamelessly included Andrew's patch:
https://patches.dpdk.org/project/dpdk/patch/[email protected]/
into these series.
I have to do similar thing here, so decided to avoid duplicated effort.The aim of these patch series is to make
rte_ethdevcore data structures (rte_eth_dev,rte_eth_dev_data,rte_eth_rxtx_callback, etc.) internal to DPDK and not visible to the user.
That should allow future possible changes to core ethdev related structures to be transparent to the user and help to improve ABI/API stability. Note that current ethdev API is preserved, but it is a formal ABI break.The work is based on previous discussions at:
https://www.mail-archive.com/[email protected]/msg211405.html
https://www.mail-archive.com/[email protected]/msg216685.html
and consists of the following main points:
1. Copy public 'fast' function pointers (rx_pkt_burst(), etc.) and related data pointer fromrte_eth_devinto a separate flat array. We keep it public to still be able to use inline functions for these 'fast' calls (likerte_eth_rx_burst(), etc.) to avoid/minimize slowdown. Note that apart from function pointers itself, each element of this flat array also contains two opaque pointers for each ethdev:
1) a pointer to an array of internal queue data pointers
2) points to array of queue callback data pointers.
Note that exposing this extra information allows us to avoid extra changes inside PMD level, plus should help to avoid possible performance degradation.
2. Change implementation of 'fast' inline ethdev functions (rte_eth_rx_burst(), etc.) to use new public flat array. While it is an ABI breakage, this change is intended to be transparent for both users (no changes in user app is required) and PMD developers (no changes in PMD is required).
One extra note - with new implementation RX/TX callback invocation will cost one extra function call with this changes. That might cause some slowdown for code-path with RX/TX callbacks heavily involved. Hope such trade-off is acceptable for the community.
3. Moverte_eth_dev,rte_eth_dev_data,rte_eth_rxtx_callbackand related things into internal header: <ethdev_driver.h>.That approach was selected to:
- Avoid(/minimize) possible performance losses.
- Minimize required changes inside PMDs.Performance testing results (ICX 2.0GHz, E810 (ice)):
- testpmd macswap fwd mode, plus
a) no RX/TX callbacks:
no actual slowdown observed
b) bpf-load rx 0 0 JM./dpdk.org/examples/bpf/t3.o:
~2% slowdown
- l3fwd: no actual slowdown observedWould like to thank everyone who already reviewed and tested previous versions of these series. All other interested parties please don't be shy and provide your feedback.
Quoted 8 lines
Konstantin Ananyev (6):
ethdev: allocate max space for internal queue array
ethdev: change input parameters forrx_queue_count
ethdev: copy fast-path API into separate structure
ethdev: make fast-path functions to use new flat array
ethdev: add API to retrieve multiple ethernet addresses
ethdev: hide eth dev related structures
For series,
No performance regression detected on my testing.
I am merging the series to next-net now which helps testing, but before merging to main repo it will be good to get more ack and test results (I can squash new tags later).
@Jerin, @Ajit, @Raslan, @Andrew, @Qi, @Honnappa, Can you please test this set for any possible regression?
Series applied to dpdk-next-net/main, thanks.
Feifei Wang
Tested-byQuoted 132 lines
-----邮件原件-----
发件人: dev <[email protected]> 代表 Ferruh Yigit
发送时间: Thursday, October 14, 2021 4:16 AM
收件人: Konstantin Ananyev <[email protected]>; [email protected]; [email protected]; Ajit Khaparde ([email protected]) <[email protected]>; Raslan Darawsheh <[email protected]>; Andrew Rybchenko <[email protected]>; Qi Zhang <[email protected]>; Honnappa Nagarahalli <[email protected]>
抄送: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Ajit Khaparde ([email protected]) <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected] 主题: Re: [dpdk-dev] [PATCH v6 0/6] hide eth dev related structuresQuoted 25 lines · Konstantin Ananyev
v6 changes:
- Update comments (Andrew)
- Move callback related variables under corresponding ifdefs (Andrew)
- Few nits inrte_eth_macaddrs_get(Andrew)
- Rebased on top of next-net treev5 changes:
- Fix spelling (Thomas/David)
- Rename internal helper functions (David)
- Reorder patches and update commit messages (Thomas)
- Update comments (Thomas)
- Changed layout inrte_eth_fp_ops, to group functions and related data based on their functionality:
first 64B line for Rx, second one for Tx.
Didn't observe any real performance difference comparing to original layout. Though decided to keep a new one, as it seems a bit more plausible.v4 changes:
- Fix secondary process attach (Pavan)
- Fix build failure (Ferruh)
- Updatelib/ethdev/verion.map(Ferruh)
Note that moving newly added symbols from EXPERIMENTAL toDPDK_22section makescheckpatch.shto complain.Quoted 6 lines
v3 changes:
- Changes in public struct naming (Jerin/Haiyue)
- Split patches
- Update docs
- Shamelessly included Andrew's patch:https://patches.dpdk.org/project/dpdk/patch/20210928154856.1015020-1-
[email protected]/Quoted 8 lines
into these series.
I have to do similar thing here, so decided to avoid duplicated effort.The aim of these patch series is to make
rte_ethdevcore data structures (rte_eth_dev,rte_eth_dev_data,rte_eth_rxtx_callback, etc.) internal to DPDK and not visible to the user.
That should allow future possible changes to core ethdev related structures to be transparent to the user and help to improve ABI/APIstability.
Quoted 45 lines
Note that current ethdev API is preserved, but it is a formal ABI break.
The work is based on previous discussions at:
https://www.mail-archive.com/[email protected]/msg211405.html
https://www.mail-archive.com/[email protected]/msg216685.html
and consists of the following main points:
1. Copy public 'fast' function pointers (rx_pkt_burst(), etc.) and related data pointer fromrte_eth_devinto a separate flat array. We keep it public to still be able to use inline functions for these 'fast' calls (likerte_eth_rx_burst(), etc.) to avoid/minimize slowdown. Note that apart from function pointers itself, each element of this flat array also contains two opaque pointers for each ethdev:
1) a pointer to an array of internal queue data pointers
2) points to array of queue callback data pointers.
Note that exposing this extra information allows us to avoid extra changes inside PMD level, plus should help to avoid possible performance degradation.
2. Change implementation of 'fast' inline ethdev functions (rte_eth_rx_burst(), etc.) to use new public flat array. While it is an ABI breakage, this change is intended to be transparent for both users (no changes in user app is required) and PMD developers (no changes in PMD is required).
One extra note - with new implementation RX/TX callback invocation will cost one extra function call with this changes. That might cause some slowdown for code-path with RX/TX callbacks heavily involved. Hope such trade-off is acceptable for the community.
3. Moverte_eth_dev,rte_eth_dev_data,rte_eth_rxtx_callbackand related things into internal header: <ethdev_driver.h>.That approach was selected to:
- Avoid(/minimize) possible performance losses.
- Minimize required changes inside PMDs.Performance testing results (ICX 2.0GHz, E810 (ice)):
- testpmd macswap fwd mode, plus
a) no RX/TX callbacks:
no actual slowdown observed
b) bpf-load rx 0 0 JM./dpdk.org/examples/bpf/t3.o:
~2% slowdown
- l3fwd: no actual slowdown observedWould like to thank everyone who already reviewed and tested previous versions of these series. All other interested parties please don't be shy and provide your feedback.
Quoted 8 lines
Konstantin Ananyev (6):
ethdev: allocate max space for internal queue array
ethdev: change input parameters forrx_queue_count
ethdev: copy fast-path API into separate structure
ethdev: make fast-path functions to use new flat array
ethdev: add API to retrieve multiple ethernet addresses
ethdev: hide eth dev related structuresFor series,
Reviewed-by Ferruh Yigit <[email protected]>No performance regression detected on my testing.
Quoted 9 lines
I am merging the series to next-net now which helps testing, but before merging to main repo it will be good to get more ack and test results (I can squash new tags later).
@Jerin, @Ajit, @Raslan, @Andrew, @Qi, @Honnappa, Can you please test this set for any possible regression?
Series applied to dpdk-next-net/main, thanks.
For series, there is no performance regression in n1sdp/thunderx2 with i40e and mlx5 40G NIC for l3fwd and testpmd.
Quoted 129 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Ferruh Yigit
Sent: Wednesday, October 13, 2021 11:16 PM
To: Konstantin Ananyev <[email protected]>; [email protected]; [email protected]; Ajit Khaparde <[email protected]>; Raslan Darawsheh <[email protected]>; Andrew Rybchenko <[email protected]>; Qi Zhang <[email protected]>; Honnappa Nagarahalli <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; [email protected]; NBU-Contact-longli <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; NBU-Contact-Thomas Monjalon <[email protected]>; [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH v6 0/6] hide eth dev related structuresQuoted 25 lines · Konstantin Ananyev
v6 changes:
- Update comments (Andrew)
- Move callback related variables under corresponding ifdefs (Andrew)
- Few nits inrte_eth_macaddrs_get(Andrew)
- Rebased on top of next-net treev5 changes:
- Fix spelling (Thomas/David)
- Rename internal helper functions (David)
- Reorder patches and update commit messages (Thomas)
- Update comments (Thomas)
- Changed layout inrte_eth_fp_ops, to group functions and related data based on their functionality:
first 64B line for Rx, second one for Tx.
Didn't observe any real performance difference comparing to original layout. Though decided to keep a new one, as it seems a bit more plausible.v4 changes:
- Fix secondary process attach (Pavan)
- Fix build failure (Ferruh)
- Updatelib/ethdev/verion.map(Ferruh)
Note that moving newly added symbols from EXPERIMENTAL toDPDK_22section makescheckpatch.shto complain.Quoted 6 lines
v3 changes:
- Changes in public struct naming (Jerin/Haiyue)
- Split patches
- Update docs
- Shamelessly included Andrew's patch:https://patches.dpdk.org/project/dpdk/patch/20210928154856.1015020-Quoted 27 lines
into these series.
I have to do similar thing here, so decided to avoid duplicated effort.The aim of these patch series is to make
rte_ethdevcore data structures (rte_eth_dev,rte_eth_dev_data,rte_eth_rxtx_callback, etc.) internal to DPDK and not visible to the user.
That should allow future possible changes to core ethdev related structures to be transparent to the user and help to improve ABI/API stability. Note that current ethdev API is preserved, but it is a formal ABI break.The work is based on previous discussions at:
https://www.mail-archive.com/[email protected]/msg211405.html
https://www.mail-archive.com/[email protected]/msg216685.html
and consists of the following main points:
1. Copy public 'fast' function pointers (rx_pkt_burst(), etc.) and related data pointer fromrte_eth_devinto a separate flat array. We keep it public to still be able to use inline functions for these 'fast' calls (likerte_eth_rx_burst(), etc.) to avoid/minimize slowdown. Note that apart from function pointers itself, each element of this flat array also contains two opaque pointers for each ethdev:
1) a pointer to an array of internal queue data pointers
2) points to array of queue callback data pointers.
Note that exposing this extra information allows us to avoid extra changes inside PMD level, plus should help to avoid possible performance degradation.
2. Change implementation of 'fast' inline ethdev functions (rte_eth_rx_burst(), etc.) to use new public flat array.Quoted 8 lines
While it is an ABI breakage, this change is intended to be transparent for both users (no changes in user app is required) and PMD developers (no changes in PMD is required).
One extra note - with new implementation RX/TX callback invocation will cost one extra function call with this changes. That might cause some slowdown for code-path with RX/TX callbacks heavily involved. Hope such trade-off is acceptable for the community.
3. Moverte_eth_dev,rte_eth_dev_data,rte_eth_rxtx_callbackandrelated
Quoted 18 lines
things into internal header: <
ethdev_driver.h>.That approach was selected to:
- Avoid(/minimize) possible performance losses.
- Minimize required changes inside PMDs.Performance testing results (ICX 2.0GHz, E810 (ice)):
- testpmd macswap fwd mode, plus
a) no RX/TX callbacks:
no actual slowdown observed
b) bpf-load rx 0 0 JM./dpdk.org/examples/bpf/t3.o:
~2% slowdown
- l3fwd: no actual slowdown observedWould like to thank everyone who already reviewed and tested previous versions of these series. All other interested parties please don't be shy and provide your feedback.
Quoted 8 lines
Konstantin Ananyev (6):
ethdev: allocate max space for internal queue array
ethdev: change input parameters forrx_queue_count
ethdev: copy fast-path API into separate structure
ethdev: make fast-path functions to use new flat array
ethdev: add API to retrieve multiple ethernet addresses
ethdev: hide eth dev related structuresFor series,
Reviewed-by Ferruh Yigit <[email protected]>No performance regression detected on my testing.
Quoted 9 lines
I am merging the series to next-net now which helps testing, but before merging to main repo it will be good to get more ack and test results (I can squash new tags later).
@Jerin, @Ajit, @Raslan, @Andrew, @Qi, @Honnappa, Can you please test this set for any possible regression?
Series applied to dpdk-next-net/main, thanks.
Tested (on dpdk-next-net/main) single and multi-core packet forwarding performance with testpmd on both ConnectX-5 and ConnectX-6 Dx. I didn't see any noticeable regressions.
Thanks,
Ali
Quoted 133 lines · Ali Alnubani
Quoted 133 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Ferruh Yigit
Sent: Wednesday, October 13, 2021 11:16 PM
To: Konstantin Ananyev <[email protected]>; [email protected]; [email protected]; Ajit Khaparde <[email protected]>; Raslan Darawsheh <[email protected]>; Andrew Rybchenko <[email protected]>; Qi Zhang <[email protected]>; Honnappa Nagarahalli <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; [email protected]; NBU-Contact-longli <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; NBU-Contact-Thomas Monjalon <[email protected]>; [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH v6 0/6] hide eth dev related structuresQuoted 25 lines · Konstantin Ananyev
v6 changes:
- Update comments (Andrew)
- Move callback related variables under corresponding ifdefs (Andrew)
- Few nits inrte_eth_macaddrs_get(Andrew)
- Rebased on top of next-net treev5 changes:
- Fix spelling (Thomas/David)
- Rename internal helper functions (David)
- Reorder patches and update commit messages (Thomas)
- Update comments (Thomas)
- Changed layout inrte_eth_fp_ops, to group functions and related data based on their functionality:
first 64B line for Rx, second one for Tx.
Didn't observe any real performance difference comparing to original layout. Though decided to keep a new one, as it seems a bit more plausible.v4 changes:
- Fix secondary process attach (Pavan)
- Fix build failure (Ferruh)
- Updatelib/ethdev/verion.map(Ferruh)
Note that moving newly added symbols from EXPERIMENTAL toDPDK_22section makescheckpatch.shto complain.Quoted 6 lines
v3 changes:
- Changes in public struct naming (Jerin/Haiyue)
- Split patches
- Update docs
- Shamelessly included Andrew's patch:https://patches.dpdk.org/project/dpdk/patch/20210928154856.1015020-Quoted 27 lines
into these series.
I have to do similar thing here, so decided to avoid duplicated effort.The aim of these patch series is to make
rte_ethdevcore data structures (rte_eth_dev,rte_eth_dev_data,rte_eth_rxtx_callback, etc.) internal to DPDK and not visible to the user.
That should allow future possible changes to core ethdev related structures to be transparent to the user and help to improve ABI/API stability. Note that current ethdev API is preserved, but it is a formal ABI break.The work is based on previous discussions at:
https://www.mail-archive.com/[email protected]/msg211405.html
https://www.mail-archive.com/[email protected]/msg216685.html
and consists of the following main points:
1. Copy public 'fast' function pointers (rx_pkt_burst(), etc.) and related data pointer fromrte_eth_devinto a separate flat array. We keep it public to still be able to use inline functions for these 'fast' calls (likerte_eth_rx_burst(), etc.) to avoid/minimize slowdown. Note that apart from function pointers itself, each element of this flat array also contains two opaque pointers for each ethdev:
1) a pointer to an array of internal queue data pointers
2) points to array of queue callback data pointers.
Note that exposing this extra information allows us to avoid extra changes inside PMD level, plus should help to avoid possible performance degradation.
2. Change implementation of 'fast' inline ethdev functions (rte_eth_rx_burst(), etc.) to use new public flat array.Quoted 8 lines
While it is an ABI breakage, this change is intended to be transparent for both users (no changes in user app is required) and PMD developers (no changes in PMD is required).
One extra note - with new implementation RX/TX callback invocation will cost one extra function call with this changes. That might cause some slowdown for code-path with RX/TX callbacks heavily involved. Hope such trade-off is acceptable for the community.
3. Moverte_eth_dev,rte_eth_dev_data,rte_eth_rxtx_callbackandrelated
Quoted 18 lines
things into internal header: <
ethdev_driver.h>.That approach was selected to:
- Avoid(/minimize) possible performance losses.
- Minimize required changes inside PMDs.Performance testing results (ICX 2.0GHz, E810 (ice)):
- testpmd macswap fwd mode, plus
a) no RX/TX callbacks:
no actual slowdown observed
b) bpf-load rx 0 0 JM./dpdk.org/examples/bpf/t3.o:
~2% slowdown
- l3fwd: no actual slowdown observedWould like to thank everyone who already reviewed and tested previous versions of these series. All other interested parties please don't be shy and provide your feedback.
Quoted 8 lines
Konstantin Ananyev (6):
ethdev: allocate max space for internal queue array
ethdev: change input parameters forrx_queue_count
ethdev: copy fast-path API into separate structure
ethdev: make fast-path functions to use new flat array
ethdev: add API to retrieve multiple ethernet addresses
ethdev: hide eth dev related structuresFor series,
Reviewed-by Ferruh Yigit <[email protected]>No performance regression detected on my testing.
I am merging the series to next-net now which helps testing, but before merging to main repo it will be good to get more ack and test results (I can squash new tags later).
Quoted 8 lines
Quoted 5 lines
@Jerin, @Ajit, @Raslan, @Andrew, @Qi, @Honnappa, Can you please test this set for any possible regression?
Series applied to dpdk-next-net/main, thanks.
Tested (on dpdk-next-net/main) single and multi-core packet forwarding performance with testpmd on both ConnectX-5 and ConnectX-6 Dx. I didn't see any noticeable regressions.
Thanks!
At this stage I am putting set to pull request for main repo. Last day for anyone who wants to test the set.
Quoted 141 lines · Ferruh Yigit
Quoted 139 lines · Ali Alnubani
Quoted 138 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Ferruh Yigit
Sent: Wednesday, October 13, 2021 11:16 PM
To: Konstantin Ananyev <[email protected]>; [email protected]; [email protected]; Ajit Khaparde <[email protected]>; Raslan Darawsheh <[email protected]>; Andrew Rybchenko <[email protected]>; Qi Zhang <[email protected]>; Honnappa Nagarahalli <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; [email protected]; NBU-Contact-longli <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; NBU-Contact-Thomas Monjalon <[email protected]>; [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH v6 0/6] hide eth dev related structuresQuoted 25 lines · Konstantin Ananyev
v6 changes:
- Update comments (Andrew)
- Move callback related variables under corresponding ifdefs (Andrew)
- Few nits inrte_eth_macaddrs_get(Andrew)
- Rebased on top of next-net treev5 changes:
- Fix spelling (Thomas/David)
- Rename internal helper functions (David)
- Reorder patches and update commit messages (Thomas)
- Update comments (Thomas)
- Changed layout inrte_eth_fp_ops, to group functions and related data based on their functionality:
first 64B line for Rx, second one for Tx.
Didn't observe any real performance difference comparing to original layout. Though decided to keep a new one, as it seems a bit more plausible.v4 changes:
- Fix secondary process attach (Pavan)
- Fix build failure (Ferruh)
- Updatelib/ethdev/verion.map(Ferruh)
Note that moving newly added symbols from EXPERIMENTAL toDPDK_22section makescheckpatch.shto complain.Quoted 6 lines
v3 changes:
- Changes in public struct naming (Jerin/Haiyue)
- Split patches
- Update docs
- Shamelessly included Andrew's patch:https://patches.dpdk.org/project/dpdk/patch/20210928154856.1015020-Quoted 27 lines
into these series.
I have to do similar thing here, so decided to avoid duplicated effort.The aim of these patch series is to make
rte_ethdevcore data structures (rte_eth_dev,rte_eth_dev_data,rte_eth_rxtx_callback, etc.) internal to DPDK and not visible to the user.
That should allow future possible changes to core ethdev related structures to be transparent to the user and help to improve ABI/API stability. Note that current ethdev API is preserved, but it is a formal ABI break.The work is based on previous discussions at:
https://www.mail-archive.com/[email protected]/msg211405.html
https://www.mail-archive.com/[email protected]/msg216685.html
and consists of the following main points:
1. Copy public 'fast' function pointers (rx_pkt_burst(), etc.) and related data pointer fromrte_eth_devinto a separate flat array. We keep it public to still be able to use inline functions for these 'fast' calls (likerte_eth_rx_burst(), etc.) to avoid/minimize slowdown. Note that apart from function pointers itself, each element of this flat array also contains two opaque pointers for each ethdev:
1) a pointer to an array of internal queue data pointers
2) points to array of queue callback data pointers.
Note that exposing this extra information allows us to avoid extra changes inside PMD level, plus should help to avoid possible performance degradation.
2. Change implementation of 'fast' inline ethdev functions (rte_eth_rx_burst(), etc.) to use new public flat array.Quoted 8 lines
While it is an ABI breakage, this change is intended to be transparent for both users (no changes in user app is required) and PMD developers (no changes in PMD is required).
One extra note - with new implementation RX/TX callback invocation will cost one extra function call with this changes. That might cause some slowdown for code-path with RX/TX callbacks heavily involved. Hope such trade-off is acceptable for the community.
3. Moverte_eth_dev,rte_eth_dev_data,rte_eth_rxtx_callbackandrelated
Quoted 18 lines
things into internal header: <
ethdev_driver.h>.That approach was selected to:
- Avoid(/minimize) possible performance losses.
- Minimize required changes inside PMDs.Performance testing results (ICX 2.0GHz, E810 (ice)):
- testpmd macswap fwd mode, plus
a) no RX/TX callbacks:
no actual slowdown observed
b) bpf-load rx 0 0 JM./dpdk.org/examples/bpf/t3.o:
~2% slowdown
- l3fwd: no actual slowdown observedWould like to thank everyone who already reviewed and tested previous versions of these series. All other interested parties please don't be shy and provide your feedback.
Quoted 8 lines
Konstantin Ananyev (6):
ethdev: allocate max space for internal queue array
ethdev: change input parameters forrx_queue_count
ethdev: copy fast-path API into separate structure
ethdev: make fast-path functions to use new flat array
ethdev: add API to retrieve multiple ethernet addresses
ethdev: hide eth dev related structuresFor series,
Reviewed-by Ferruh Yigit <[email protected]>No performance regression detected on my testing.
I am merging the series to next-net now which helps testing, but before merging to main repo it will be good to get more ack and test results (I can squash new tags later).
@Jerin, @Ajit, @Raslan, @Andrew, @Qi, @Honnappa, Can you please test this set for any possible regression?
Series applied to dpdk-next-net/main, thanks.
Quoted 7 lines
Quoted 2 lines
Tested (on dpdk-next-net/main) single and multi-core packet forwarding performance with testpmd on both ConnectX-5 and ConnectX-6 Dx. I didn't see any noticeable regressions.
Thanks!
At this stage I am putting set to pull request for main repo. Last day for anyone who wants to test the set.
I tested dpdk-next-net/main. My testing was limited and did not reveal any issues.