DLB Enqueue Reorder Support
cover DLB Enqueue Reorder Support
This patchset implements DLB enqueue reorder support.
v1: Initial patchset
Abdullah Sevincer (2):
event/dlb2: add support for enqueue reordering
eventdev: add support for enqueue reorder
doc/guides/rel_notes/release_24_07.rst | 4 + drivers/event/dlb2/dlb2.c | 505 ++++++++++++++++--------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_frag.h | 13 + drivers/event/dlb2/dlb2_inline_fns.h | 28 ++ drivers/event/dlb2/dlb2_priv.h | 22 +- drivers/event/dlb2/meson_options.txt | 6 + drivers/event/dlb2/rte_pmd_dlb2.h | 10 + lib/eventdev/rte_eventdev.h | 8 + 9 files changed, 433 insertions(+), 190 deletions(-) create mode 100644 drivers/event/dlb2/dlb2_frag.h create mode 100644 drivers/event/dlb2/meson_options.txt
Signature · 1 line
2.25.1
PATCH 1/2 event/dlb2: add support for enqueue reordering
DLB devices need events to be enqueued in the same order they are dequeued. Applications are not suppose to change event order between dequeue and to enqueue. Since Eventdev standard does not add such restrictions reorder support is needed for DLB PMD so that it restores dequeue order on enqueue if applications happen to change it. It also adds missing releases in places where events are dropped by the application and it expects implicit release to handle it.
By default the feature will be off on all DLB ports and they will behave same as older releases. To enable reordering feature, applications need to add RTE_EVENT_PORT_CFG_RESTORE_DEQ_ORDER flag to port configuration.
--- doc/guides/rel_notes/release_24_07.rst | 4 + drivers/event/dlb2/dlb2.c | 505 ++++++++++++++++--------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_frag.h | 13 + drivers/event/dlb2/dlb2_inline_fns.h | 28 ++ drivers/event/dlb2/dlb2_priv.h | 22 +- drivers/event/dlb2/meson_options.txt | 6 + drivers/event/dlb2/rte_pmd_dlb2.h | 10 + 8 files changed, 425 insertions(+), 190 deletions(-) create mode 100644 drivers/event/dlb2/dlb2_frag.h create mode 100644 drivers/event/dlb2/meson_options.txt
doc/guides/rel_notes/release_24_07.rst +4 -0
@@ -144,6 +144,10 @@ New Features Added an API that allows the user to reclaim the defer queue with RCU. +* **Updated DLB2 Driver for enqueue reordering feature** + * Added support for DLB reordering feature. Applications should use + ``RTE_EVENT_PORT_CFG_RESTORE_DEQ_ORDER`` to enable the feature. + Removed Items -------------
drivers/event/dlb2/dlb2.c +334 -171
707 lines not on this page · raw message
drivers/event/dlb2/dlb2_avx512.c +14 -13
@@ -151,20 +151,20 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port,*/ #define DLB2_QE_EV_TYPE_WORD 0 sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[0 ].sub_event_type <<8 | - ev[0 ].event_type, + ev[0 ].sub_event_type <<4 | + ev[0 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[1 ].sub_event_type <<8 | - ev[1 ].event_type, + ev[1 ].sub_event_type <<4 | + ev[1 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[2 ].sub_event_type <<8 | - ev[2 ].event_type, + ev[2 ].sub_event_type <<4 | + ev[2 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[3 ].sub_event_type <<8 | - ev[3 ].event_type, + ev[3 ].sub_event_type <<4 | + ev[3 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 );if (qm_port->use_avx512) {
@@ -238,11 +238,11 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, }/* will only be set for DLB 2.5 + */ -if (qm_port->cq_weight) { - qe[0 ].weight = ev[0 ].impl_opaque &3 ; - qe[1 ].weight = ev[1 ].impl_opaque &3 ; - qe[2 ].weight = ev[2 ].impl_opaque &3 ; - qe[3 ].weight = ev[3 ].impl_opaque &3 ; +if (qm_port->dlb2->enable_cq_weight) { + qe[0 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[0 ]); + qe[1 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[1 ]); + qe[2 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[2 ]); + qe[3 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[3 ]); }break ;
@@ -267,6 +267,7 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, } qe[i].u.event_type.major = ev[i].event_type; qe[i].u.event_type.sub = ev[i].sub_event_type; + qe[i].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[i]); }break ;case 0 :
drivers/event/dlb2/dlb2_frag.h new file +13 -0
@@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2016-2017 Intel Corporation +*/ + +#ifndef _DLB2_FRAG_H_ +#define _DLB2_FRAG_H_ + +/* Fragments/partials are not supported by the API, but the capability is in +* the PMD in case future support is added. +*/ +#define RTE_EVENT_DLB2_OP_FRAG 3 + +#endif /* _DLB2_FRAG_H_ */
drivers/event/dlb2/dlb2_inline_fns.h +28 -0
@@ -32,4 +32,32 @@ dlb2_movdir64b(void *dest, void *src) : "a" (dest), "d" (src)); } +static inline void +dlb2_movdir64b_single (void *pp_addr,void *qe4) +{ + asmvolatile (".byte 0x66, 0x0f, 0x38, 0xf8, 0x02" + : + :"a" (pp_addr),"d" (qe4)); +} + +static inline void +dlb2_movntdq (void *pp_addr,void *qe4) +{ +/* Move entire 64B cache line of QEs, 128 bits (16B) at a time. */ +long long *_qe = (long long *)qe4; + +__v2di src_data0 = (__v2di ){_qe[0 ], _qe[1 ]}; +__v2di src_data1 = (__v2di ){_qe[2 ], _qe[3 ]}; +__v2di src_data2 = (__v2di ){_qe[4 ], _qe[5 ]}; +__v2di src_data3 = (__v2di ){_qe[6 ], _qe[7 ]}; + +__builtin_ia32_movntdq ((__v2di *)pp_addr +0 , (__v2di )src_data0); +rte_wmb (); +__builtin_ia32_movntdq ((__v2di *)pp_addr +1 , (__v2di )src_data1); +rte_wmb (); +__builtin_ia32_movntdq ((__v2di *)pp_addr +2 , (__v2di )src_data2); +rte_wmb (); +__builtin_ia32_movntdq ((__v2di *)pp_addr +3 , (__v2di )src_data3); +rte_wmb (); +}#endif /* _DLB2_INLINE_FNS_H_ */
drivers/event/dlb2/dlb2_priv.h +16 -6
@@ -387,8 +387,23 @@ struct dlb2_port {bool use_scalar;/* force usage of scalar code */ uint16_t hw_credit_quanta;bool use_avx512; -uint32_t cq_weight;bool is_producer;/* True if port is of type producer */ +uint8_t reorder_id;/* id used for reordering events coming back into the scheduler */ +bool reorder_en; +struct dlb2_reorder *order;/* For ordering enqueues */ +}; + +struct dlb2_reorder { +/* a reorder buffer for events coming back in different order from dequeue +* We use UINT8_MAX + 1 elements, but add on three no-ops to make movdirs easier at the end +*/ +union { +__m128i m128; +struct dlb2_enqueue_qe qe; +uint64_t u64[2 ]; + } enq_reorder[UINT8_MAX +4 ]; +/* id of the next entry in the reorder enqueue ring to send in */ +uint8_t next_to_enqueue; };/* Per-process per-port mmio and memory pointers */
@@ -642,10 +657,6 @@ struct dlb2_qid_depth_thresholds {int val[DLB2_MAX_NUM_QUEUES_ALL ]; }; -struct dlb2_cq_weight { -int limit[DLB2_MAX_NUM_PORTS_ALL ]; -}; -struct dlb2_port_cos {int cos_id[DLB2_MAX_NUM_PORTS_ALL ]; };
@@ -667,7 +678,6 @@ struct dlb2_devargs {bool vector_opts_enabled;int max_cq_depth;int max_enq_depth; -struct dlb2_cq_weight cq_weight;struct dlb2_port_cos port_cos;struct dlb2_cos_bw cos_bw;const char *producer_coremask;
drivers/event/dlb2/meson_options.txt new file +6 -0
@@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2023-2024 Intel Corporation + +DLB2_BYPASS_FENCE_ON_PP = 0 +DLB_HW_CREDITS_CHECKS = 0 +DLB_SW_CREDITS_CHECKS = 1
drivers/event/dlb2/rte_pmd_dlb2.h +10 -0
@@ -19,6 +19,16 @@ extern "C" {#include <rte_compat.h> +/** +* Macros to get/set QID depth and QE weight from rte_event metadata. +* Currently 'rsvd' field is used for these. Lower 2 bits are used to store +* QID depth while the upper 2 bits are used for QER weight. +*/ +#define RTE_PMD_DLB2_GET_QID_DEPTH (x) ((x)->rsvd & 0x3) +#define RTE_PMD_DLB2_SET_QID_DEPTH (x, v) ((x)->rsvd = ((x)->rsvd & ~0x3) | (v & 0x3)) +#define RTE_PMD_DLB2_GET_QE_WEIGHT (x) (((x)->rsvd >> 2) & 0x3) +#define RTE_PMD_DLB2_SET_QE_WEIGHT (x, v) ((x)->rsvd = ((x)->rsvd & 0x3) | ((v & 0x3) << 2)) +/** * @warning * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
Signature · 1 line
2.25.1
v2 cover DLB Enqueue Reorder Support
This patchset implements DLB enqueue reorder support.
v2: Fix CI issue.
v1: Initial patchset
Abdullah Sevincer (2):
event/dlb2: add support for enqueue reordering
eventdev: add support for enqueue reorder
doc/guides/rel_notes/release_24_07.rst | 4 + drivers/event/dlb2/dlb2.c | 504 ++++++++++++++++--------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 28 ++ drivers/event/dlb2/dlb2_priv.h | 22 +- drivers/event/dlb2/rte_pmd_dlb2.h | 10 + lib/eventdev/rte_eventdev.h | 8 + 7 files changed, 413 insertions(+), 190 deletions(-)
Signature · 1 line
2.25.1
PATCH v2 1/2 event/dlb2: add support for enqueue reordering
DLB devices need events to be enqueued in the same order they are dequeued. Applications are not suppose to change event order between dequeue and to enqueue. Since Eventdev standard does not add such restrictions reorder support is needed for DLB PMD so that it restores dequeue order on enqueue if applications happen to change it. It also adds missing releases in places where events are dropped by the application and it expects implicit release to handle it.
By default the feature will be off on all DLB ports and they will behave same as older releases. To enable reordering feature, applications need to add RTE_EVENT_PORT_CFG_RESTORE_DEQ_ORDER flag to port configuration.
--- doc/guides/rel_notes/release_24_07.rst | 4 + drivers/event/dlb2/dlb2.c | 504 ++++++++++++++++--------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 28 ++ drivers/event/dlb2/dlb2_priv.h | 22 +- drivers/event/dlb2/rte_pmd_dlb2.h | 10 + 6 files changed, 405 insertions(+), 190 deletions(-)
doc/guides/rel_notes/release_24_07.rst +4 -0
@@ -144,6 +144,10 @@ New Features Added an API that allows the user to reclaim the defer queue with RCU. +* **Updated DLB2 Driver for enqueue reordering feature** + * Added support for DLB reordering feature. Applications should use + ``RTE_EVENT_PORT_CFG_RESTORE_DEQ_ORDER`` to enable the feature. + Removed Items -------------
drivers/event/dlb2/dlb2.c +333 -171
706 lines not on this page · raw message
drivers/event/dlb2/dlb2_avx512.c +14 -13
@@ -151,20 +151,20 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port,*/ #define DLB2_QE_EV_TYPE_WORD 0 sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[0 ].sub_event_type <<8 | - ev[0 ].event_type, + ev[0 ].sub_event_type <<4 | + ev[0 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[1 ].sub_event_type <<8 | - ev[1 ].event_type, + ev[1 ].sub_event_type <<4 | + ev[1 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[2 ].sub_event_type <<8 | - ev[2 ].event_type, + ev[2 ].sub_event_type <<4 | + ev[2 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[3 ].sub_event_type <<8 | - ev[3 ].event_type, + ev[3 ].sub_event_type <<4 | + ev[3 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 );if (qm_port->use_avx512) {
@@ -238,11 +238,11 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, }/* will only be set for DLB 2.5 + */ -if (qm_port->cq_weight) { - qe[0 ].weight = ev[0 ].impl_opaque &3 ; - qe[1 ].weight = ev[1 ].impl_opaque &3 ; - qe[2 ].weight = ev[2 ].impl_opaque &3 ; - qe[3 ].weight = ev[3 ].impl_opaque &3 ; +if (qm_port->dlb2->enable_cq_weight) { + qe[0 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[0 ]); + qe[1 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[1 ]); + qe[2 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[2 ]); + qe[3 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[3 ]); }break ;
@@ -267,6 +267,7 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, } qe[i].u.event_type.major = ev[i].event_type; qe[i].u.event_type.sub = ev[i].sub_event_type; + qe[i].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[i]); }break ;case 0 :
drivers/event/dlb2/dlb2_inline_fns.h +28 -0
@@ -32,4 +32,32 @@ dlb2_movdir64b(void *dest, void *src) : "a" (dest), "d" (src)); } +static inline void +dlb2_movdir64b_single (void *pp_addr,void *qe4) +{ + asmvolatile (".byte 0x66, 0x0f, 0x38, 0xf8, 0x02" + : + :"a" (pp_addr),"d" (qe4)); +} + +static inline void +dlb2_movntdq (void *pp_addr,void *qe4) +{ +/* Move entire 64B cache line of QEs, 128 bits (16B) at a time. */ +long long *_qe = (long long *)qe4; + +__v2di src_data0 = (__v2di ){_qe[0 ], _qe[1 ]}; +__v2di src_data1 = (__v2di ){_qe[2 ], _qe[3 ]}; +__v2di src_data2 = (__v2di ){_qe[4 ], _qe[5 ]}; +__v2di src_data3 = (__v2di ){_qe[6 ], _qe[7 ]}; + +__builtin_ia32_movntdq ((__v2di *)pp_addr +0 , (__v2di )src_data0); +rte_wmb (); +__builtin_ia32_movntdq ((__v2di *)pp_addr +1 , (__v2di )src_data1); +rte_wmb (); +__builtin_ia32_movntdq ((__v2di *)pp_addr +2 , (__v2di )src_data2); +rte_wmb (); +__builtin_ia32_movntdq ((__v2di *)pp_addr +3 , (__v2di )src_data3); +rte_wmb (); +}#endif /* _DLB2_INLINE_FNS_H_ */
drivers/event/dlb2/dlb2_priv.h +16 -6
@@ -387,8 +387,23 @@ struct dlb2_port {bool use_scalar;/* force usage of scalar code */ uint16_t hw_credit_quanta;bool use_avx512; -uint32_t cq_weight;bool is_producer;/* True if port is of type producer */ +uint8_t reorder_id;/* id used for reordering events coming back into the scheduler */ +bool reorder_en; +struct dlb2_reorder *order;/* For ordering enqueues */ +}; + +struct dlb2_reorder { +/* a reorder buffer for events coming back in different order from dequeue +* We use UINT8_MAX + 1 elements, but add on three no-ops to make movdirs easier at the end +*/ +union { +__m128i m128; +struct dlb2_enqueue_qe qe; +uint64_t u64[2 ]; + } enq_reorder[UINT8_MAX +4 ]; +/* id of the next entry in the reorder enqueue ring to send in */ +uint8_t next_to_enqueue; };/* Per-process per-port mmio and memory pointers */
@@ -642,10 +657,6 @@ struct dlb2_qid_depth_thresholds {int val[DLB2_MAX_NUM_QUEUES_ALL ]; }; -struct dlb2_cq_weight { -int limit[DLB2_MAX_NUM_PORTS_ALL ]; -}; -struct dlb2_port_cos {int cos_id[DLB2_MAX_NUM_PORTS_ALL ]; };
@@ -667,7 +678,6 @@ struct dlb2_devargs {bool vector_opts_enabled;int max_cq_depth;int max_enq_depth; -struct dlb2_cq_weight cq_weight;struct dlb2_port_cos port_cos;struct dlb2_cos_bw cos_bw;const char *producer_coremask;
drivers/event/dlb2/rte_pmd_dlb2.h +10 -0
@@ -19,6 +19,16 @@ extern "C" {#include <rte_compat.h> +/** +* Macros to get/set QID depth and QE weight from rte_event metadata. +* Currently 'rsvd' field is used for these. Lower 2 bits are used to store +* QID depth while the upper 2 bits are used for QER weight. +*/ +#define RTE_PMD_DLB2_GET_QID_DEPTH (x) ((x)->rsvd & 0x3) +#define RTE_PMD_DLB2_SET_QID_DEPTH (x, v) ((x)->rsvd = ((x)->rsvd & ~0x3) | (v & 0x3)) +#define RTE_PMD_DLB2_GET_QE_WEIGHT (x) (((x)->rsvd >> 2) & 0x3) +#define RTE_PMD_DLB2_SET_QE_WEIGHT (x, v) ((x)->rsvd = ((x)->rsvd & 0x3) | ((v & 0x3) << 2)) +/** * @warning * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
Signature · 1 line
2.25.1
PATCH v2 2/2 eventdev: add support for enqueue reorder
In reply to Abdullah SevincerThis commit adds support flag to enable enqueue reorder feature.
When this flag is enabled in the port configuration PMD restores dequeue order on enqueue if applications happen to change it.
--- lib/eventdev/rte_eventdev.h | 8 ++++++++ 1 file changed, 8 insertions(+)
lib/eventdev/rte_eventdev.h +8 -0
@@ -1073,6 +1073,14 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_RESTORE_DEQ_ORDER (1ULL << 5) +/**< Flag to enable feature enqueue reordering to dequeue. +* The feature restores dequeue order on enqueue if applications +* happen to change the order. +* +* @see rte_event_port_setup() +*/ +/** Event port configuration structure */ struct rte_event_port_conf {int32_t new_event_threshold;
Signature · 1 line
2.25.1
v3 cover DLB Enqueue Reorder Support
In reply to Abdullah SevincerThis patchset implements DLB enqueue reorder support.
v3: Fix build issues.
v2: Fix CI issues.
v1: Initial patchset.
Abdullah Sevincer (2):
event/dlb2: add support for enqueue reordering
eventdev: add support for enqueue reorder
doc/guides/rel_notes/release_24_07.rst | 4 + drivers/event/dlb2/dlb2.c | 484 ++++++++++++++++--------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 22 +- drivers/event/dlb2/rte_pmd_dlb2.h | 10 + lib/eventdev/rte_eventdev.h | 8 + 7 files changed, 374 insertions(+), 189 deletions(-)
Signature · 1 line
2.25.1
PATCH v3 1/2 event/dlb2: add support for enqueue reordering
DLB devices need events to be enqueued in the same order they are dequeued. Applications are not suppose to change event order between dequeue and to enqueue. Since Eventdev standard does not add such restrictions reorder support is needed for DLB PMD so that it restores dequeue order on enqueue if applications happen to change it. It also adds missing releases in places where events are dropped by the application and it expects implicit release to handle it.
By default the feature will be off on all DLB ports and they will behave same as older releases. To enable reordering feature, applications need to add RTE_EVENT_PORT_CFG_RESTORE_DEQ_ORDER flag to port configuration.
--- doc/guides/rel_notes/release_24_07.rst | 4 + drivers/event/dlb2/dlb2.c | 484 ++++++++++++++++--------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 22 +- drivers/event/dlb2/rte_pmd_dlb2.h | 10 + 6 files changed, 366 insertions(+), 189 deletions(-)
doc/guides/rel_notes/release_24_07.rst +4 -0
@@ -144,6 +144,10 @@ New Features Added an API that allows the user to reclaim the defer queue with RCU. +* **Updated DLB2 Driver for enqueue reordering feature** + * Added support for DLB reordering feature. Applications should use + ``RTE_EVENT_PORT_CFG_RESTORE_DEQ_ORDER`` to enable the feature. + Removed Items -------------
drivers/event/dlb2/dlb2.c +314 -170
671 lines not on this page · raw message
drivers/event/dlb2/dlb2_avx512.c +14 -13
@@ -151,20 +151,20 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port,*/ #define DLB2_QE_EV_TYPE_WORD 0 sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[0 ].sub_event_type <<8 | - ev[0 ].event_type, + ev[0 ].sub_event_type <<4 | + ev[0 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[1 ].sub_event_type <<8 | - ev[1 ].event_type, + ev[1 ].sub_event_type <<4 | + ev[1 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[2 ].sub_event_type <<8 | - ev[2 ].event_type, + ev[2 ].sub_event_type <<4 | + ev[2 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[3 ].sub_event_type <<8 | - ev[3 ].event_type, + ev[3 ].sub_event_type <<4 | + ev[3 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 );if (qm_port->use_avx512) {
@@ -238,11 +238,11 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, }/* will only be set for DLB 2.5 + */ -if (qm_port->cq_weight) { - qe[0 ].weight = ev[0 ].impl_opaque &3 ; - qe[1 ].weight = ev[1 ].impl_opaque &3 ; - qe[2 ].weight = ev[2 ].impl_opaque &3 ; - qe[3 ].weight = ev[3 ].impl_opaque &3 ; +if (qm_port->dlb2->enable_cq_weight) { + qe[0 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[0 ]); + qe[1 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[1 ]); + qe[2 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[2 ]); + qe[3 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[3 ]); }break ;
@@ -267,6 +267,7 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, } qe[i].u.event_type.major = ev[i].event_type; qe[i].u.event_type.sub = ev[i].sub_event_type; + qe[i].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[i]); }break ;case 0 :
drivers/event/dlb2/dlb2_inline_fns.h +8 -0
@@ -32,4 +32,12 @@ dlb2_movdir64b(void *dest, void *src) : "a" (dest), "d" (src)); } +static inline void +dlb2_movdir64b_single (void *pp_addr,void *qe4) +{ + asmvolatile (".byte 0x66, 0x0f, 0x38, 0xf8, 0x02" + : + :"a" (pp_addr),"d" (qe4)); +} +#endif /* _DLB2_INLINE_FNS_H_ */
drivers/event/dlb2/dlb2_priv.h +16 -6
@@ -387,8 +387,23 @@ struct dlb2_port {bool use_scalar;/* force usage of scalar code */ uint16_t hw_credit_quanta;bool use_avx512; -uint32_t cq_weight;bool is_producer;/* True if port is of type producer */ +uint8_t reorder_id;/* id used for reordering events coming back into the scheduler */ +bool reorder_en; +struct dlb2_reorder *order;/* For ordering enqueues */ +}; + +struct dlb2_reorder { +/* a reorder buffer for events coming back in different order from dequeue +* We use UINT8_MAX + 1 elements, but add on three no-ops to make movdirs easier at the end +*/ +union { +__m128i m128; +struct dlb2_enqueue_qe qe; +uint64_t u64[2 ]; + } enq_reorder[UINT8_MAX +4 ]; +/* id of the next entry in the reorder enqueue ring to send in */ +uint8_t next_to_enqueue; };/* Per-process per-port mmio and memory pointers */
@@ -642,10 +657,6 @@ struct dlb2_qid_depth_thresholds {int val[DLB2_MAX_NUM_QUEUES_ALL ]; }; -struct dlb2_cq_weight { -int limit[DLB2_MAX_NUM_PORTS_ALL ]; -}; -struct dlb2_port_cos {int cos_id[DLB2_MAX_NUM_PORTS_ALL ]; };
@@ -667,7 +678,6 @@ struct dlb2_devargs {bool vector_opts_enabled;int max_cq_depth;int max_enq_depth; -struct dlb2_cq_weight cq_weight;struct dlb2_port_cos port_cos;struct dlb2_cos_bw cos_bw;const char *producer_coremask;
drivers/event/dlb2/rte_pmd_dlb2.h +10 -0
@@ -19,6 +19,16 @@ extern "C" {#include <rte_compat.h> +/** +* Macros to get/set QID depth and QE weight from rte_event metadata. +* Currently 'rsvd' field is used for these. Lower 2 bits are used to store +* QID depth while the upper 2 bits are used for QER weight. +*/ +#define RTE_PMD_DLB2_GET_QID_DEPTH (x) ((x)->rsvd & 0x3) +#define RTE_PMD_DLB2_SET_QID_DEPTH (x, v) ((x)->rsvd = ((x)->rsvd & ~0x3) | (v & 0x3)) +#define RTE_PMD_DLB2_GET_QE_WEIGHT (x) (((x)->rsvd >> 2) & 0x3) +#define RTE_PMD_DLB2_SET_QE_WEIGHT (x, v) ((x)->rsvd = ((x)->rsvd & 0x3) | ((v & 0x3) << 2)) +/** * @warning * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
Signature · 1 line
2.25.1
PATCH v3 2/2 eventdev: add support for enqueue reorder
In reply to Abdullah SevincerThis commit adds support flag to enable enqueue reorder feature.
When this flag is enabled in the port configuration PMD restores dequeue order on enqueue if applications happen to change it.
--- lib/eventdev/rte_eventdev.h | 8 ++++++++ 1 file changed, 8 insertions(+)
lib/eventdev/rte_eventdev.h +8 -0
@@ -1073,6 +1073,14 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_RESTORE_DEQ_ORDER (1ULL << 5) +/**< Flag to enable feature enqueue reordering to dequeue. +* The feature restores dequeue order on enqueue if applications +* happen to change the order. +* +* @see rte_event_port_setup() +*/ +/** Event port configuration structure */ struct rte_event_port_conf {int32_t new_event_threshold;
Signature · 1 line
2.25.1
Re: [PATCH v3 2/2] eventdev: add support for enqueue reorder
Quoted 18 lines · Abdullah Sevincer
This commit adds support flag to enable enqueue reorder feature.
When this flag is enabled in the port configuration PMD restores dequeue order on enqueue if applications happen to change it.
Signed-off-by Abdullah Sevincer <[email protected]>--- lib/eventdev/rte_eventdev.h | 8 ++++++++ 1 file changed, 8 insertions(+)lib/eventdev/rte_eventdev.h +0
-0
lib/eventdev/rte_eventdev.h rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id, · line 1079
Quoted 7 lines
lib/eventdev/rte_eventdev.h +4
-0@@ -1073,6 +1073,14 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_RESTORE_DEQ_ORDER (1ULL << 5) +/**< Flag to enable feature enqueue reordering to dequeue. +* The feature restores dequeue order on enqueue if applications +* happen to change the order.
# Is this feature or limitation?
# What is the use case for this feature?
# If application don't care about ORDER, they can use RTE_SCHED_TYPE_PARALLEL. Right?
# Can you share the feature in the context of the below text in specification?
----------------
/* Scheduler type definitions */
#define RTE_SCHED_TYPE_ORDERED 0
/**< Ordered scheduling
*
* Events from an ordered flow of an event queue can be scheduled to multiple
* ports for concurrent processing while maintaining the original event order,
* i.e. the order in which they were first enqueued to that queue.
* This scheme allows events pertaining to the same, potentially large, flow to
* be processed in parallel on multiple cores without incurring any
* application-level order restoration logic overhead.
*
* After events are dequeued from a set of ports, as those events are
re-enqueued
* to another queue (with the op field set to @refRTE_EVENT_OP_FORWARD), the event
* device restores the original event order - including events returned from all
* ports in the set - before the events are placed on the destination queue,
* for subsequent scheduling to ports
-----------------
Quoted 10 lines
lib/eventdev/rte_eventdev.h +4
-1+* +* @see rte_event_port_setup() +*/ +/** Event port configuration structure */ struct rte_event_port_conf {int32_t new_event_threshold; --2.25.1
RE: [PATCH v3 2/2] eventdev: add support for enqueue reorder
Hi Jerin my responses below:
Quoted 1 line
+# Is this feature or limitation?
This is a new feature to enable enqueuing to PMD in any order when the underlined hardware device needs enqueues in a strict dequeue order.
Quoted 1 line
+# What is the use case for this feature?
This is needed by the applications which processes events in batches based on their flow ids. Received burst is sorted based on flow ids.
Quoted 1 line
+# If application don't care about ORDER, they can use
RTE_SCHED_TYPE_PARALLEL. Right?
This is the ordering between enqueue and dequeue and not across cores.
Quoted 1 line
+# Can you share the feature in the context of the below text in specification?
Since the feature is not across cores below context does not apply.
Quoted 29 lines
+----------------
(quoted diff) +20
-0+/* Scheduler type definitions */ +#define RTE_SCHED_TYPE_ORDERED 0 +/**< Ordered scheduling + * + * Events from an ordered flow of an event queue can be scheduled to multiple + * ports for concurrent processing while maintaining the original event order, + * i.e. the order in which they were first enqueued to that queue. + * This scheme allows events pertaining to the same, potentially large, flow to + * be processed in parallel on multiple cores without incurring any +* application-level order restoration logic overhead. + * +* After events are dequeued from a set of ports, as those events are re-enqueued +* to another queue (with the op field set to @ref RTE_EVENT_OP_FORWARD), the event +* device restores the original event order - including events returned from all +* ports in the set - before the events are placed on the destination queue, +* for subsequent scheduling to ports + * + * @see rte_event_port_setup() + */ + /** Event port configuration structure */ struct rte_event_port_conf{ int32_t new_event_threshold;--
2.25.1
Re: [PATCH v3 2/2] eventdev: add support for enqueue reorder
Quoted 6 lines · Abdullah
Hi Jerin my responses below:
Quoted 1 line
+# Is this feature or limitation?
This is a new feature to enable enqueuing to PMD in any order when the underlined hardware device needs enqueues in a strict dequeue order.
Quoted 1 line
+# What is the use case for this feature?
This is needed by the applications which processes events in batches based on their flow ids. Received burst is sorted based on flow ids.
OK. It is not clear from the Doxygen comment, add more details in comment in next version, especially if it is applicable for batch mode.
In general, the concept looks good to me.
Add new RTE_EVENT_DEV_CAP_* for this feature.
Update doc/guides/eventdevs/features/default.ini and your PMD feature list.
Adding other eventdev PMD maintainers if there are any comments.
Re: [PATCH v3 2/2] eventdev: add support for enqueue reorder
In reply to Abdullah SevincerQuoted 3 lines · Abdullah Sevincer
This commit adds support flag to enable enqueue reorder feature.
"Enqueue reorder" is how this feature is implemented (on DLB2), but it's not a good description of what it does (or, allows for).
I've called this feature "independent enqueue" in the past. I have a vague memory of someone from Intel calling it something else ("out-of-order enqueue" maybe?), but I can't seem to be able to find that e-mail.
Quoted 4 lines
When this flag is enabled in the port configuration PMD restores dequeue order on enqueue if applications happen to change it.
If this feature is enabled, the application is free to enqueue events in any order, while still maintaining ordered/atomic semantics. That's how I would characterize it.
You may also want to note that the DPDK dispatcher library depends on this flag to function properly on burst-capable event devices.
This patch set should also include a patch to DSW, where it advertises this capability.
Ideally, you should also include a patch to the dispatcher library, which checks for this flag on RTE_EVENT_DEV_CAP_BURST_MODE event devices.
Quoted 24 lines
Signed-off-by Abdullah Sevincer <[email protected]>--- lib/eventdev/rte_eventdev.h | 8 ++++++++ 1 file changed, 8 insertions(+)lib/eventdev/rte_eventdev.h +8
-0@@ -1073,6 +1073,14 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_RESTORE_DEQ_ORDER (1ULL << 5) +/**< Flag to enable feature enqueue reordering to dequeue. +* The feature restores dequeue order on enqueue if applications +* happen to change the order. +* +* @see rte_event_port_setup() +*/ +/** Event port configuration structure */ struct rte_event_port_conf {int32_t new_event_threshold;
Re: [PATCH v3 2/2] eventdev: add support for enqueue reorder
In reply to Abdullah SevincerQuoted 17 lines · Abdullah Sevincer
This commit adds support flag to enable enqueue reorder feature.
When this flag is enabled in the port configuration PMD restores dequeue order on enqueue if applications happen to change it.
Signed-off-by Abdullah Sevincer <[email protected]>--- lib/eventdev/rte_eventdev.h | 8 ++++++++ 1 file changed, 8 insertions(+)lib/eventdev/rte_eventdev.h +0
-0
lib/eventdev/rte_eventdev.h rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id, · line 1080
Quoted 8 lines
lib/eventdev/rte_eventdev.h +5
-0@@ -1073,6 +1073,14 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_RESTORE_DEQ_ORDER (1ULL << 5) +/**< Flag to enable feature enqueue reordering to dequeue. +* The feature restores dequeue order on enqueue if applications +* happen to change the order. +*
Add a device-levelRTE_EVENT_DEV_CAP_INDEPENDENT_ENQ
as well.
The documentation of that flag should probably house the detailed description of this feature.
Here's how I would describe this feature:
#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5)
/**< Flag to enable independent enqueue. Must be unset if the device
* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature
* allows an application to enqueue RTE_EVENT_OP_FORWARD or
* RTE_EVENT_OP_RELEASE in an order different than the order the
* events were dequeued from the event device, while maintaining
* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. *
* If the application wish to change the order of two events *within
* a flow*, it must both change the enqueue order and exchange the
* impl_opaque field, to be portable across all event devices. */
That second paragraph allows DSW to support this feature without modification, since this is the only difference between DSW-style independent enqueue, and DLB enqueue reordering. DLB will restore a total order, while DSW doesn't (since it would be both pointless and costly, given its design).
The upside with DSW-style implementation is that it's very simple and efficient, and does not impose any head-of-line blocking (which follows from restoring a total order between dequeue and enqueue). The downside is it does not allow for a scenario where a particular flow is split across different modules, the application performs reordering (e.g., with the dispatcher library) *and* wants to maintain ordering between events pertaining to those "sub flows". I've never come across such a scenario, but it may well exist.
If we fail to make DLB2 and DSW compatible, we'll probably need another flag for DSW, because needlessly imposing a total order DSW does not make a lot of sense.
You may want to add an example as well. And a note on the importance of maintaining impl_opaque between dequeue and enqueue.
Quoted 6 lines
lib/eventdev/rte_eventdev.h +3
-0+* @see rte_event_port_setup() +*/ +/** Event port configuration structure */ struct rte_event_port_conf {int32_t new_event_threshold;
RE: [PATCH v3 2/2] eventdev: add support for enqueue reorder
Quoted 5 lines
+ Add a device-level
+RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ
+ as well.
+ The documentation of that flag should probably house the detailed description of this feature.
So, this capability will be advertised by DSW and DLB devices with detailed documentation.
Quoted 7 lines
+ Here's how I would describe this feature:
+ #define
RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ(1ULL << 5)(quoted diff) +3
-0+/**< Flag to enable independent enqueue. Must be unset if the device + * is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature + * allows an application to enqueue RTE_EVENT_OP_FORWARD or
Review
Quoted 10 lines
(quoted diff) +9
-0+ * RTE_EVENT_OP_RELEASE in an order different than the order the + * events were dequeued from the event device, while maintaining + * RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. + * + * If the application wish to change the order of two events *within + * a flow*, it must both change the enqueue order and exchange the + * impl_opaque field, to be portable across all event devices. + */ +That second paragraph allows DSW to support this feature without modification since this is the only difference between DSW-style independent enqueue and DLB enqueue reordering. DLB will restore a total order, while DSW doesn't (since it would be both pointless and costly, given its design).
Can we skip mentioning this mechanism to change the order of any two events intentionally? For DLB, those two events should have been received from the same queue and, if atomic, with the same atomic flow ID. If there is no use case, we can skip it to avoid confusion.
Review
Quoted 3 lines
(quoted diff) +2
-0+The upside with DSW-style implementation is that it's very simple and efficient, and does not impose any head-of-line blocking (which follows from restoring a total order between dequeue and enqueue). The downside is it does not allow for a scenario where a particular flow is split across different modules, the application performs reordering >+(e.g., with the dispatcher library) *and* wants to maintain ordering between events pertaining to those "sub flows". I've never come across such a scenario, but it may well exist. +If we fail to make DLB2 and DSW compatible, we'll probably need another flag for DSW, because needlessly imposing a total order DSW does not make a lot of sense.
If the device has the capability to support independent enqueue, it should enable it on applicable ports using the RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ flag. Some devices like DSW will not do any reordering inside as they can support it without changing the order whereas devices like DLB which depend on order will reorder events inside their PMD.
Quoted 1 line
+You may want to add an example as well. And a note on the importance of maintaining
impl_opaquebetween dequeue and enqueue.
We will consider this a separate patch later with an example based on the dispatcher library, which can work with DSW and DLB. Is the port provided to rte_dispatcher_bind_port_to_lcore() already set up by the application? In that case configuring this feature on the port becomes part of the application.
Quoted 6 lines
+ * @see
rte_event_port_setup()
+ */
+
/** Event port configuration structure */
structrte_event_port_conf{
int32_tnew_event_threshold;
RE: [PATCH v3 2/2] eventdev: add support for enqueue reorder
Quoted 5 lines
+ Add a device-level
+RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ
+ as well.
+ The documentation of that flag should probably house the detailed description of this feature.
So, this capability will be advertised by DSW and DLB devices with detailed documentation. What about DPAA and OPDL devices supporting burst mode? Do these support independent enqueue ?
v4 cover Independent Enqueue Support
In reply to Abdullah Sevincerv4: Address comments
v3: Fix CI/build issues
v2: Fix CI/build issues
v1: Initial patchset
Abdullah Sevincer (3):
event/dlb2: add support for independent enqueue
eventdev: add support for independent enqueue event/dsw: add capability for independent enqueue
doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_07.rst | 11 + drivers/event/dlb2/dlb2.c | 492 ++++++++++++++-------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 10 + drivers/event/dsw/dsw_evdev.c | 3 +- lib/eventdev/rte_eventdev.h | 21 + 10 files changed, 408 insertions(+), 191 deletions(-)
Signature · 1 line
2.25.1
PATCH v4 1/3 event/dlb2: add support for independent enqueue
DLB devices need events to be enqueued in the same order they are dequeued. Applications are not suppose to change event order between dequeue and to enqueue. Since Eventdev standard does not add such restrictions independent enqueue support is needed for DLB PMD so that it restores dequeue order on enqueue if applications happen to change it. It also adds missing releases in places where events are dropped by the application and it expects implicit release to handle it.
By default the feature will be off on all DLB ports and they will behave the same as older releases. To enable reordering feature, applications need to add the flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ to port configuration if only the device advertises the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ.
--- doc/guides/rel_notes/release_24_07.rst | 6 + drivers/event/dlb2/dlb2.c | 492 ++++++++++++++++--------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 10 + 6 files changed, 378 insertions(+), 190 deletions(-)
doc/guides/rel_notes/release_24_07.rst +6 -0
@@ -156,6 +156,12 @@ New Features * Added defer queue reclamation via RCU. * Added SVE support for bulk lookup. +* **Updated DLB2 Driver for independent enqueue feature** + * Added support for DLB independent enqueue feature. Applications should use + ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability + ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. + + Removed Items -------------
drivers/event/dlb2/dlb2.c +322 -170
691 lines not on this page · raw message
drivers/event/dlb2/dlb2_avx512.c +14 -13
@@ -151,20 +151,20 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port,*/ #define DLB2_QE_EV_TYPE_WORD 0 sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[0 ].sub_event_type <<8 | - ev[0 ].event_type, + ev[0 ].sub_event_type <<4 | + ev[0 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[1 ].sub_event_type <<8 | - ev[1 ].event_type, + ev[1 ].sub_event_type <<4 | + ev[1 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[2 ].sub_event_type <<8 | - ev[2 ].event_type, + ev[2 ].sub_event_type <<4 | + ev[2 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[3 ].sub_event_type <<8 | - ev[3 ].event_type, + ev[3 ].sub_event_type <<4 | + ev[3 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 );if (qm_port->use_avx512) {
@@ -238,11 +238,11 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, }/* will only be set for DLB 2.5 + */ -if (qm_port->cq_weight) { - qe[0 ].weight = ev[0 ].impl_opaque &3 ; - qe[1 ].weight = ev[1 ].impl_opaque &3 ; - qe[2 ].weight = ev[2 ].impl_opaque &3 ; - qe[3 ].weight = ev[3 ].impl_opaque &3 ; +if (qm_port->dlb2->enable_cq_weight) { + qe[0 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[0 ]); + qe[1 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[1 ]); + qe[2 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[2 ]); + qe[3 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[3 ]); }break ;
@@ -267,6 +267,7 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, } qe[i].u.event_type.major = ev[i].event_type; qe[i].u.event_type.sub = ev[i].sub_event_type; + qe[i].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[i]); }break ;case 0 :
drivers/event/dlb2/dlb2_inline_fns.h +8 -0
@@ -32,4 +32,12 @@ dlb2_movdir64b(void *dest, void *src) : "a" (dest), "d" (src)); } +static inline void +dlb2_movdir64b_single (void *pp_addr,void *qe4) +{ + asmvolatile (".byte 0x66, 0x0f, 0x38, 0xf8, 0x02" + : + :"a" (pp_addr),"d" (qe4)); +} +#endif /* _DLB2_INLINE_FNS_H_ */
drivers/event/dlb2/dlb2_priv.h +18 -7
@@ -29,7 +29,8 @@#define DLB2_SW_CREDIT_C_QUANTA_DEFAULT 256/* Consumer */ #define DLB2_DEPTH_THRESH_DEFAULT 256#define DLB2_MIN_CQ_DEPTH_OVERRIDE 32 -#define DLB2_MAX_CQ_DEPTH_OVERRIDE 128 +#define DLB2_MAX_CQ_DEPTH_OVERRIDE 1024 +#define DLB2_MAX_CQ_DEPTH_REORDER 128#define DLB2_MIN_ENQ_DEPTH_OVERRIDE 32#define DLB2_MAX_ENQ_DEPTH_OVERRIDE 1024
@@ -387,8 +388,23 @@ struct dlb2_port {bool use_scalar;/* force usage of scalar code */ uint16_t hw_credit_quanta;bool use_avx512; -uint32_t cq_weight;bool is_producer;/* True if port is of type producer */ +uint8_t reorder_id;/* id used for reordering events coming back into the scheduler */ +bool reorder_en; +struct dlb2_reorder *order;/* For ordering enqueues */ +}; + +struct dlb2_reorder { +/* a reorder buffer for events coming back in different order from dequeue +* We use UINT8_MAX + 1 elements, but add on three no-ops to make movdirs easier at the end +*/ +union { +__m128i m128; +struct dlb2_enqueue_qe qe; +uint64_t u64[2 ]; + } enq_reorder[UINT8_MAX +4 ]; +/* id of the next entry in the reorder enqueue ring to send in */ +uint8_t next_to_enqueue; };/* Per-process per-port mmio and memory pointers */
@@ -642,10 +658,6 @@ struct dlb2_qid_depth_thresholds {int val[DLB2_MAX_NUM_QUEUES_ALL ]; }; -struct dlb2_cq_weight { -int limit[DLB2_MAX_NUM_PORTS_ALL ]; -}; -struct dlb2_port_cos {int cos_id[DLB2_MAX_NUM_PORTS_ALL ]; };
@@ -667,7 +679,6 @@ struct dlb2_devargs {bool vector_opts_enabled;int max_cq_depth;int max_enq_depth; -struct dlb2_cq_weight cq_weight;struct dlb2_port_cos port_cos;struct dlb2_cos_bw cos_bw;const char *producer_coremask;
drivers/event/dlb2/rte_pmd_dlb2.h +10 -0
@@ -19,6 +19,16 @@ extern "C" {#include <rte_compat.h> +/** +* Macros to get/set QID depth and QE weight from rte_event metadata. +* Currently 'rsvd' field is used for these. Lower 2 bits are used to store +* QID depth while the upper 2 bits are used for QER weight. +*/ +#define RTE_PMD_DLB2_GET_QID_DEPTH (x) ((x)->rsvd & 0x3) +#define RTE_PMD_DLB2_SET_QID_DEPTH (x, v) ((x)->rsvd = ((x)->rsvd & ~0x3) | (v & 0x3)) +#define RTE_PMD_DLB2_GET_QE_WEIGHT (x) (((x)->rsvd >> 2) & 0x3) +#define RTE_PMD_DLB2_SET_QE_WEIGHT (x, v) ((x)->rsvd = ((x)->rsvd & 0x3) | ((v & 0x3) << 2)) +/** * @warning * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
Signature · 1 line
2.25.1
PATCH v4 2/3 eventdev: add support for independent enqueue
In reply to Abdullah SevincerThis commit adds support for independent enqueue feature and updates Event Device and PMD feature list.
A new capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ is introduced to support independent enqueue to support PMD to enqueue in any order even the underlined hardware device needs enqueues in a strict dequeue order.
To use this capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists.
--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_07.rst | 4 +++- lib/eventdev/rte_eventdev.h | 21 +++++++++++++++++++++ 4 files changed, 26 insertions(+), 1 deletion(-)
doc/guides/eventdevs/features/default.ini +1 -0
@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.
doc/guides/eventdevs/features/dlb2.ini +1 -0
@@ -15,6 +15,7 @@ implicit_release_disable = Y runtime_port_link = Y multiple_queue_port = Y maintenance_free = Y +independent_enq = Y [Eth Rx adapter Features]
doc/guides/rel_notes/release_24_07.rst +3 -1
@@ -161,7 +161,9 @@ New Features ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. - +* **Updated Event Device Library for independent enqueue feature** + * Added support for independent enqueue feature. Updated Event Device and + PMD feature list. Removed Items -------------
lib/eventdev/rte_eventdev.h +21 -0
@@ -446,6 +446,17 @@ struct rte_event;* @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ (1ULL << 16) +/**< Event device is capable of independent enqueue. +* When this flag is set, the application can enqueue to PMD in any order even +* the underlined hardware device needs enqueues in a strict dequeue order. +* PMD will reorder enqueued events based on their dequeue order when the feature +* is enabled on an Eventdev port. The capability supports applications that sort +* received bursts based on criteria like flow-id or receive QID and process them +* in smaller groups. Each processed group is enqueued separately, changing the +* dequeue order. +*/ +/* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0/**< Highest priority level for events and queues.
@@ -1072,6 +1083,16 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* * @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) +/**< Flag to enable independent enqueue. Must not be set if the device +* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature +* allows an application to enqueue RTE_EVENT_OP_FORWARD or +* RTE_EVENT_OP_RELEASE in an order different than the order the +* events were dequeued from the event device, while maintaining +* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. +* +* @see rte_event_port_setup() +*/ /** Event port configuration structure */ struct rte_event_port_conf {
Signature · 1 line
2.25.1
PATCH v4 3/3 event/dsw: add capability for independent enqueue
In reply to Abdullah SevincerTo use independent enqueue capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists. Hence, this commit adds the capability of independent enqueue to the DSW driver.
--- doc/guides/rel_notes/release_24_07.rst | 3 +++ drivers/event/dsw/dsw_evdev.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-)
doc/guides/rel_notes/release_24_07.rst +3 -0
@@ -165,6 +165,9 @@ New Features * Added support for independent enqueue feature. Updated Event Device and PMD feature list. +* **Updated DSW Driver for independent enqueue feature** + * Added capability flag for DSW to advertise independent enqueue feature. + Removed Items -------------
drivers/event/dsw/dsw_evdev.c +2 -1
@@ -230,7 +230,8 @@ dsw_info_get(struct rte_eventdev *dev __rte_unused,RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE |RTE_EVENT_DEV_CAP_NONSEQ_MODE |RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT | - RTE_EVENT_DEV_CAP_CARRY_FLOW_ID +RTE_EVENT_DEV_CAP_CARRY_FLOW_ID | + RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ }; }
Signature · 1 line
2.25.1
v5 cover Independent Enqueue Support
In reply to Abdullah Sevincerv5: Address build issues
v4: Address comments
v3: Fix CI/build issues
v2: Fix CI/build issues
v1: Initial patchset
Abdullah Sevincer (3):
event/dlb2: add support for independent enqueue
eventdev: add support for independent enqueue event/dsw: add capability for independent enqueue
doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_07.rst | 15 + drivers/event/dlb2/dlb2.c | 492 ++++++++++++++-------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 10 + drivers/event/dsw/dsw_evdev.c | 3 +- lib/eventdev/rte_eventdev.h | 21 + 10 files changed, 412 insertions(+), 191 deletions(-)
Signature · 1 line
2.25.1
PATCH v5 1/3 event/dlb2: add support for independent enqueue
DLB devices need events to be enqueued in the same order they are dequeued. Applications are not suppose to change event order between dequeue and to enqueue. Since Eventdev standard does not add such restrictions independent enqueue support is needed for DLB PMD so that it restores dequeue order on enqueue if applications happen to change it. It also adds missing releases in places where events are dropped by the application and it expects implicit release to handle it.
By default the feature will be off on all DLB ports and they will behave the same as older releases. To enable reordering feature, applications need to add the flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ to port configuration if only the device advertises the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ.
--- doc/guides/rel_notes/release_24_07.rst | 6 + drivers/event/dlb2/dlb2.c | 492 ++++++++++++++++--------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 10 + 6 files changed, 378 insertions(+), 190 deletions(-)
doc/guides/rel_notes/release_24_07.rst +6 -0
@@ -156,6 +156,12 @@ New Features * Added defer queue reclamation via RCU. * Added SVE support for bulk lookup. +* **Updated DLB2 Driver for independent enqueue feature** + + Added support for DLB independent enqueue feature. Applications should use + ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability + ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. + Removed Items -------------
drivers/event/dlb2/dlb2.c +322 -170
691 lines not on this page · raw message
drivers/event/dlb2/dlb2_avx512.c +14 -13
@@ -151,20 +151,20 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port,*/ #define DLB2_QE_EV_TYPE_WORD 0 sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[0 ].sub_event_type <<8 | - ev[0 ].event_type, + ev[0 ].sub_event_type <<4 | + ev[0 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[1 ].sub_event_type <<8 | - ev[1 ].event_type, + ev[1 ].sub_event_type <<4 | + ev[1 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[2 ].sub_event_type <<8 | - ev[2 ].event_type, + ev[2 ].sub_event_type <<4 | + ev[2 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[3 ].sub_event_type <<8 | - ev[3 ].event_type, + ev[3 ].sub_event_type <<4 | + ev[3 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 );if (qm_port->use_avx512) {
@@ -238,11 +238,11 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, }/* will only be set for DLB 2.5 + */ -if (qm_port->cq_weight) { - qe[0 ].weight = ev[0 ].impl_opaque &3 ; - qe[1 ].weight = ev[1 ].impl_opaque &3 ; - qe[2 ].weight = ev[2 ].impl_opaque &3 ; - qe[3 ].weight = ev[3 ].impl_opaque &3 ; +if (qm_port->dlb2->enable_cq_weight) { + qe[0 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[0 ]); + qe[1 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[1 ]); + qe[2 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[2 ]); + qe[3 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[3 ]); }break ;
@@ -267,6 +267,7 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, } qe[i].u.event_type.major = ev[i].event_type; qe[i].u.event_type.sub = ev[i].sub_event_type; + qe[i].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[i]); }break ;case 0 :
drivers/event/dlb2/dlb2_inline_fns.h +8 -0
@@ -32,4 +32,12 @@ dlb2_movdir64b(void *dest, void *src) : "a" (dest), "d" (src)); } +static inline void +dlb2_movdir64b_single (void *pp_addr,void *qe4) +{ + asmvolatile (".byte 0x66, 0x0f, 0x38, 0xf8, 0x02" + : + :"a" (pp_addr),"d" (qe4)); +} +#endif /* _DLB2_INLINE_FNS_H_ */
drivers/event/dlb2/dlb2_priv.h +18 -7
@@ -29,7 +29,8 @@#define DLB2_SW_CREDIT_C_QUANTA_DEFAULT 256/* Consumer */ #define DLB2_DEPTH_THRESH_DEFAULT 256#define DLB2_MIN_CQ_DEPTH_OVERRIDE 32 -#define DLB2_MAX_CQ_DEPTH_OVERRIDE 128 +#define DLB2_MAX_CQ_DEPTH_OVERRIDE 1024 +#define DLB2_MAX_CQ_DEPTH_REORDER 128#define DLB2_MIN_ENQ_DEPTH_OVERRIDE 32#define DLB2_MAX_ENQ_DEPTH_OVERRIDE 1024
@@ -387,8 +388,23 @@ struct dlb2_port {bool use_scalar;/* force usage of scalar code */ uint16_t hw_credit_quanta;bool use_avx512; -uint32_t cq_weight;bool is_producer;/* True if port is of type producer */ +uint8_t reorder_id;/* id used for reordering events coming back into the scheduler */ +bool reorder_en; +struct dlb2_reorder *order;/* For ordering enqueues */ +}; + +struct dlb2_reorder { +/* a reorder buffer for events coming back in different order from dequeue +* We use UINT8_MAX + 1 elements, but add on three no-ops to make movdirs easier at the end +*/ +union { +__m128i m128; +struct dlb2_enqueue_qe qe; +uint64_t u64[2 ]; + } enq_reorder[UINT8_MAX +4 ]; +/* id of the next entry in the reorder enqueue ring to send in */ +uint8_t next_to_enqueue; };/* Per-process per-port mmio and memory pointers */
@@ -642,10 +658,6 @@ struct dlb2_qid_depth_thresholds {int val[DLB2_MAX_NUM_QUEUES_ALL ]; }; -struct dlb2_cq_weight { -int limit[DLB2_MAX_NUM_PORTS_ALL ]; -}; -struct dlb2_port_cos {int cos_id[DLB2_MAX_NUM_PORTS_ALL ]; };
@@ -667,7 +679,6 @@ struct dlb2_devargs {bool vector_opts_enabled;int max_cq_depth;int max_enq_depth; -struct dlb2_cq_weight cq_weight;struct dlb2_port_cos port_cos;struct dlb2_cos_bw cos_bw;const char *producer_coremask;
drivers/event/dlb2/rte_pmd_dlb2.h +10 -0
@@ -19,6 +19,16 @@ extern "C" {#include <rte_compat.h> +/** +* Macros to get/set QID depth and QE weight from rte_event metadata. +* Currently 'rsvd' field is used for these. Lower 2 bits are used to store +* QID depth while the upper 2 bits are used for QER weight. +*/ +#define RTE_PMD_DLB2_GET_QID_DEPTH (x) ((x)->rsvd & 0x3) +#define RTE_PMD_DLB2_SET_QID_DEPTH (x, v) ((x)->rsvd = ((x)->rsvd & ~0x3) | (v & 0x3)) +#define RTE_PMD_DLB2_GET_QE_WEIGHT (x) (((x)->rsvd >> 2) & 0x3) +#define RTE_PMD_DLB2_SET_QE_WEIGHT (x, v) ((x)->rsvd = ((x)->rsvd & 0x3) | ((v & 0x3) << 2)) +/** * @warning * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
Signature · 1 line
2.25.1
PATCH v5 2/3 eventdev: add support for independent enqueue
In reply to Abdullah SevincerThis commit adds support for independent enqueue feature and updates Event Device and PMD feature list.
A new capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ is introduced to support independent enqueue to support PMD to enqueue in any order even the underlined hardware device needs enqueues in a strict dequeue order.
To use this capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists.
--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_07.rst | 5 +++++ lib/eventdev/rte_eventdev.h | 21 +++++++++++++++++++++ 4 files changed, 28 insertions(+)
doc/guides/eventdevs/features/default.ini +1 -0
@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.
doc/guides/eventdevs/features/dlb2.ini +1 -0
@@ -15,6 +15,7 @@ implicit_release_disable = Y runtime_port_link = Y multiple_queue_port = Y maintenance_free = Y +independent_enq = Y [Eth Rx adapter Features]
doc/guides/rel_notes/release_24_07.rst +5 -0
@@ -162,6 +162,11 @@ New Features ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. +* **Updated Event Device Library for independent enqueue feature** + + * Added support for independent enqueue feature. Updated Event Device and + PMD feature list. + Removed Items -------------
lib/eventdev/rte_eventdev.h +21 -0
@@ -446,6 +446,17 @@ struct rte_event;* @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ (1ULL << 16) +/**< Event device is capable of independent enqueue. +* When this flag is set, the application can enqueue to PMD in any order even +* the underlined hardware device needs enqueues in a strict dequeue order. +* PMD will reorder enqueued events based on their dequeue order when the feature +* is enabled on an Eventdev port. The capability supports applications that sort +* received bursts based on criteria like flow-id or receive QID and process them +* in smaller groups. Each processed group is enqueued separately, changing the +* dequeue order. +*/ +/* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0/**< Highest priority level for events and queues.
@@ -1072,6 +1083,16 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* * @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) +/**< Flag to enable independent enqueue. Must not be set if the device +* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature +* allows an application to enqueue RTE_EVENT_OP_FORWARD or +* RTE_EVENT_OP_RELEASE in an order different than the order the +* events were dequeued from the event device, while maintaining +* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. +* +* @see rte_event_port_setup() +*/ /** Event port configuration structure */ struct rte_event_port_conf {
Signature · 1 line
2.25.1
PATCH v5 3/3 event/dsw: add capability for independent enqueue
In reply to Abdullah SevincerTo use independent enqueue capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists. Hence, this commit adds the capability of independent enqueue to the DSW driver.
--- doc/guides/rel_notes/release_24_07.rst | 4 ++++ drivers/event/dsw/dsw_evdev.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-)
doc/guides/rel_notes/release_24_07.rst +4 -0
@@ -167,6 +167,10 @@ New Features * Added support for independent enqueue feature. Updated Event Device and PMD feature list. +* **Updated DSW Driver for independent enqueue feature** + + * Added capability flag for DSW to advertise independent enqueue feature. + Removed Items -------------
drivers/event/dsw/dsw_evdev.c +2 -1
@@ -230,7 +230,8 @@ dsw_info_get(struct rte_eventdev *dev __rte_unused,RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE |RTE_EVENT_DEV_CAP_NONSEQ_MODE |RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT | - RTE_EVENT_DEV_CAP_CARRY_FLOW_ID +RTE_EVENT_DEV_CAP_CARRY_FLOW_ID | + RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ }; }
Signature · 1 line
2.25.1
v6 cover Independent Enqueue Support
In reply to Abdullah Sevincerv6: Update patch with more documentation
v5: Address build issues
v4: Address comments
v3: Fix CI/build issues
v2: Fix CI/build issues
v1: Initial patchset
Abdullah Sevincer (3):
event/dlb2: add support for independent enqueue
eventdev: add support for independent enqueue event/dsw: add capability for independent enqueue
doc/guides/eventdevs/dlb2.rst | 41 ++ doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_07.rst | 15 + drivers/event/dlb2/dlb2.c | 492 ++++++++++++++-------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 10 + drivers/event/dsw/dsw_evdev.c | 3 +- lib/eventdev/rte_eventdev.h | 36 ++ 11 files changed, 468 insertions(+), 191 deletions(-)
Signature · 1 line
2.25.1
PATCH v6 1/3 event/dlb2: add support for independent enqueue
DLB devices need events to be enqueued in the same order they are dequeued. Applications are not suppose to change event order between dequeue and to enqueue. Since Eventdev standard does not add such restrictions independent enqueue support is needed for DLB PMD so that it restores dequeue order on enqueue if applications happen to change it. It also adds missing releases in places where events are dropped by the application and it expects implicit release to handle it.
By default the feature will be off on all DLB ports and they will behave the same as older releases. To enable reordering feature, applications need to add the flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ to port configuration if only the device advertises the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ.
--- doc/guides/eventdevs/dlb2.rst | 41 +++ doc/guides/rel_notes/release_24_07.rst | 6 + drivers/event/dlb2/dlb2.c | 492 ++++++++++++++++--------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 10 + 7 files changed, 419 insertions(+), 190 deletions(-)
doc/guides/eventdevs/dlb2.rst +41 -0
@@ -456,6 +456,47 @@ Example command to enable QE Weight feature: --allow ea:00.0,enable_cq_weight=<y/Y> +Independent Enqueue Capability +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +DLB2 hardware device expects all forwarded events to be enqueued in the same +order as they are dequeued. For dropped events, their releases should come at +the same location as the original event was expected. Hardware has this +restriction as it uses the order to retrieve information about the original +event that was sent to the CPU. This contains information like atomic flow +ID to release the flow lock and ordered events sequence number to restore the +original order. + +Some applications, like those based on the DPDK dispatcher library, want +enqueue order independence. To support this, DLB2 PMD supports the +``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` capability. + +This capability applies to Eventdevs supporting burst mode. On ports where +the application is going to change enqueue order, +``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ `` support should be enabled. + +Example code to inform PMD that the application plans to use independent enqueue +order on a port: + + .. code-block:: c + + if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) + port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; + +This code example enables enqueue event reordering inside DLB2 PMD before the events +are sent to the DLB2 hardware. If the application is not going to change the enqueue +order, this flag should not be enabled to get better performance. DLB2 PMD saves +ordering information inside the impl_opaque field of the event, and this field should +be preserved for all FORWARD or RELEASE events. Following MACROs are provided to get +and set this field inside the event in case the same event is not used for forwarding +(e.g., a new RELEASE event is created when the original event is dropped instead of +reusing the same event). + + .. code-block:: c + + #define RTE_EVENT_GET_IMPL_OPAQUE(ev) (ev->impl_opaque) + #define RTE_EVENT_SET_IMPL_OPAQUE(ev, val) (ev->impl_opaque = val) + Running Eventdev Applications with DLB Device ---------------------------------------------
doc/guides/rel_notes/release_24_07.rst +6 -0
@@ -156,6 +156,12 @@ New Features * Added defer queue reclamation via RCU. * Added SVE support for bulk lookup. +* **Updated DLB2 Driver for independent enqueue feature** + + Added support for DLB independent enqueue feature. Applications should use + ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability + ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. + Removed Items -------------
drivers/event/dlb2/dlb2.c +322 -170
691 lines not on this page · raw message
drivers/event/dlb2/dlb2_avx512.c +14 -13
@@ -151,20 +151,20 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port,*/ #define DLB2_QE_EV_TYPE_WORD 0 sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[0 ].sub_event_type <<8 | - ev[0 ].event_type, + ev[0 ].sub_event_type <<4 | + ev[0 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[1 ].sub_event_type <<8 | - ev[1 ].event_type, + ev[1 ].sub_event_type <<4 | + ev[1 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[2 ].sub_event_type <<8 | - ev[2 ].event_type, + ev[2 ].sub_event_type <<4 | + ev[2 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[3 ].sub_event_type <<8 | - ev[3 ].event_type, + ev[3 ].sub_event_type <<4 | + ev[3 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 );if (qm_port->use_avx512) {
@@ -238,11 +238,11 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, }/* will only be set for DLB 2.5 + */ -if (qm_port->cq_weight) { - qe[0 ].weight = ev[0 ].impl_opaque &3 ; - qe[1 ].weight = ev[1 ].impl_opaque &3 ; - qe[2 ].weight = ev[2 ].impl_opaque &3 ; - qe[3 ].weight = ev[3 ].impl_opaque &3 ; +if (qm_port->dlb2->enable_cq_weight) { + qe[0 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[0 ]); + qe[1 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[1 ]); + qe[2 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[2 ]); + qe[3 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[3 ]); }break ;
@@ -267,6 +267,7 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, } qe[i].u.event_type.major = ev[i].event_type; qe[i].u.event_type.sub = ev[i].sub_event_type; + qe[i].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[i]); }break ;case 0 :
drivers/event/dlb2/dlb2_inline_fns.h +8 -0
@@ -32,4 +32,12 @@ dlb2_movdir64b(void *dest, void *src) : "a" (dest), "d" (src)); } +static inline void +dlb2_movdir64b_single (void *pp_addr,void *qe4) +{ + asmvolatile (".byte 0x66, 0x0f, 0x38, 0xf8, 0x02" + : + :"a" (pp_addr),"d" (qe4)); +} +#endif /* _DLB2_INLINE_FNS_H_ */
drivers/event/dlb2/dlb2_priv.h +18 -7
@@ -29,7 +29,8 @@#define DLB2_SW_CREDIT_C_QUANTA_DEFAULT 256/* Consumer */ #define DLB2_DEPTH_THRESH_DEFAULT 256#define DLB2_MIN_CQ_DEPTH_OVERRIDE 32 -#define DLB2_MAX_CQ_DEPTH_OVERRIDE 128 +#define DLB2_MAX_CQ_DEPTH_OVERRIDE 1024 +#define DLB2_MAX_CQ_DEPTH_REORDER 128#define DLB2_MIN_ENQ_DEPTH_OVERRIDE 32#define DLB2_MAX_ENQ_DEPTH_OVERRIDE 1024
@@ -387,8 +388,23 @@ struct dlb2_port {bool use_scalar;/* force usage of scalar code */ uint16_t hw_credit_quanta;bool use_avx512; -uint32_t cq_weight;bool is_producer;/* True if port is of type producer */ +uint8_t reorder_id;/* id used for reordering events coming back into the scheduler */ +bool reorder_en; +struct dlb2_reorder *order;/* For ordering enqueues */ +}; + +struct dlb2_reorder { +/* a reorder buffer for events coming back in different order from dequeue +* We use UINT8_MAX + 1 elements, but add on three no-ops to make movdirs easier at the end +*/ +union { +__m128i m128; +struct dlb2_enqueue_qe qe; +uint64_t u64[2 ]; + } enq_reorder[UINT8_MAX +4 ]; +/* id of the next entry in the reorder enqueue ring to send in */ +uint8_t next_to_enqueue; };/* Per-process per-port mmio and memory pointers */
@@ -642,10 +658,6 @@ struct dlb2_qid_depth_thresholds {int val[DLB2_MAX_NUM_QUEUES_ALL ]; }; -struct dlb2_cq_weight { -int limit[DLB2_MAX_NUM_PORTS_ALL ]; -}; -struct dlb2_port_cos {int cos_id[DLB2_MAX_NUM_PORTS_ALL ]; };
@@ -667,7 +679,6 @@ struct dlb2_devargs {bool vector_opts_enabled;int max_cq_depth;int max_enq_depth; -struct dlb2_cq_weight cq_weight;struct dlb2_port_cos port_cos;struct dlb2_cos_bw cos_bw;const char *producer_coremask;
drivers/event/dlb2/rte_pmd_dlb2.h +10 -0
@@ -19,6 +19,16 @@ extern "C" {#include <rte_compat.h> +/** +* Macros to get/set QID depth and QE weight from rte_event metadata. +* Currently 'rsvd' field is used for these. Lower 2 bits are used to store +* QID depth while the upper 2 bits are used for QER weight. +*/ +#define RTE_PMD_DLB2_GET_QID_DEPTH (x) ((x)->rsvd & 0x3) +#define RTE_PMD_DLB2_SET_QID_DEPTH (x, v) ((x)->rsvd = ((x)->rsvd & ~0x3) | (v & 0x3)) +#define RTE_PMD_DLB2_GET_QE_WEIGHT (x) (((x)->rsvd >> 2) & 0x3) +#define RTE_PMD_DLB2_SET_QE_WEIGHT (x, v) ((x)->rsvd = ((x)->rsvd & 0x3) | ((v & 0x3) << 2)) +/** * @warning * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
Signature · 1 line
2.25.1
PATCH v6 2/3 eventdev: add support for independent enqueue
In reply to Abdullah SevincerThis commit adds support for independent enqueue feature and updates Event Device and PMD feature list.
A new capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ is introduced to support independent enqueue to support PMD to enqueue in any order even the underlined hardware device needs enqueues in a strict dequeue order.
To use this capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists.
--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_07.rst | 5 ++++ lib/eventdev/rte_eventdev.h | 36 +++++++++++++++++++++++ 4 files changed, 43 insertions(+)
doc/guides/eventdevs/features/default.ini +1 -0
@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.
doc/guides/eventdevs/features/dlb2.ini +1 -0
@@ -15,6 +15,7 @@ implicit_release_disable = Y runtime_port_link = Y multiple_queue_port = Y maintenance_free = Y +independent_enq = Y [Eth Rx adapter Features]
doc/guides/rel_notes/release_24_07.rst +5 -0
@@ -162,6 +162,11 @@ New Features ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. +* **Updated Event Device Library for independent enqueue feature** + + * Added support for independent enqueue feature. Updated Event Device and + PMD feature list. + Removed Items -------------
lib/eventdev/rte_eventdev.h +36 -0
@@ -446,6 +446,30 @@ struct rte_event;* @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ (1ULL << 16) +/**< Event device is capable of independent enqueue. +* A new capability, RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, will indicate that Eventdev +* supports the enqueue in any order or specifically in a different order than the +* dequeue. Eventdev PMD can either transmit events in the changed order in which +* they are enqueued or restore the original order before sending them to the +* underlying hardware device. A flag is provided during the port configuration to +* inform Eventdev PMD that the application intends to use an independent enqueue +* order on a particular port. Note that this capability only matters for Eventdevs +* supporting burst mode. +* +* To Inform PMD that the application plans to use independent enqueue order on a port +* this code example can be used: +* +* if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) +* port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; +* +* When an implicit release is enabled on a port, Eventdev PMD will also handle +* the insertion of RELEASE events in place of dropped events. The order restoration +* only applies to FORWARD and RELEASE events. New events (op=RTE_EVENT_OP_NEW) will +* be transmitted in the order the application enqueues them. New events do not +* maintain any order relative to FORWARD/RELEASE events. +*/ +/* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0/**< Highest priority level for events and queues.
@@ -1072,6 +1096,18 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* * @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) +/**< Flag to enable independent enqueue. Must not be set if the device +* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature +* allows an application to enqueue RTE_EVENT_OP_FORWARD or +* RTE_EVENT_OP_RELEASE in an order different than the order the +* events were dequeued from the event device, while maintaining +* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. +* +* Note that this flag only matters for Eventdevs supporting burst mode. +* +* @see rte_event_port_setup() +*/ /** Event port configuration structure */ struct rte_event_port_conf {
Signature · 1 line
2.25.1
Re: [PATCH v6 2/3] eventdev: add support for independent enqueue
Quoted 77 lines · Abdullah Sevincer
This commit adds support for independent enqueue feature and updates Event Device and PMD feature list.
A new capability
RTE_EVENT_DEV_CAP_INDEPENDENT_ENQis introduced to support independent enqueue to support PMD to enqueue in any order even the underlined hardware device needs enqueues in a strict dequeue order.To use this capability applications need to set flag
RTE_EVENT_PORT_CFG_INDEPENDENT_ENQduring port setup only if the capabilityRTE_EVENT_DEV_CAP_INDEPENDENT_ENQexists.Signed-off-by Abdullah Sevincer <[email protected]>--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_07.rst | 5 ++++ lib/eventdev/rte_eventdev.h | 36 +++++++++++++++++++++++ 4 files changed, 43 insertions(+)doc/guides/eventdevs/features/default.ini +1
-0@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.doc/guides/eventdevs/features/dlb2.ini +1
-0@@ -15,6 +15,7 @@ implicit_release_disable = Y runtime_port_link = Y multiple_queue_port = Y maintenance_free = Y +independent_enq = Y [Eth Rx adapter Features]doc/guides/rel_notes/release_24_07.rst +5
-0@@ -162,6 +162,11 @@ New Features ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. +* **Updated Event Device Library for independent enqueue feature** + + * Added support for independent enqueue feature. Updated Event Device and + PMD feature list. + Removed Items -------------lib/eventdev/rte_eventdev.h +9
-0@@ -446,6 +446,30 @@ struct rte_event;* @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ (1ULL << 16) +/**< Event device is capable of independent enqueue. +* A new capability, RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, will indicate that Eventdev +* supports the enqueue in any order or specifically in a different order than the +* dequeue. Eventdev PMD can either transmit events in the changed order in which +* they are enqueued or restore the original order before sending them to the +* underlying hardware device. A flag is provided during the port configuration to +* inform Eventdev PMD that the application intends to use an independent enqueue +* order on a particular port. Note that this capability only matters for Eventdevs
lib/eventdev/rte_eventdev.h struct rte_event; · line 467
Quoted 10 lines
lib/eventdev/rte_eventdev.h +10
-0+* supporting burst mode. +* +* To Inform PMD that the application plans to use independent enqueue order on a port +* this code example can be used: +* +* if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) +* port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; +* +* When an implicit release is enabled on a port, Eventdev PMD will also handle +* the insertion of RELEASE events in place of dropped events. The order restoration
"The independent enqueue feature only applies to /../" maybe?
lib/eventdev/rte_eventdev.h struct rte_event; · line 470
Quoted 3 lines
lib/eventdev/rte_eventdev.h +3
-0+* only applies to FORWARD and RELEASE events. New events (op=RTE_EVENT_OP_NEW) will +* be transmitted in the order the application enqueues them. New events do not +* maintain any order relative to FORWARD/RELEASE events.
Is FORWARD<->NEW relaxed ordering specific to ports which has enabled RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ?
If not, that information should probably be somewhere else.
Either way,
Quoted 24 lines
lib/eventdev/rte_eventdev.h +14
-0+*/ +/* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0/**< Highest priority level for events and queues. @@ -1072,6 +1096,18 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* * @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) +/**< Flag to enable independent enqueue. Must not be set if the device +* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature +* allows an application to enqueue RTE_EVENT_OP_FORWARD or +* RTE_EVENT_OP_RELEASE in an order different than the order the +* events were dequeued from the event device, while maintaining +* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. +* +* Note that this flag only matters for Eventdevs supporting burst mode. +* +* @see rte_event_port_setup() +*/ /** Event port configuration structure */ struct rte_event_port_conf {
RE: [PATCH v6 2/3] eventdev: add support for independent enqueue
Quoted 107 lines · Abdullah Sevincer
Quoted 52 lines
This commit adds support for independent enqueue feature and updates Event Device and PMD feature list.
A new capability
RTE_EVENT_DEV_CAP_INDEPENDENT_ENQis introduced to support independent enqueue to support PMD to enqueue in any order even the underlined hardware device needs enqueues in a strict dequeue order.To use this capability applications need to set flag
RTE_EVENT_PORT_CFG_INDEPENDENT_ENQduring port setup only if the capabilityRTE_EVENT_DEV_CAP_INDEPENDENT_ENQexists.Signed-off-by Abdullah Sevincer <[email protected]>--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_07.rst | 5 ++++ lib/eventdev/rte_eventdev.h | 36 +++++++++++++++++++++++ 4 files changed, 43 insertions(+)doc/guides/eventdevs/features/default.ini +1
-0@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.doc/guides/eventdevs/features/dlb2.ini +1
-0@@ -15,6 +15,7 @@ implicit_release_disable = Y runtime_port_link = Y multiple_queue_port = Y maintenance_free = Y +independent_enq = Y [Eth Rx adapter Features]doc/guides/rel_notes/release_24_07.rst +0
-0doc/guides/rel_notes/release_24_07.rst New Features · line 162
Quoted 1 line
doc/guides/rel_notes/release_24_07.rst +0
-0@@ -162,6 +162,11 @@ New Features ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if thecapability
doc/guides/rel_notes/release_24_07.rst New Features
Quoted 5 lines
doc/guides/rel_notes/release_24_07.rst +3
-0``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. +* **Updated Event Device Library for independent enqueue feature** + + * Added support for independent enqueue feature. Updated Event Deviceand
Quoted 27 lines
doc/guides/rel_notes/release_24_07.rst +2
-0+ PMD feature list. + Removed Items -------------lib/eventdev/rte_eventdev.h +14
-0@@ -446,6 +446,30 @@ struct rte_event;* @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ (1ULL << 16)/**< Event +device is capable of independent enqueue. +* A new capability, RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, will indicate +that Eventdev +* supports the enqueue in any order or specifically in a different +order than the +* dequeue. Eventdev PMD can either transmit events in the changed +order in which +* they are enqueued or restore the original order before sending +them to the +* underlying hardware device. A flag is provided during the port +configuration to +* inform Eventdev PMD that the application intends to use an +independent enqueue lib/eventdev/rte_eventdev.h struct rte_event; · line 472
Quoted 10 lines
lib/eventdev/rte_eventdev.h +10
-0+ * order on a particular port. Note that this capability only matters +for Eventdevs + * supporting burst mode. + * + * To Inform PMD that the application plans to use independent +enqueue order on a port + * this code example can be used: + * + * if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) + * port_config = port_config |
RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ;lib/eventdev/rte_eventdev.h struct rte_event;
Quoted 5 lines
lib/eventdev/rte_eventdev.h +5
-0+* +* When an implicit release is enabled on a port, Eventdev PMD will +also handle +* the insertion of RELEASE events in place of dropped events. The +order restoration "The independent enqueue feature only applies to /../" maybe?
Quoted 8 lines
Quoted 5 lines
+ * only applies to FORWARD and RELEASE events. New events
+ (op=RTE_EVENT_OP_NEW) will
+ * be transmitted in the order the application enqueues them. New
+ events do not
+ * maintain any order relative to FORWARD/RELEASE events.Is FORWARD<->NEW relaxed ordering specific to ports which has enabled
RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ?
Yes. Relaxed ordering only applies to ports with independent enqueue enabled. We will update the documentation.
Quoted 31 lines
If not, that information should probably be somewhere else.
Either way,
Reviewed-by Mattias Rönnblom <[email protected]>lib/eventdev/rte_eventdev.h rte_event_queue_attr_set(uint8_t dev_id, uint8_t
Quoted 6 lines
+ */
lib/eventdev/rte_eventdev.h +1
-0+/* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0/**< Highest priority level for events and queues. @@ -1072,6 +1096,18 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t
queue_id,uint32_tattr_id,Quoted 19 lines
lib/eventdev/rte_eventdev.h +13
-0* * @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) +/**< Flag to enable independent enqueue. Must not be set if the +device +* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature +* allows an application to enqueue RTE_EVENT_OP_FORWARD or +* RTE_EVENT_OP_RELEASE in an order different than the order the +* events were dequeued from the event device, while maintaining +* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. +* +* Note that this flag only matters for Eventdevs supporting burst mode. +* +* @see rte_event_port_setup() +*/ /** Event port configuration structure */ struct rte_event_port_conf {
RE: [PATCH v6 2/3] eventdev: add support for independent enqueue
Thanks,
I have addressed the documentation changes with patch set v8. If it all looks good let me know.
RE: [PATCH v6 2/3] eventdev: add support for independent enqueue
Hi Folks,
Any chance to look at the patches? Don’t want to lose the window for API changes again 😊
v7 cover Independent Enqueue Support
In reply to Abdullah Sevincerv7: Address documentation reviews.
v6: Update patch with more documentation
v5: Address build issues
v4: Address comments
v3: Fix CI/build issues
v2: Fix CI/build issues
v1: Initial patchset
Abdullah Sevincer (3):
event/dlb2: add support for independent enqueue
eventdev: add support for independent enqueue event/dsw: add capability for independent enqueue
doc/guides/eventdevs/dlb2.rst | 41 ++ doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_11.rst | 34 +- drivers/event/dlb2/dlb2.c | 492 ++++++++++++++-------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 10 + drivers/event/dsw/dsw_evdev.c | 3 +- lib/eventdev/rte_eventdev.h | 37 ++ 11 files changed, 463 insertions(+), 216 deletions(-)
Signature · 1 line
2.25.1
PATCH v7 1/3 event/dlb2: add support for independent enqueue
DLB devices need events to be enqueued in the same order they are dequeued. Applications are not suppose to change event order between dequeue and to enqueue. Since Eventdev standard does not add such restrictions independent enqueue support is needed for DLB PMD so that it restores dequeue order on enqueue if applications happen to change it. It also adds missing releases in places where events are dropped by the application and it expects implicit release to handle it.
By default the feature will be off on all DLB ports and they will behave the same as older releases. To enable reordering feature, applications need to add the flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ to port configuration if only the device advertises the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ.
--- doc/guides/eventdevs/dlb2.rst | 41 +++ doc/guides/rel_notes/release_24_11.rst | 33 +- drivers/event/dlb2/dlb2.c | 492 ++++++++++++++++--------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 10 + 7 files changed, 417 insertions(+), 219 deletions(-)
doc/guides/eventdevs/dlb2.rst +41 -0
@@ -456,6 +456,47 @@ Example command to enable QE Weight feature: --allow ea:00.0,enable_cq_weight=<y/Y> +Independent Enqueue Capability +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +DLB2 hardware device expects all forwarded events to be enqueued in the same +order as they are dequeued. For dropped events, their releases should come at +the same location as the original event was expected. Hardware has this +restriction as it uses the order to retrieve information about the original +event that was sent to the CPU. This contains information like atomic flow +ID to release the flow lock and ordered events sequence number to restore the +original order. + +Some applications, like those based on the DPDK dispatcher library, want +enqueue order independence. To support this, DLB2 PMD supports the +``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ``capability. + +This capability applies to Eventdevs supporting burst mode. On ports where +the application is going to change enqueue order, +``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` support should be enabled. + +Example code to inform PMD that the application plans to use independent enqueue +order on a port: + + .. code-block:: c + + if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) + port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; + +This code example enables enqueue event reordering inside DLB2 PMD before the events +are sent to the DLB2 hardware. If the application is not going to change the enqueue +order, this flag should not be enabled to get better performance. DLB2 PMD saves +ordering information inside the impl_opaque field of the event, and this field should +be preserved for all FORWARD or RELEASE events. Following MACROs are provided to get +and set this field inside the event in case the same event is not used for forwarding +(e.g., a new RELEASE event is created when the original event is dropped instead of +reusing the same event). + + .. code-block:: c + + #define RTE_EVENT_GET_IMPL_OPAQUE(ev) (ev->impl_opaque) + #define RTE_EVENT_SET_IMPL_OPAQUE(ev, val) (ev->impl_opaque = val) + Running Eventdev Applications with DLB Device ---------------------------------------------
doc/guides/rel_notes/release_24_11.rst +4 -29
@@ -24,36 +24,11 @@ DPDK Release 24.11 New Features ------------ -.. This section should contain new features added in this release. - Sample format: +* **Updated DLB2 Driver for independent enqueue feature** - * **Add a title in the past tense with a full stop.** - - Add a short 1-2 sentence description in the past tense. - The description should be enough to allow someone scanning - the release notes to understand the new feature. - - If the feature adds a lot of sub-features you can use a bullet list - like this: - - * Added feature foo to do something. - * Enhanced feature bar to do something else. - - Refer to the previous release notes for examples. - - Suggested order in release notes items: - * Core libs (EAL, mempool, ring, mbuf, buses) - * Device abstraction libs and PMDs (ordered alphabetically by vendor name) - - ethdev (lib, PMDs) - - cryptodev (lib, PMDs) - - eventdev (lib, PMDs) - - etc - * Other libs - * Apps, Examples, Tools (if significant) - - This section is a comment. Do not overwrite or remove it. - Also, make sure to start the actual text at the margin. - ======================================================= + Added support for DLB independent enqueue feature. Applications should use + ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability + ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. Removed Items
drivers/event/dlb2/dlb2.c +322 -170
691 lines not on this page · raw message
drivers/event/dlb2/dlb2_avx512.c +14 -13
@@ -151,20 +151,20 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port,*/ #define DLB2_QE_EV_TYPE_WORD 0 sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[0 ].sub_event_type <<8 | - ev[0 ].event_type, + ev[0 ].sub_event_type <<4 | + ev[0 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[1 ].sub_event_type <<8 | - ev[1 ].event_type, + ev[1 ].sub_event_type <<4 | + ev[1 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[2 ].sub_event_type <<8 | - ev[2 ].event_type, + ev[2 ].sub_event_type <<4 | + ev[2 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[3 ].sub_event_type <<8 | - ev[3 ].event_type, + ev[3 ].sub_event_type <<4 | + ev[3 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 );if (qm_port->use_avx512) {
@@ -238,11 +238,11 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, }/* will only be set for DLB 2.5 + */ -if (qm_port->cq_weight) { - qe[0 ].weight = ev[0 ].impl_opaque &3 ; - qe[1 ].weight = ev[1 ].impl_opaque &3 ; - qe[2 ].weight = ev[2 ].impl_opaque &3 ; - qe[3 ].weight = ev[3 ].impl_opaque &3 ; +if (qm_port->dlb2->enable_cq_weight) { + qe[0 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[0 ]); + qe[1 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[1 ]); + qe[2 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[2 ]); + qe[3 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[3 ]); }break ;
@@ -267,6 +267,7 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, } qe[i].u.event_type.major = ev[i].event_type; qe[i].u.event_type.sub = ev[i].sub_event_type; + qe[i].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[i]); }break ;case 0 :
drivers/event/dlb2/dlb2_inline_fns.h +8 -0
@@ -32,4 +32,12 @@ dlb2_movdir64b(void *dest, void *src) : "a" (dest), "d" (src)); } +static inline void +dlb2_movdir64b_single (void *pp_addr,void *qe4) +{ + asmvolatile (".byte 0x66, 0x0f, 0x38, 0xf8, 0x02" + : + :"a" (pp_addr),"d" (qe4)); +} +#endif /* _DLB2_INLINE_FNS_H_ */
drivers/event/dlb2/dlb2_priv.h +18 -7
@@ -29,7 +29,8 @@#define DLB2_SW_CREDIT_C_QUANTA_DEFAULT 256/* Consumer */ #define DLB2_DEPTH_THRESH_DEFAULT 256#define DLB2_MIN_CQ_DEPTH_OVERRIDE 32 -#define DLB2_MAX_CQ_DEPTH_OVERRIDE 128 +#define DLB2_MAX_CQ_DEPTH_OVERRIDE 1024 +#define DLB2_MAX_CQ_DEPTH_REORDER 128#define DLB2_MIN_ENQ_DEPTH_OVERRIDE 32#define DLB2_MAX_ENQ_DEPTH_OVERRIDE 1024
@@ -387,8 +388,23 @@ struct dlb2_port {bool use_scalar;/* force usage of scalar code */ uint16_t hw_credit_quanta;bool use_avx512; -uint32_t cq_weight;bool is_producer;/* True if port is of type producer */ +uint8_t reorder_id;/* id used for reordering events coming back into the scheduler */ +bool reorder_en; +struct dlb2_reorder *order;/* For ordering enqueues */ +}; + +struct dlb2_reorder { +/* a reorder buffer for events coming back in different order from dequeue +* We use UINT8_MAX + 1 elements, but add on three no-ops to make movdirs easier at the end +*/ +union { +__m128i m128; +struct dlb2_enqueue_qe qe; +uint64_t u64[2 ]; + } enq_reorder[UINT8_MAX +4 ]; +/* id of the next entry in the reorder enqueue ring to send in */ +uint8_t next_to_enqueue; };/* Per-process per-port mmio and memory pointers */
@@ -642,10 +658,6 @@ struct dlb2_qid_depth_thresholds {int val[DLB2_MAX_NUM_QUEUES_ALL ]; }; -struct dlb2_cq_weight { -int limit[DLB2_MAX_NUM_PORTS_ALL ]; -}; -struct dlb2_port_cos {int cos_id[DLB2_MAX_NUM_PORTS_ALL ]; };
@@ -667,7 +679,6 @@ struct dlb2_devargs {bool vector_opts_enabled;int max_cq_depth;int max_enq_depth; -struct dlb2_cq_weight cq_weight;struct dlb2_port_cos port_cos;struct dlb2_cos_bw cos_bw;const char *producer_coremask;
drivers/event/dlb2/rte_pmd_dlb2.h +10 -0
@@ -19,6 +19,16 @@ extern "C" {#include <rte_compat.h> +/** +* Macros to get/set QID depth and QE weight from rte_event metadata. +* Currently 'rsvd' field is used for these. Lower 2 bits are used to store +* QID depth while the upper 2 bits are used for QER weight. +*/ +#define RTE_PMD_DLB2_GET_QID_DEPTH (x) ((x)->rsvd & 0x3) +#define RTE_PMD_DLB2_SET_QID_DEPTH (x, v) ((x)->rsvd = ((x)->rsvd & ~0x3) | (v & 0x3)) +#define RTE_PMD_DLB2_GET_QE_WEIGHT (x) (((x)->rsvd >> 2) & 0x3) +#define RTE_PMD_DLB2_SET_QE_WEIGHT (x, v) ((x)->rsvd = ((x)->rsvd & 0x3) | ((v & 0x3) << 2)) +/** * @warning * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
Signature · 1 line
2.25.1
PATCH v7 2/3 eventdev: add support for independent enqueue
In reply to Abdullah SevincerThis commit adds support for independent enqueue feature and updates Event Device and PMD feature list.
A new capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ is introduced to support independent enqueue to support PMD to enqueue in any order even the underlined hardware device needs enqueues in a strict dequeue order.
To use this capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists.
--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_11.rst | 5 +++ lib/eventdev/rte_eventdev.h | 37 +++++++++++++++++++++++ 4 files changed, 44 insertions(+)
doc/guides/eventdevs/features/default.ini +1 -0
@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.
doc/guides/eventdevs/features/dlb2.ini +1 -0
@@ -15,6 +15,7 @@ implicit_release_disable = Y runtime_port_link = Y multiple_queue_port = Y maintenance_free = Y +independent_enq = Y [Eth Rx adapter Features]
doc/guides/rel_notes/release_24_11.rst +5 -0
@@ -30,6 +30,11 @@ New Features ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. +* **Updated Event Device Library for independent enqueue feature** + + * Added support for independent enqueue feature. Updated Event Device and + PMD feature list. + Removed Items -------------
lib/eventdev/rte_eventdev.h +37 -0
@@ -446,6 +446,31 @@ struct rte_event;* @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ (1ULL << 16) +/**< Event device is capable of independent enqueue. +* A new capability, RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, will indicate that Eventdev +* supports the enqueue in any order or specifically in a different order than the +* dequeue. Eventdev PMD can either transmit events in the changed order in which +* they are enqueued or restore the original order before sending them to the +* underlying hardware device. A flag is provided during the port configuration to +* inform Eventdev PMD that the application intends to use an independent enqueue +* order on a particular port. Note that this capability only matters for Eventdevs +* supporting burst mode. +* +* To Inform PMD that the application plans to use independent enqueue order on a port +* this code example can be used: +* +* if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) +* port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; +* +* When an implicit release is enabled on a port, Eventdev PMD will also handle +* the insertion of RELEASE events in place of dropped events. The independent enqueue +* feature only applies to FORWARD and RELEASE events. New events (op=RTE_EVENT_OP_NEW) +* will be transmitted in the order the application enqueues them and do not maintain +* any order relative to FORWARD/RELEASE events. FORWARD vs NEW relaxed ordering +* only applies to ports that have enabled independent enqueue feature. +*/ +/* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0/**< Highest priority level for events and queues.
@@ -1072,6 +1097,18 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* * @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) +/**< Flag to enable independent enqueue. Must not be set if the device +* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature +* allows an application to enqueue RTE_EVENT_OP_FORWARD or +* RTE_EVENT_OP_RELEASE in an order different than the order the +* events were dequeued from the event device, while maintaining +* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. +* +* Note that this flag only matters for Eventdevs supporting burst mode. +* +* @see rte_event_port_setup() +*/ /** Event port configuration structure */ struct rte_event_port_conf {
Signature · 1 line
2.25.1
PATCH v7 3/3 event/dsw: add capability for independent enqueue
In reply to Abdullah SevincerTo use independent enqueue capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists. Hence, this commit adds the capability of independent enqueue to the DSW driver.
--- doc/guides/rel_notes/release_24_11.rst | 4 ++++ drivers/event/dsw/dsw_evdev.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-)
doc/guides/rel_notes/release_24_11.rst +4 -0
@@ -35,6 +35,10 @@ New Features * Added support for independent enqueue feature. Updated Event Device and PMD feature list. +* **Updated DSW Driver for independent enqueue feature** + + * Added capability flag for DSW to advertise independent enqueue feature. + Removed Items -------------
drivers/event/dsw/dsw_evdev.c +2 -1
@@ -230,7 +230,8 @@ dsw_info_get(struct rte_eventdev *dev __rte_unused,RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE |RTE_EVENT_DEV_CAP_NONSEQ_MODE |RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT | - RTE_EVENT_DEV_CAP_CARRY_FLOW_ID +RTE_EVENT_DEV_CAP_CARRY_FLOW_ID | + RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ }; }
Signature · 1 line
2.25.1
v8 cover Independent Enqueue Support
In reply to Abdullah Sevincerv8: Address build issues.
v7: Address documentation reviews.
v6: Update patch with more documentation
v5: Address build issues
v4: Address comments
v3: Fix CI/build issues
v2: Fix CI/build issues
v1: Initial patchset
Abdullah Sevincer (3):
event/dlb2: add support for independent enqueue
eventdev: add support for independent enqueue event/dsw: add capability for independent enqueue
doc/guides/eventdevs/dlb2.rst | 41 ++ doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_11.rst | 34 +- drivers/event/dlb2/dlb2.c | 492 ++++++++++++++-------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 10 + drivers/event/dsw/dsw_evdev.c | 3 +- lib/eventdev/rte_eventdev.h | 37 ++ 11 files changed, 463 insertions(+), 216 deletions(-)
Signature · 1 line
2.25.1
PATCH v8 1/3 event/dlb2: add support for independent enqueue
DLB devices need events to be enqueued in the same order they are dequeued. Applications are not suppose to change event order between dequeue and to enqueue. Since Eventdev standard does not add such restrictions independent enqueue support is needed for DLB PMD so that it restores dequeue order on enqueue if applications happen to change it. It also adds missing releases in places where events are dropped by the application and it expects implicit release to handle it.
By default the feature will be off on all DLB ports and they will behave the same as older releases. To enable reordering feature, applications need to add the flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ to port configuration if only the device advertises the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ.
--- doc/guides/eventdevs/dlb2.rst | 41 +++ doc/guides/rel_notes/release_24_11.rst | 33 +- drivers/event/dlb2/dlb2.c | 492 ++++++++++++++++--------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 10 + 7 files changed, 417 insertions(+), 219 deletions(-)
doc/guides/eventdevs/dlb2.rst +41 -0
@@ -456,6 +456,47 @@ Example command to enable QE Weight feature: --allow ea:00.0,enable_cq_weight=<y/Y> +Independent Enqueue Capability +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +DLB2 hardware device expects all forwarded events to be enqueued in the same +order as they are dequeued. For dropped events, their releases should come at +the same location as the original event was expected. Hardware has this +restriction as it uses the order to retrieve information about the original +event that was sent to the CPU. This contains information like atomic flow +ID to release the flow lock and ordered events sequence number to restore the +original order. + +Some applications, like those based on the DPDK dispatcher library, want +enqueue order independence. To support this, DLB2 PMD supports the +``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` capability. + +This capability applies to Eventdevs supporting burst mode. On ports where +the application is going to change enqueue order, +``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` support should be enabled. + +Example code to inform PMD that the application plans to use independent enqueue +order on a port: + + .. code-block:: c + + if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) + port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; + +This code example enables enqueue event reordering inside DLB2 PMD before the events +are sent to the DLB2 hardware. If the application is not going to change the enqueue +order, this flag should not be enabled to get better performance. DLB2 PMD saves +ordering information inside the impl_opaque field of the event, and this field should +be preserved for all FORWARD or RELEASE events. Following MACROs are provided to get +and set this field inside the event in case the same event is not used for forwarding +(e.g., a new RELEASE event is created when the original event is dropped instead of +reusing the same event). + + .. code-block:: c + + #define RTE_EVENT_GET_IMPL_OPAQUE(ev) (ev->impl_opaque) + #define RTE_EVENT_SET_IMPL_OPAQUE(ev, val) (ev->impl_opaque = val) + Running Eventdev Applications with DLB Device ---------------------------------------------
doc/guides/rel_notes/release_24_11.rst +4 -29
@@ -24,36 +24,11 @@ DPDK Release 24.11 New Features ------------ -.. This section should contain new features added in this release. - Sample format: +* **Updated DLB2 Driver for independent enqueue feature** - * **Add a title in the past tense with a full stop.** - - Add a short 1-2 sentence description in the past tense. - The description should be enough to allow someone scanning - the release notes to understand the new feature. - - If the feature adds a lot of sub-features you can use a bullet list - like this: - - * Added feature foo to do something. - * Enhanced feature bar to do something else. - - Refer to the previous release notes for examples. - - Suggested order in release notes items: - * Core libs (EAL, mempool, ring, mbuf, buses) - * Device abstraction libs and PMDs (ordered alphabetically by vendor name) - - ethdev (lib, PMDs) - - cryptodev (lib, PMDs) - - eventdev (lib, PMDs) - - etc - * Other libs - * Apps, Examples, Tools (if significant) - - This section is a comment. Do not overwrite or remove it. - Also, make sure to start the actual text at the margin. - ======================================================= + Added support for DLB independent enqueue feature. Applications should use + ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability + ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. Removed Items
drivers/event/dlb2/dlb2.c +322 -170
691 lines not on this page · raw message
drivers/event/dlb2/dlb2_avx512.c +14 -13
@@ -151,20 +151,20 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port,*/ #define DLB2_QE_EV_TYPE_WORD 0 sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[0 ].sub_event_type <<8 | - ev[0 ].event_type, + ev[0 ].sub_event_type <<4 | + ev[0 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[1 ].sub_event_type <<8 | - ev[1 ].event_type, + ev[1 ].sub_event_type <<4 | + ev[1 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[2 ].sub_event_type <<8 | - ev[2 ].event_type, + ev[2 ].sub_event_type <<4 | + ev[2 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[3 ].sub_event_type <<8 | - ev[3 ].event_type, + ev[3 ].sub_event_type <<4 | + ev[3 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 );if (qm_port->use_avx512) {
@@ -238,11 +238,11 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, }/* will only be set for DLB 2.5 + */ -if (qm_port->cq_weight) { - qe[0 ].weight = ev[0 ].impl_opaque &3 ; - qe[1 ].weight = ev[1 ].impl_opaque &3 ; - qe[2 ].weight = ev[2 ].impl_opaque &3 ; - qe[3 ].weight = ev[3 ].impl_opaque &3 ; +if (qm_port->dlb2->enable_cq_weight) { + qe[0 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[0 ]); + qe[1 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[1 ]); + qe[2 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[2 ]); + qe[3 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[3 ]); }break ;
@@ -267,6 +267,7 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, } qe[i].u.event_type.major = ev[i].event_type; qe[i].u.event_type.sub = ev[i].sub_event_type; + qe[i].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[i]); }break ;case 0 :
drivers/event/dlb2/dlb2_inline_fns.h +8 -0
@@ -32,4 +32,12 @@ dlb2_movdir64b(void *dest, void *src) : "a" (dest), "d" (src)); } +static inline void +dlb2_movdir64b_single (void *pp_addr,void *qe4) +{ + asmvolatile (".byte 0x66, 0x0f, 0x38, 0xf8, 0x02" + : + :"a" (pp_addr),"d" (qe4)); +} +#endif /* _DLB2_INLINE_FNS_H_ */
drivers/event/dlb2/dlb2_priv.h +18 -7
@@ -29,7 +29,8 @@#define DLB2_SW_CREDIT_C_QUANTA_DEFAULT 256/* Consumer */ #define DLB2_DEPTH_THRESH_DEFAULT 256#define DLB2_MIN_CQ_DEPTH_OVERRIDE 32 -#define DLB2_MAX_CQ_DEPTH_OVERRIDE 128 +#define DLB2_MAX_CQ_DEPTH_OVERRIDE 1024 +#define DLB2_MAX_CQ_DEPTH_REORDER 128#define DLB2_MIN_ENQ_DEPTH_OVERRIDE 32#define DLB2_MAX_ENQ_DEPTH_OVERRIDE 1024
@@ -387,8 +388,23 @@ struct dlb2_port {bool use_scalar;/* force usage of scalar code */ uint16_t hw_credit_quanta;bool use_avx512; -uint32_t cq_weight;bool is_producer;/* True if port is of type producer */ +uint8_t reorder_id;/* id used for reordering events coming back into the scheduler */ +bool reorder_en; +struct dlb2_reorder *order;/* For ordering enqueues */ +}; + +struct dlb2_reorder { +/* a reorder buffer for events coming back in different order from dequeue +* We use UINT8_MAX + 1 elements, but add on three no-ops to make movdirs easier at the end +*/ +union { +__m128i m128; +struct dlb2_enqueue_qe qe; +uint64_t u64[2 ]; + } enq_reorder[UINT8_MAX +4 ]; +/* id of the next entry in the reorder enqueue ring to send in */ +uint8_t next_to_enqueue; };/* Per-process per-port mmio and memory pointers */
@@ -642,10 +658,6 @@ struct dlb2_qid_depth_thresholds {int val[DLB2_MAX_NUM_QUEUES_ALL ]; }; -struct dlb2_cq_weight { -int limit[DLB2_MAX_NUM_PORTS_ALL ]; -}; -struct dlb2_port_cos {int cos_id[DLB2_MAX_NUM_PORTS_ALL ]; };
@@ -667,7 +679,6 @@ struct dlb2_devargs {bool vector_opts_enabled;int max_cq_depth;int max_enq_depth; -struct dlb2_cq_weight cq_weight;struct dlb2_port_cos port_cos;struct dlb2_cos_bw cos_bw;const char *producer_coremask;
drivers/event/dlb2/rte_pmd_dlb2.h +10 -0
@@ -19,6 +19,16 @@ extern "C" {#include <rte_compat.h> +/** +* Macros to get/set QID depth and QE weight from rte_event metadata. +* Currently 'rsvd' field is used for these. Lower 2 bits are used to store +* QID depth while the upper 2 bits are used for QER weight. +*/ +#define RTE_PMD_DLB2_GET_QID_DEPTH (x) ((x)->rsvd & 0x3) +#define RTE_PMD_DLB2_SET_QID_DEPTH (x, v) ((x)->rsvd = ((x)->rsvd & ~0x3) | (v & 0x3)) +#define RTE_PMD_DLB2_GET_QE_WEIGHT (x) (((x)->rsvd >> 2) & 0x3) +#define RTE_PMD_DLB2_SET_QE_WEIGHT (x, v) ((x)->rsvd = ((x)->rsvd & 0x3) | ((v & 0x3) << 2)) +/** * @warning * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
Signature · 1 line
2.25.1
PATCH v8 2/3 eventdev: add support for independent enqueue
In reply to Abdullah SevincerThis commit adds support for independent enqueue feature and updates Event Device and PMD feature list.
A new capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ is introduced to support independent enqueue to support PMD to enqueue in any order even the underlined hardware device needs enqueues in a strict dequeue order.
To use this capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists.
--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_11.rst | 5 +++ lib/eventdev/rte_eventdev.h | 37 +++++++++++++++++++++++ 4 files changed, 44 insertions(+)
doc/guides/eventdevs/features/default.ini +1 -0
@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.
doc/guides/eventdevs/features/dlb2.ini +1 -0
@@ -15,6 +15,7 @@ implicit_release_disable = Y runtime_port_link = Y multiple_queue_port = Y maintenance_free = Y +independent_enq = Y [Eth Rx adapter Features]
doc/guides/rel_notes/release_24_11.rst +5 -0
@@ -30,6 +30,11 @@ New Features ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. +* **Updated Event Device Library for independent enqueue feature** + + * Added support for independent enqueue feature. Updated Event Device and + PMD feature list. + Removed Items -------------
lib/eventdev/rte_eventdev.h +37 -0
@@ -446,6 +446,31 @@ struct rte_event;* @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ (1ULL << 16) +/**< Event device is capable of independent enqueue. +* A new capability, RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, will indicate that Eventdev +* supports the enqueue in any order or specifically in a different order than the +* dequeue. Eventdev PMD can either transmit events in the changed order in which +* they are enqueued or restore the original order before sending them to the +* underlying hardware device. A flag is provided during the port configuration to +* inform Eventdev PMD that the application intends to use an independent enqueue +* order on a particular port. Note that this capability only matters for Eventdevs +* supporting burst mode. +* +* To Inform PMD that the application plans to use independent enqueue order on a port +* this code example can be used: +* +* if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) +* port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; +* +* When an implicit release is enabled on a port, Eventdev PMD will also handle +* the insertion of RELEASE events in place of dropped events. The independent enqueue +* feature only applies to FORWARD and RELEASE events. New events (op=RTE_EVENT_OP_NEW) +* will be transmitted in the order the application enqueues them and do not maintain +* any order relative to FORWARD/RELEASE events. FORWARD vs NEW relaxed ordering +* only applies to ports that have enabled independent enqueue feature. +*/ +/* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0/**< Highest priority level for events and queues.
@@ -1072,6 +1097,18 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* * @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) +/**< Flag to enable independent enqueue. Must not be set if the device +* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature +* allows an application to enqueue RTE_EVENT_OP_FORWARD or +* RTE_EVENT_OP_RELEASE in an order different than the order the +* events were dequeued from the event device, while maintaining +* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. +* +* Note that this flag only matters for Eventdevs supporting burst mode. +* +* @see rte_event_port_setup() +*/ /** Event port configuration structure */ struct rte_event_port_conf {
Signature · 1 line
2.25.1
Re: [PATCH v8 2/3] eventdev: add support for independent enqueue
Quoted 6 lines · Abdullah Sevincer
This commit adds support for independent enqueue feature and updates Event Device and PMD feature list.
A new capability
RTE_EVENT_DEV_CAP_INDEPENDENT_ENQis introduced to support independent enqueue to support PMD to enqueue in any order even the underlined hardware device needs enqueues in a strict dequeue
This sentence needs to be rephrased.
My attempt:
"A new capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ is introduced. An application may, on an event device where independent enqueue is supported, using an event port where it is enabled, enqueue RTE_EVENT_OP_FORWARD or RELEASE type events in any order."
Quoted 99 lines
order.
To use this capability applications need to set flag
RTE_EVENT_PORT_CFG_INDEPENDENT_ENQduring port setup only if the capabilityRTE_EVENT_DEV_CAP_INDEPENDENT_ENQexists.Signed-off-by Abdullah Sevincer <[email protected]>--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_11.rst | 5 +++ lib/eventdev/rte_eventdev.h | 37 +++++++++++++++++++++++ 4 files changed, 44 insertions(+)doc/guides/eventdevs/features/default.ini +1
-0@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.doc/guides/eventdevs/features/dlb2.ini +1
-0@@ -15,6 +15,7 @@ implicit_release_disable = Y runtime_port_link = Y multiple_queue_port = Y maintenance_free = Y +independent_enq = Y [Eth Rx adapter Features]doc/guides/rel_notes/release_24_11.rst +5
-0@@ -30,6 +30,11 @@ New Features ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. +* **Updated Event Device Library for independent enqueue feature** + + * Added support for independent enqueue feature. Updated Event Device and + PMD feature list. + Removed Items -------------lib/eventdev/rte_eventdev.h +30
-0@@ -446,6 +446,31 @@ struct rte_event;* @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ (1ULL << 16) +/**< Event device is capable of independent enqueue. +* A new capability, RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, will indicate that Eventdev +* supports the enqueue in any order or specifically in a different order than the +* dequeue. Eventdev PMD can either transmit events in the changed order in which +* they are enqueued or restore the original order before sending them to the +* underlying hardware device. A flag is provided during the port configuration to +* inform Eventdev PMD that the application intends to use an independent enqueue +* order on a particular port. Note that this capability only matters for Eventdevs +* supporting burst mode. +* +* To Inform PMD that the application plans to use independent enqueue order on a port +* this code example can be used: +* +* if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) +* port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; +* +* When an implicit release is enabled on a port, Eventdev PMD will also handle +* the insertion of RELEASE events in place of dropped events. The independent enqueue +* feature only applies to FORWARD and RELEASE events. New events (op=RTE_EVENT_OP_NEW) +* will be transmitted in the order the application enqueues them and do not maintain +* any order relative to FORWARD/RELEASE events. FORWARD vs NEW relaxed ordering +* only applies to ports that have enabled independent enqueue feature. +*/ +/* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0/**< Highest priority level for events and queues. @@ -1072,6 +1097,18 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* * @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) +/**< Flag to enable independent enqueue. Must not be set if the device +* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature +* allows an application to enqueue RTE_EVENT_OP_FORWARD or +* RTE_EVENT_OP_RELEASE in an order different than the order the
lib/eventdev/rte_eventdev.h rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id, · line 1114
Quoted 10 lines
lib/eventdev/rte_eventdev.h +7
-0+* events were dequeued from the event device, while maintaining +* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. +* +* Note that this flag only matters for Eventdevs supporting burst mode. +* +* @see rte_event_port_setup() +*/ /** Event port configuration structure */ struct rte_event_port_conf {
RE: [PATCH v8 2/3] eventdev: add support for independent enqueue
Quoted 19 lines
-----Original Message-----
From: Mattias Rönnblom <[email protected]>
Sent: Friday, August 23, 2024 7:03 AM
To: Sevincer, Abdullah <[email protected]>; [email protected]
Cc: [email protected]; Richardson, Bruce <[email protected]>; Pathak, Pravin <[email protected]>; [email protected]; Aggarwal, Manish <[email protected]>
Subject: Re: [PATCH v8 2/3] eventdev: add support for independent enqueueQuoted 6 lines · Abdullah Sevincer
This commit adds support for independent enqueue feature and updates Event Device and PMD feature list.
A new capability
RTE_EVENT_DEV_CAP_INDEPENDENT_ENQis introduced to support independent enqueue to support PMD to enqueue in any order even the underlined hardware device needs enqueues in a strict dequeue
Quoted 9 lines
This sentence needs to be rephrased.
My attempt:
"A new capabilityRTE_EVENT_DEV_CAP_INDEPENDENT_ENQis introduced. An application may, on an event device where independent enqueue is supported, using an event port where it is enabled, enqueueRTE_EVENT_OP_FORWARDor RELEASE type events in any order."Quoted 1 line
order.
Will this work:
A new capability, RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, is introduced. It allows out-of-order enqueuing of RTE_EVENT_OP_FORWARD or RELEASE type events on an event port where this capability is enabled.
Quoted 131 lines
Quoted 45 lines
To use this capability applications need to set flag
RTE_EVENT_PORT_CFG_INDEPENDENT_ENQduring port setup only if the capabilityRTE_EVENT_DEV_CAP_INDEPENDENT_ENQexists.Signed-off-by Abdullah Sevincer <[email protected]>--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_11.rst | 5 +++ lib/eventdev/rte_eventdev.h | 37 +++++++++++++++++++++++ 4 files changed, 44 insertions(+)doc/guides/eventdevs/features/default.ini +1
-0@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.doc/guides/eventdevs/features/dlb2.ini +1
-0@@ -15,6 +15,7 @@ implicit_release_disable = Y runtime_port_link = Y multiple_queue_port = Y maintenance_free = Y +independent_enq = Y [Eth Rx adapter Features]doc/guides/rel_notes/release_24_11.rst +0
-0doc/guides/rel_notes/release_24_11.rst New Features · line 30
Quoted 1 line
doc/guides/rel_notes/release_24_11.rst +0
-0@@ -30,6 +30,11 @@ New Features ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if thecapability
doc/guides/rel_notes/release_24_11.rst New Features
Quoted 5 lines
doc/guides/rel_notes/release_24_11.rst +3
-0``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. +* **Updated Event Device Library for independent enqueue feature** + + * Added support for independent enqueue feature. Updated Event Deviceand
Quoted 27 lines
doc/guides/rel_notes/release_24_11.rst +2
-0+ PMD feature list. + Removed Items -------------lib/eventdev/rte_eventdev.h +14
-0@@ -446,6 +446,31 @@ struct rte_event;* @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ (1ULL << 16)/**< Event +device is capable of independent enqueue. +* A new capability, RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, will indicate +that Eventdev +* supports the enqueue in any order or specifically in a different +order than the +* dequeue. Eventdev PMD can either transmit events in the changed +order in which +* they are enqueued or restore the original order before sending +them to the +* underlying hardware device. A flag is provided during the port +configuration to +* inform Eventdev PMD that the application intends to use an +independent enqueue lib/eventdev/rte_eventdev.h struct rte_event; · line 472
Quoted 10 lines
lib/eventdev/rte_eventdev.h +10
-0+ * order on a particular port. Note that this capability only matters +for Eventdevs + * supporting burst mode. + * + * To Inform PMD that the application plans to use independent +enqueue order on a port + * this code example can be used: + * + * if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) + * port_config = port_config |
RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ;lib/eventdev/rte_eventdev.h rte_event_queue_attr_set(uint8_t dev_id, uint8_t
Quoted 18 lines
lib/eventdev/rte_eventdev.h +14
-0+* +* When an implicit release is enabled on a port, Eventdev PMD will +also handle +* the insertion of RELEASE events in place of dropped events. The +independent enqueue +* feature only applies to FORWARD and RELEASE events. New events +(op=RTE_EVENT_OP_NEW) +* will be transmitted in the order the application enqueues them and +do not maintain +* any order relative to FORWARD/RELEASE events. FORWARD vs NEW +relaxed ordering +* only applies to ports that have enabled independent enqueue feature. +*/ +/* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0/**< Highest priority level for events and queues. @@ -1072,6 +1097,18 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t
queue_id,uint32_tattr_id,Quoted 9 lines
lib/eventdev/rte_eventdev.h +6
-0* * @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) +/**< Flag to enable independent enqueue. Must not be set if the +device +* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature +* allows an application to enqueue RTE_EVENT_OP_FORWARD or +* RTE_EVENT_OP_RELEASE in an order different than the order the lib/eventdev/rte_eventdev.h rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id, · line 1114
Quoted 10 lines
lib/eventdev/rte_eventdev.h +7
-0+* events were dequeued from the event device, while maintaining +* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. +* +* Note that this flag only matters for Eventdevs supporting burst mode. +* +* @see rte_event_port_setup() +*/ /** Event port configuration structure */ struct rte_event_port_conf {Acked-by Mattias Rönnblom <[email protected]>
RE: [PATCH v8 2/3] eventdev: add support for independent enqueue
Hi Mattias,
I will update patch tomorrow with updated suggestion from Pravin, If I don’t hear from you I guess you are okay?
Re: [PATCH v8 2/3] eventdev: add support for independent enqueue
In reply to Pathak, PravinQuoted 27 lines · Pravin
Quoted 27 lines
-----Original Message-----
From: Mattias Rönnblom <[email protected]>
Sent: Friday, August 23, 2024 7:03 AM
To: Sevincer, Abdullah <[email protected]>; [email protected]
Cc: [email protected]; Richardson, Bruce <[email protected]>; Pathak, Pravin <[email protected]>; [email protected]; Aggarwal, Manish <[email protected]>
Subject: Re: [PATCH v8 2/3] eventdev: add support for independent enqueueQuoted 6 lines · Abdullah Sevincer
This commit adds support for independent enqueue feature and updates Event Device and PMD feature list.
A new capability
RTE_EVENT_DEV_CAP_INDEPENDENT_ENQis introduced to support independent enqueue to support PMD to enqueue in any order even the underlined hardware device needs enqueues in a strict dequeueThis sentence needs to be rephrased.
My attempt:
"A new capabilityRTE_EVENT_DEV_CAP_INDEPENDENT_ENQis introduced. An application may, on an event device where independent enqueue is supported, using an event port where it is enabled, enqueueRTE_EVENT_OP_FORWARDor RELEASE type events in any order."
Quoted 7 lines
Quoted 1 line
Quoted 1 line
order.
Will this work:
A new capability,RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, is introduced. It allows out-of-order enqueuing ofRTE_EVENT_OP_FORWARDor RELEASE type events on an event port where this capability is enabled.
Sounds good and better than my attempt.
Quoted 131 lines
Quoted 131 lines
Quoted 45 lines
To use this capability applications need to set flag
RTE_EVENT_PORT_CFG_INDEPENDENT_ENQduring port setup only if the capabilityRTE_EVENT_DEV_CAP_INDEPENDENT_ENQexists.Signed-off-by Abdullah Sevincer <[email protected]>--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_11.rst | 5 +++ lib/eventdev/rte_eventdev.h | 37 +++++++++++++++++++++++ 4 files changed, 44 insertions(+)doc/guides/eventdevs/features/default.ini +1
-0@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.doc/guides/eventdevs/features/dlb2.ini +1
-0@@ -15,6 +15,7 @@ implicit_release_disable = Y runtime_port_link = Y multiple_queue_port = Y maintenance_free = Y +independent_enq = Y [Eth Rx adapter Features]doc/guides/rel_notes/release_24_11.rst +0
-0doc/guides/rel_notes/release_24_11.rst New Features · line 30
Quoted 1 line
doc/guides/rel_notes/release_24_11.rst +0
-0@@ -30,6 +30,11 @@ New Features ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if thecapability
doc/guides/rel_notes/release_24_11.rst New Features
Quoted 5 lines
doc/guides/rel_notes/release_24_11.rst +3
-0``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. +* **Updated Event Device Library for independent enqueue feature** + + * Added support for independent enqueue feature. Updated Event Deviceand
Quoted 27 lines
doc/guides/rel_notes/release_24_11.rst +2
-0+ PMD feature list. + Removed Items -------------lib/eventdev/rte_eventdev.h +14
-0@@ -446,6 +446,31 @@ struct rte_event;* @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ (1ULL << 16)/**< Event +device is capable of independent enqueue. +* A new capability, RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, will indicate +that Eventdev +* supports the enqueue in any order or specifically in a different +order than the +* dequeue. Eventdev PMD can either transmit events in the changed +order in which +* they are enqueued or restore the original order before sending +them to the +* underlying hardware device. A flag is provided during the port +configuration to +* inform Eventdev PMD that the application intends to use an +independent enqueue lib/eventdev/rte_eventdev.h struct rte_event; · line 472
Quoted 10 lines
lib/eventdev/rte_eventdev.h +10
-0+ * order on a particular port. Note that this capability only matters +for Eventdevs + * supporting burst mode. + * + * To Inform PMD that the application plans to use independent +enqueue order on a port + * this code example can be used: + * + * if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) + * port_config = port_config |
RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ;lib/eventdev/rte_eventdev.h rte_event_queue_attr_set(uint8_t dev_id, uint8_t
Quoted 18 lines
lib/eventdev/rte_eventdev.h +14
-0+* +* When an implicit release is enabled on a port, Eventdev PMD will +also handle +* the insertion of RELEASE events in place of dropped events. The +independent enqueue +* feature only applies to FORWARD and RELEASE events. New events +(op=RTE_EVENT_OP_NEW) +* will be transmitted in the order the application enqueues them and +do not maintain +* any order relative to FORWARD/RELEASE events. FORWARD vs NEW +relaxed ordering +* only applies to ports that have enabled independent enqueue feature. +*/ +/* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0/**< Highest priority level for events and queues. @@ -1072,6 +1097,18 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t
queue_id,uint32_tattr_id,Quoted 9 lines
lib/eventdev/rte_eventdev.h +6
-0* * @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) +/**< Flag to enable independent enqueue. Must not be set if the +device +* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature +* allows an application to enqueue RTE_EVENT_OP_FORWARD or +* RTE_EVENT_OP_RELEASE in an order different than the order the lib/eventdev/rte_eventdev.h rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id, · line 1114
Quoted 10 lines
lib/eventdev/rte_eventdev.h +7
-0+* events were dequeued from the event device, while maintaining +* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. +* +* Note that this flag only matters for Eventdevs supporting burst mode. +* +* @see rte_event_port_setup() +*/ /** Event port configuration structure */ struct rte_event_port_conf {Acked-by Mattias Rönnblom <[email protected]>
RE: [PATCH v8 2/3] eventdev: add support for independent enqueue
Thanks Mattias,
Hi Jerin,
Are you okay with the changes so far?
Re: [PATCH v8 2/3] eventdev: add support for independent enqueue
Quoted 6 lines · Abdullah
Thanks Mattias,
Hi Jerin,
Are you okay with the changes so far?
The overall outlook is OK. Send next version with release note changes from 24.07 to 24.11.
RE: [PATCH v8 2/3] eventdev: add support for independent enqueue
Quoted 2 lines
+The overall outlook is OK. Send next version with release note changes from 24.07 to 24.11.
Thanks Jerin, I sent the new version patch v10.
v9 cover Independent Enqueue Support
In reply to Abdullah Sevincerv8: Address build issues.
v7: Address documentation reviews.
v6: Update patch with more documentation
v5: Address build issues
v4: Address comments
v3: Fix CI/build issues
v2: Fix CI/build issues
v1: Initial patchset
Abdullah Sevincer (3):
event/dlb2: add support for independent enqueue
eventdev: add support for independent enqueue event/dsw: add capability for independent enqueue
doc/guides/eventdevs/dlb2.rst | 41 ++ doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_11.rst | 34 +- drivers/event/dlb2/dlb2.c | 492 ++++++++++++++-------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 10 + drivers/event/dsw/dsw_evdev.c | 3 +- lib/eventdev/rte_eventdev.h | 37 ++ 11 files changed, 463 insertions(+), 216 deletions(-)
Signature · 1 line
2.25.1
PATCH v9 1/3 event/dlb2: add support for independent enqueue
DLB devices need events to be enqueued in the same order they are dequeued. Applications are not suppose to change event order between dequeue and to enqueue. Since Eventdev standard does not add such restrictions independent enqueue support is needed for DLB PMD so that it restores dequeue order on enqueue if applications happen to change it. It also adds missing releases in places where events are dropped by the application and it expects implicit release to handle it.
By default the feature will be off on all DLB ports and they will behave the same as older releases. To enable reordering feature, applications need to add the flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ to port configuration if only the device advertises the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ.
--- doc/guides/eventdevs/dlb2.rst | 41 +++ doc/guides/rel_notes/release_24_11.rst | 33 +- drivers/event/dlb2/dlb2.c | 492 ++++++++++++++++--------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 10 + 7 files changed, 417 insertions(+), 219 deletions(-)
doc/guides/eventdevs/dlb2.rst +41 -0
@@ -456,6 +456,47 @@ Example command to enable QE Weight feature: --allow ea:00.0,enable_cq_weight=<y/Y> +Independent Enqueue Capability +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +DLB2 hardware device expects all forwarded events to be enqueued in the same +order as they are dequeued. For dropped events, their releases should come at +the same location as the original event was expected. Hardware has this +restriction as it uses the order to retrieve information about the original +event that was sent to the CPU. This contains information like atomic flow +ID to release the flow lock and ordered events sequence number to restore the +original order. + +Some applications, like those based on the DPDK dispatcher library, want +enqueue order independence. To support this, DLB2 PMD supports the +``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` capability. + +This capability applies to Eventdevs supporting burst mode. On ports where +the application is going to change enqueue order, +``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` support should be enabled. + +Example code to inform PMD that the application plans to use independent enqueue +order on a port: + + .. code-block:: c + + if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) + port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; + +This code example enables enqueue event reordering inside DLB2 PMD before the events +are sent to the DLB2 hardware. If the application is not going to change the enqueue +order, this flag should not be enabled to get better performance. DLB2 PMD saves +ordering information inside the impl_opaque field of the event, and this field should +be preserved for all FORWARD or RELEASE events. Following MACROs are provided to get +and set this field inside the event in case the same event is not used for forwarding +(e.g., a new RELEASE event is created when the original event is dropped instead of +reusing the same event). + + .. code-block:: c + + #define RTE_EVENT_GET_IMPL_OPAQUE(ev) (ev->impl_opaque) + #define RTE_EVENT_SET_IMPL_OPAQUE(ev, val) (ev->impl_opaque = val) + Running Eventdev Applications with DLB Device ---------------------------------------------
doc/guides/rel_notes/release_24_11.rst +4 -29
@@ -24,36 +24,11 @@ DPDK Release 24.11 New Features ------------ -.. This section should contain new features added in this release. - Sample format: +* **Updated DLB2 Driver for independent enqueue feature** - * **Add a title in the past tense with a full stop.** - - Add a short 1-2 sentence description in the past tense. - The description should be enough to allow someone scanning - the release notes to understand the new feature. - - If the feature adds a lot of sub-features you can use a bullet list - like this: - - * Added feature foo to do something. - * Enhanced feature bar to do something else. - - Refer to the previous release notes for examples. - - Suggested order in release notes items: - * Core libs (EAL, mempool, ring, mbuf, buses) - * Device abstraction libs and PMDs (ordered alphabetically by vendor name) - - ethdev (lib, PMDs) - - cryptodev (lib, PMDs) - - eventdev (lib, PMDs) - - etc - * Other libs - * Apps, Examples, Tools (if significant) - - This section is a comment. Do not overwrite or remove it. - Also, make sure to start the actual text at the margin. - ======================================================= + Added support for DLB independent enqueue feature. Applications should use + ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability + ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. Removed Items
drivers/event/dlb2/dlb2.c +322 -170
691 lines not on this page · raw message
drivers/event/dlb2/dlb2_avx512.c +14 -13
@@ -151,20 +151,20 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port,*/ #define DLB2_QE_EV_TYPE_WORD 0 sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[0 ].sub_event_type <<8 | - ev[0 ].event_type, + ev[0 ].sub_event_type <<4 | + ev[0 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[1 ].sub_event_type <<8 | - ev[1 ].event_type, + ev[1 ].sub_event_type <<4 | + ev[1 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[2 ].sub_event_type <<8 | - ev[2 ].event_type, + ev[2 ].sub_event_type <<4 | + ev[2 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[3 ].sub_event_type <<8 | - ev[3 ].event_type, + ev[3 ].sub_event_type <<4 | + ev[3 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 );if (qm_port->use_avx512) {
@@ -238,11 +238,11 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, }/* will only be set for DLB 2.5 + */ -if (qm_port->cq_weight) { - qe[0 ].weight = ev[0 ].impl_opaque &3 ; - qe[1 ].weight = ev[1 ].impl_opaque &3 ; - qe[2 ].weight = ev[2 ].impl_opaque &3 ; - qe[3 ].weight = ev[3 ].impl_opaque &3 ; +if (qm_port->dlb2->enable_cq_weight) { + qe[0 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[0 ]); + qe[1 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[1 ]); + qe[2 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[2 ]); + qe[3 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[3 ]); }break ;
@@ -267,6 +267,7 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, } qe[i].u.event_type.major = ev[i].event_type; qe[i].u.event_type.sub = ev[i].sub_event_type; + qe[i].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[i]); }break ;case 0 :
drivers/event/dlb2/dlb2_inline_fns.h +8 -0
@@ -32,4 +32,12 @@ dlb2_movdir64b(void *dest, void *src) : "a" (dest), "d" (src)); } +static inline void +dlb2_movdir64b_single (void *pp_addr,void *qe4) +{ + asmvolatile (".byte 0x66, 0x0f, 0x38, 0xf8, 0x02" + : + :"a" (pp_addr),"d" (qe4)); +} +#endif /* _DLB2_INLINE_FNS_H_ */
drivers/event/dlb2/dlb2_priv.h +18 -7
@@ -29,7 +29,8 @@#define DLB2_SW_CREDIT_C_QUANTA_DEFAULT 256/* Consumer */ #define DLB2_DEPTH_THRESH_DEFAULT 256#define DLB2_MIN_CQ_DEPTH_OVERRIDE 32 -#define DLB2_MAX_CQ_DEPTH_OVERRIDE 128 +#define DLB2_MAX_CQ_DEPTH_OVERRIDE 1024 +#define DLB2_MAX_CQ_DEPTH_REORDER 128#define DLB2_MIN_ENQ_DEPTH_OVERRIDE 32#define DLB2_MAX_ENQ_DEPTH_OVERRIDE 1024
@@ -387,8 +388,23 @@ struct dlb2_port {bool use_scalar;/* force usage of scalar code */ uint16_t hw_credit_quanta;bool use_avx512; -uint32_t cq_weight;bool is_producer;/* True if port is of type producer */ +uint8_t reorder_id;/* id used for reordering events coming back into the scheduler */ +bool reorder_en; +struct dlb2_reorder *order;/* For ordering enqueues */ +}; + +struct dlb2_reorder { +/* a reorder buffer for events coming back in different order from dequeue +* We use UINT8_MAX + 1 elements, but add on three no-ops to make movdirs easier at the end +*/ +union { +__m128i m128; +struct dlb2_enqueue_qe qe; +uint64_t u64[2 ]; + } enq_reorder[UINT8_MAX +4 ]; +/* id of the next entry in the reorder enqueue ring to send in */ +uint8_t next_to_enqueue; };/* Per-process per-port mmio and memory pointers */
@@ -642,10 +658,6 @@ struct dlb2_qid_depth_thresholds {int val[DLB2_MAX_NUM_QUEUES_ALL ]; }; -struct dlb2_cq_weight { -int limit[DLB2_MAX_NUM_PORTS_ALL ]; -}; -struct dlb2_port_cos {int cos_id[DLB2_MAX_NUM_PORTS_ALL ]; };
@@ -667,7 +679,6 @@ struct dlb2_devargs {bool vector_opts_enabled;int max_cq_depth;int max_enq_depth; -struct dlb2_cq_weight cq_weight;struct dlb2_port_cos port_cos;struct dlb2_cos_bw cos_bw;const char *producer_coremask;
drivers/event/dlb2/rte_pmd_dlb2.h +10 -0
@@ -19,6 +19,16 @@ extern "C" {#include <rte_compat.h> +/** +* Macros to get/set QID depth and QE weight from rte_event metadata. +* Currently 'rsvd' field is used for these. Lower 2 bits are used to store +* QID depth while the upper 2 bits are used for QER weight. +*/ +#define RTE_PMD_DLB2_GET_QID_DEPTH (x) ((x)->rsvd & 0x3) +#define RTE_PMD_DLB2_SET_QID_DEPTH (x, v) ((x)->rsvd = ((x)->rsvd & ~0x3) | (v & 0x3)) +#define RTE_PMD_DLB2_GET_QE_WEIGHT (x) (((x)->rsvd >> 2) & 0x3) +#define RTE_PMD_DLB2_SET_QE_WEIGHT (x, v) ((x)->rsvd = ((x)->rsvd & 0x3) | ((v & 0x3) << 2)) +/** * @warning * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
Signature · 1 line
2.25.1
PATCH v9 2/3 eventdev: add support for independent enqueue
In reply to Abdullah SevincerThis commit adds support for independent enqueue feature and updates Event Device and PMD feature list.
A new capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ is introduced. It allows out-of-order enqueuing of RTE_EVENT_OP_FORWARD or RELEASE type events on an event port where this capability is enabled.
To use this capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists.
--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_11.rst | 5 +++ lib/eventdev/rte_eventdev.h | 37 +++++++++++++++++++++++ 4 files changed, 44 insertions(+)
doc/guides/eventdevs/features/default.ini +1 -0
@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.
doc/guides/eventdevs/features/dlb2.ini +1 -0
@@ -15,6 +15,7 @@ implicit_release_disable = Y runtime_port_link = Y multiple_queue_port = Y maintenance_free = Y +independent_enq = Y [Eth Rx adapter Features]
doc/guides/rel_notes/release_24_11.rst +5 -0
@@ -30,6 +30,11 @@ New Features ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. +* **Updated Event Device Library for independent enqueue feature** + + * Added support for independent enqueue feature. Updated Event Device and + PMD feature list. + Removed Items -------------
lib/eventdev/rte_eventdev.h +37 -0
@@ -446,6 +446,31 @@ struct rte_event;* @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ (1ULL << 16) +/**< Event device is capable of independent enqueue. +* A new capability, RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, will indicate that Eventdev +* supports the enqueue in any order or specifically in a different order than the +* dequeue. Eventdev PMD can either transmit events in the changed order in which +* they are enqueued or restore the original order before sending them to the +* underlying hardware device. A flag is provided during the port configuration to +* inform Eventdev PMD that the application intends to use an independent enqueue +* order on a particular port. Note that this capability only matters for Eventdevs +* supporting burst mode. +* +* To Inform PMD that the application plans to use independent enqueue order on a port +* this code example can be used: +* +* if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) +* port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; +* +* When an implicit release is enabled on a port, Eventdev PMD will also handle +* the insertion of RELEASE events in place of dropped events. The independent enqueue +* feature only applies to FORWARD and RELEASE events. New events (op=RTE_EVENT_OP_NEW) +* will be transmitted in the order the application enqueues them and do not maintain +* any order relative to FORWARD/RELEASE events. FORWARD vs NEW relaxed ordering +* only applies to ports that have enabled independent enqueue feature. +*/ +/* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0/**< Highest priority level for events and queues.
@@ -1072,6 +1097,18 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* * @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) +/**< Flag to enable independent enqueue. Must not be set if the device +* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature +* allows an application to enqueue RTE_EVENT_OP_FORWARD or +* RTE_EVENT_OP_RELEASE in an order different than the order the +* events were dequeued from the event device, while maintaining +* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. +* +* Note that this flag only matters for Eventdevs supporting burst mode. +* +* @see rte_event_port_setup() +*/ /** Event port configuration structure */ struct rte_event_port_conf {
Signature · 1 line
2.25.1
PATCH v9 3/3 event/dsw: add capability for independent enqueue
In reply to Abdullah SevincerTo use independent enqueue capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists. Hence, this commit adds the capability of independent enqueue to the DSW driver.
--- doc/guides/rel_notes/release_24_11.rst | 4 ++++ drivers/event/dsw/dsw_evdev.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-)
doc/guides/rel_notes/release_24_11.rst +4 -0
@@ -35,6 +35,10 @@ New Features * Added support for independent enqueue feature. Updated Event Device and PMD feature list. +* **Updated DSW Driver for independent enqueue feature** + + * Added capability flag for DSW to advertise independent enqueue feature. + Removed Items -------------
drivers/event/dsw/dsw_evdev.c +2 -1
@@ -230,7 +230,8 @@ dsw_info_get(struct rte_eventdev *dev __rte_unused,RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE |RTE_EVENT_DEV_CAP_NONSEQ_MODE |RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT | - RTE_EVENT_DEV_CAP_CARRY_FLOW_ID +RTE_EVENT_DEV_CAP_CARRY_FLOW_ID | + RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ }; }
Signature · 1 line
2.25.1
v10 cover Independent Enqueue Support
In reply to Abdullah Sevincerv10: Add acked-by reviewer name.
v9: Address comments.
v8: Address build issues.
v7: Address documentation reviews.
v6: Update patch with more documentation
v5: Address build issues
v4: Address comments
v3: Fix CI/build issues
v2: Fix CI/build issues
v1: Initial patchset
Abdullah Sevincer (3):
event/dlb2: add support for independent enqueue
eventdev: add support for independent enqueue event/dsw: add capability for independent enqueue
doc/guides/eventdevs/dlb2.rst | 41 ++ doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_11.rst | 34 +- drivers/event/dlb2/dlb2.c | 492 ++++++++++++++-------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 10 + drivers/event/dsw/dsw_evdev.c | 3 +- lib/eventdev/rte_eventdev.h | 37 ++ 11 files changed, 463 insertions(+), 216 deletions(-)
Signature · 1 line
2.25.1
PATCH v10 1/3 event/dlb2: add support for independent enqueue
DLB devices need events to be enqueued in the same order they are dequeued. Applications are not suppose to change event order between dequeue and to enqueue. Since Eventdev standard does not add such restrictions independent enqueue support is needed for DLB PMD so that it restores dequeue order on enqueue if applications happen to change it. It also adds missing releases in places where events are dropped by the application and it expects implicit release to handle it.
By default the feature will be off on all DLB ports and they will behave the same as older releases. To enable reordering feature, applications need to add the flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ to port configuration if only the device advertises the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ.
--- doc/guides/eventdevs/dlb2.rst | 41 +++ doc/guides/rel_notes/release_24_11.rst | 33 +- drivers/event/dlb2/dlb2.c | 492 ++++++++++++++++--------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 10 + 7 files changed, 417 insertions(+), 219 deletions(-)
doc/guides/eventdevs/dlb2.rst +41 -0
@@ -456,6 +456,47 @@ Example command to enable QE Weight feature: --allow ea:00.0,enable_cq_weight=<y/Y> +Independent Enqueue Capability +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +DLB2 hardware device expects all forwarded events to be enqueued in the same +order as they are dequeued. For dropped events, their releases should come at +the same location as the original event was expected. Hardware has this +restriction as it uses the order to retrieve information about the original +event that was sent to the CPU. This contains information like atomic flow +ID to release the flow lock and ordered events sequence number to restore the +original order. + +Some applications, like those based on the DPDK dispatcher library, want +enqueue order independence. To support this, DLB2 PMD supports the +``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` capability. + +This capability applies to Eventdevs supporting burst mode. On ports where +the application is going to change enqueue order, +``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` support should be enabled. + +Example code to inform PMD that the application plans to use independent enqueue +order on a port: + + .. code-block:: c + + if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) + port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; + +This code example enables enqueue event reordering inside DLB2 PMD before the events +are sent to the DLB2 hardware. If the application is not going to change the enqueue +order, this flag should not be enabled to get better performance. DLB2 PMD saves +ordering information inside the impl_opaque field of the event, and this field should +be preserved for all FORWARD or RELEASE events. Following MACROs are provided to get +and set this field inside the event in case the same event is not used for forwarding +(e.g., a new RELEASE event is created when the original event is dropped instead of +reusing the same event). + + .. code-block:: c + + #define RTE_EVENT_GET_IMPL_OPAQUE(ev) (ev->impl_opaque) + #define RTE_EVENT_SET_IMPL_OPAQUE(ev, val) (ev->impl_opaque = val) + Running Eventdev Applications with DLB Device ---------------------------------------------
doc/guides/rel_notes/release_24_11.rst +4 -29
@@ -24,36 +24,11 @@ DPDK Release 24.11 New Features ------------ -.. This section should contain new features added in this release. - Sample format: +* **Updated DLB2 Driver for independent enqueue feature** - * **Add a title in the past tense with a full stop.** - - Add a short 1-2 sentence description in the past tense. - The description should be enough to allow someone scanning - the release notes to understand the new feature. - - If the feature adds a lot of sub-features you can use a bullet list - like this: - - * Added feature foo to do something. - * Enhanced feature bar to do something else. - - Refer to the previous release notes for examples. - - Suggested order in release notes items: - * Core libs (EAL, mempool, ring, mbuf, buses) - * Device abstraction libs and PMDs (ordered alphabetically by vendor name) - - ethdev (lib, PMDs) - - cryptodev (lib, PMDs) - - eventdev (lib, PMDs) - - etc - * Other libs - * Apps, Examples, Tools (if significant) - - This section is a comment. Do not overwrite or remove it. - Also, make sure to start the actual text at the margin. - ======================================================= + Added support for DLB independent enqueue feature. Applications should use + ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability + ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. Removed Items
drivers/event/dlb2/dlb2.c +322 -170
691 lines not on this page · raw message
drivers/event/dlb2/dlb2_avx512.c +14 -13
@@ -151,20 +151,20 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port,*/ #define DLB2_QE_EV_TYPE_WORD 0 sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[0 ].sub_event_type <<8 | - ev[0 ].event_type, + ev[0 ].sub_event_type <<4 | + ev[0 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[1 ].sub_event_type <<8 | - ev[1 ].event_type, + ev[1 ].sub_event_type <<4 | + ev[1 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[2 ].sub_event_type <<8 | - ev[2 ].event_type, + ev[2 ].sub_event_type <<4 | + ev[2 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[3 ].sub_event_type <<8 | - ev[3 ].event_type, + ev[3 ].sub_event_type <<4 | + ev[3 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 );if (qm_port->use_avx512) {
@@ -238,11 +238,11 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, }/* will only be set for DLB 2.5 + */ -if (qm_port->cq_weight) { - qe[0 ].weight = ev[0 ].impl_opaque &3 ; - qe[1 ].weight = ev[1 ].impl_opaque &3 ; - qe[2 ].weight = ev[2 ].impl_opaque &3 ; - qe[3 ].weight = ev[3 ].impl_opaque &3 ; +if (qm_port->dlb2->enable_cq_weight) { + qe[0 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[0 ]); + qe[1 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[1 ]); + qe[2 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[2 ]); + qe[3 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[3 ]); }break ;
@@ -267,6 +267,7 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, } qe[i].u.event_type.major = ev[i].event_type; qe[i].u.event_type.sub = ev[i].sub_event_type; + qe[i].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[i]); }break ;case 0 :
drivers/event/dlb2/dlb2_inline_fns.h +8 -0
@@ -32,4 +32,12 @@ dlb2_movdir64b(void *dest, void *src) : "a" (dest), "d" (src)); } +static inline void +dlb2_movdir64b_single (void *pp_addr,void *qe4) +{ + asmvolatile (".byte 0x66, 0x0f, 0x38, 0xf8, 0x02" + : + :"a" (pp_addr),"d" (qe4)); +} +#endif /* _DLB2_INLINE_FNS_H_ */
drivers/event/dlb2/dlb2_priv.h +18 -7
@@ -29,7 +29,8 @@#define DLB2_SW_CREDIT_C_QUANTA_DEFAULT 256/* Consumer */ #define DLB2_DEPTH_THRESH_DEFAULT 256#define DLB2_MIN_CQ_DEPTH_OVERRIDE 32 -#define DLB2_MAX_CQ_DEPTH_OVERRIDE 128 +#define DLB2_MAX_CQ_DEPTH_OVERRIDE 1024 +#define DLB2_MAX_CQ_DEPTH_REORDER 128#define DLB2_MIN_ENQ_DEPTH_OVERRIDE 32#define DLB2_MAX_ENQ_DEPTH_OVERRIDE 1024
@@ -387,8 +388,23 @@ struct dlb2_port {bool use_scalar;/* force usage of scalar code */ uint16_t hw_credit_quanta;bool use_avx512; -uint32_t cq_weight;bool is_producer;/* True if port is of type producer */ +uint8_t reorder_id;/* id used for reordering events coming back into the scheduler */ +bool reorder_en; +struct dlb2_reorder *order;/* For ordering enqueues */ +}; + +struct dlb2_reorder { +/* a reorder buffer for events coming back in different order from dequeue +* We use UINT8_MAX + 1 elements, but add on three no-ops to make movdirs easier at the end +*/ +union { +__m128i m128; +struct dlb2_enqueue_qe qe; +uint64_t u64[2 ]; + } enq_reorder[UINT8_MAX +4 ]; +/* id of the next entry in the reorder enqueue ring to send in */ +uint8_t next_to_enqueue; };/* Per-process per-port mmio and memory pointers */
@@ -642,10 +658,6 @@ struct dlb2_qid_depth_thresholds {int val[DLB2_MAX_NUM_QUEUES_ALL ]; }; -struct dlb2_cq_weight { -int limit[DLB2_MAX_NUM_PORTS_ALL ]; -}; -struct dlb2_port_cos {int cos_id[DLB2_MAX_NUM_PORTS_ALL ]; };
@@ -667,7 +679,6 @@ struct dlb2_devargs {bool vector_opts_enabled;int max_cq_depth;int max_enq_depth; -struct dlb2_cq_weight cq_weight;struct dlb2_port_cos port_cos;struct dlb2_cos_bw cos_bw;const char *producer_coremask;
drivers/event/dlb2/rte_pmd_dlb2.h +10 -0
@@ -19,6 +19,16 @@ extern "C" {#include <rte_compat.h> +/** +* Macros to get/set QID depth and QE weight from rte_event metadata. +* Currently 'rsvd' field is used for these. Lower 2 bits are used to store +* QID depth while the upper 2 bits are used for QER weight. +*/ +#define RTE_PMD_DLB2_GET_QID_DEPTH (x) ((x)->rsvd & 0x3) +#define RTE_PMD_DLB2_SET_QID_DEPTH (x, v) ((x)->rsvd = ((x)->rsvd & ~0x3) | (v & 0x3)) +#define RTE_PMD_DLB2_GET_QE_WEIGHT (x) (((x)->rsvd >> 2) & 0x3) +#define RTE_PMD_DLB2_SET_QE_WEIGHT (x, v) ((x)->rsvd = ((x)->rsvd & 0x3) | ((v & 0x3) << 2)) +/** * @warning * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
Signature · 1 line
2.25.1
Re: [PATCH v10 1/3] event/dlb2: add support for independent enqueue
This commit should after "[PATCH v10 2/3] eventdev: add support for independent enqueue" because this commit use the macro which defined in later commit. Suggest order:
1. lib's commit
2. driver's commits
Quoted 17 lines · Abdullah Sevincer
DLB devices need events to be enqueued in the same order they are dequeued. Applications are not suppose to change event order between dequeue and to enqueue. Since Eventdev standard does not add such restrictions independent enqueue support is needed for DLB PMD so that it restores dequeue order on enqueue if applications happen to change it. It also adds missing releases in places where events are dropped by the application and it expects implicit release to handle it.
By default the feature will be off on all DLB ports and they will behave the same as older releases. To enable reordering feature, applications need to add the flag
RTE_EVENT_PORT_CFG_INDEPENDENT_ENQto port configuration if only the device advertises the capabilityRTE_EVENT_DEV_CAP_INDEPENDENT_ENQ.Signed-off-by Abdullah Sevincer <[email protected]>Acked-by Mattias Rönnblom <[email protected]>---
...
Quoted 24 lines
New Features
-------------.. This section should contain new features added in this release.
doc/guides/rel_notes/release_24_11.rst +1
-18- Sample format: +* **Updated DLB2 Driver for independent enqueue feature** - * **Add a title in the past tense with a full stop.** - - Add a short 1-2 sentence description in the past tense. - The description should be enough to allow someone scanning - the release notes to understand the new feature. - - If the feature adds a lot of sub-features you can use a bullet list - like this: - - * Added feature foo to do something. - * Enhanced feature bar to do something else. - - Refer to the previous release notes for examples. - - Suggested order in release notes items: - * Core libs (EAL, mempool, ring, mbuf, buses) - * Device abstraction libs and PMDs (ordered alphabetically by vendor name)
doc/guides/rel_notes/release_24_11.rst DPDK Release 24.11 · line 56
Quoted 10 lines
doc/guides/rel_notes/release_24_11.rst +0
-10- - ethdev (lib, PMDs) - - cryptodev (lib, PMDs) - - eventdev (lib, PMDs) - - etc - * Other libs - * Apps, Examples, Tools (if significant) - - This section is a comment. Do not overwrite or remove it. - Also, make sure to start the actual text at the margin. - =======================================================
The above line will remove when DPDK 24.11 released, please don't remove it when developing.
...
RE: [PATCH v10 1/3] event/dlb2: add support for independent enqueue
Review
Quoted 5 lines
(quoted diff) +4
-0+This commit should after "[PATCH v10 2/3] eventdev: add support for independent enqueue" +because this commit use the macro which defined in later commit. Suggest order: +1. lib's commit +2. driver's commits
Thanks this is addressed with v12
Quoted 1 line
+The above line will remove when DPDK 24.11 released, please don't remove it when developing.
Thanks this is addressed with v12
v11 cover Independent Enqueue Support
In reply to Abdullah Sevincerv11: Address comments.
v10: Add acked-by reviewer name.
v9: Address comments.
v8: Address build issues.
v7: Address documentation reviews.
v6: Update patch with more documentation
v5: Address build issues
v4: Address comments
v3: Fix CI/build issues
v2: Fix CI/build issues
v1: Initial patchset
Abdullah Sevincer (3):
eventdev: add support for independent enqueue event/dlb2: add support for independent enqueue event/dsw: add capability for independent enqueue
doc/guides/eventdevs/dlb2.rst | 41 ++ doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_11.rst | 15 + drivers/event/dlb2/dlb2.c | 492 ++++++++++++++-------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 10 + drivers/event/dsw/dsw_evdev.c | 3 +- lib/eventdev/rte_eventdev.h | 37 ++ 11 files changed, 469 insertions(+), 191 deletions(-)
Signature · 1 line
2.25.1
PATCH v11 1/3 eventdev: add support for independent enqueue
This commit adds support for independent enqueue feature and updates Event Device and PMD feature list.
A new capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ is introduced. It allows out-of-order enqueuing of RTE_EVENT_OP_FORWARD or RELEASE type events on an event port where this capability is enabled.
To use this capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists.
--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_11.rst | 5 +++ lib/eventdev/rte_eventdev.h | 37 +++++++++++++++++++++++ 4 files changed, 44 insertions(+)
doc/guides/eventdevs/features/default.ini +1 -0
@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.
doc/guides/eventdevs/features/dlb2.ini +1 -0
@@ -15,6 +15,7 @@ implicit_release_disable = Y runtime_port_link = Y multiple_queue_port = Y maintenance_free = Y +independent_enq = Y [Eth Rx adapter Features]
doc/guides/rel_notes/release_24_11.rst +5 -0
@@ -55,6 +55,11 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* **Updated Event Device Library for independent enqueue feature** + + * Added support for independent enqueue feature. Updated Event Device and + PMD feature list. + Removed Items -------------
lib/eventdev/rte_eventdev.h +37 -0
@@ -446,6 +446,31 @@ struct rte_event;* @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ (1ULL << 16) +/**< Event device is capable of independent enqueue. +* A new capability, RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, will indicate that Eventdev +* supports the enqueue in any order or specifically in a different order than the +* dequeue. Eventdev PMD can either transmit events in the changed order in which +* they are enqueued or restore the original order before sending them to the +* underlying hardware device. A flag is provided during the port configuration to +* inform Eventdev PMD that the application intends to use an independent enqueue +* order on a particular port. Note that this capability only matters for Eventdevs +* supporting burst mode. +* +* To Inform PMD that the application plans to use independent enqueue order on a port +* this code example can be used: +* +* if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) +* port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; +* +* When an implicit release is enabled on a port, Eventdev PMD will also handle +* the insertion of RELEASE events in place of dropped events. The independent enqueue +* feature only applies to FORWARD and RELEASE events. New events (op=RTE_EVENT_OP_NEW) +* will be transmitted in the order the application enqueues them and do not maintain +* any order relative to FORWARD/RELEASE events. FORWARD vs NEW relaxed ordering +* only applies to ports that have enabled independent enqueue feature. +*/ +/* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0/**< Highest priority level for events and queues.
@@ -1072,6 +1097,18 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* * @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) +/**< Flag to enable independent enqueue. Must not be set if the device +* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature +* allows an application to enqueue RTE_EVENT_OP_FORWARD or +* RTE_EVENT_OP_RELEASE in an order different than the order the +* events were dequeued from the event device, while maintaining +* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. +* +* Note that this flag only matters for Eventdevs supporting burst mode. +* +* @see rte_event_port_setup() +*/ /** Event port configuration structure */ struct rte_event_port_conf {
Signature · 1 line
2.25.1
Re: [PATCH v11 1/3] eventdev: add support for independent enqueue
Quoted 8 lines · Abdullah Sevincer
This commit adds support for independent enqueue feature and updates Event Device and PMD feature list.
A new capability
RTE_EVENT_DEV_CAP_INDEPENDENT_ENQis introduced. It allows out-of-order enqueuing ofRTE_EVENT_OP_FORWARDor RELEASE type events on an event port where this capability is enabled.
Quoted 6 lines
To use this capability applications need to set flag
RTE_EVENT_PORT_CFG_INDEPENDENT_ENQduring port setup only if the capabilityRTE_EVENT_DEV_CAP_INDEPENDENT_ENQexists.Signed-off-by Abdullah Sevincer <[email protected]>Acked-by Mattias Rönnblom <[email protected]>
Good to merge next version. Some minor comments.
Quoted 36 lines
--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_11.rst | 5 +++ lib/eventdev/rte_eventdev.h | 37 +++++++++++++++++++++++ 4 files changed, 44 insertions(+)doc/guides/eventdevs/features/default.ini +1
-0@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.doc/guides/eventdevs/features/dlb2.ini +1
-0@@ -15,6 +15,7 @@ implicit_release_disable = Y runtime_port_link = Y multiple_queue_port = Y maintenance_free = Y +independent_enq = Y [Eth Rx adapter Features]doc/guides/rel_notes/release_24_11.rst +0
-0
doc/guides/rel_notes/release_24_11.rst New Features · line 58
Quoted 4 lines
doc/guides/rel_notes/release_24_11.rst +1
-0@@ -55,6 +55,11 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* **Updated Event Device Library for independent enqueue feature**
Updated eventdev to support independent enqueue feature i.e Change Event Device Library to eventdev
doc/guides/rel_notes/release_24_11.rst New Features · line 60
Quoted 2 lines
doc/guides/rel_notes/release_24_11.rst +2
-0+ + * Added support for independent enqueue feature. Updated Event Device and
i.e Change Event Device Library to eventdev
Quoted 10 lines
doc/guides/rel_notes/release_24_11.rst +2
-0+ PMD feature list. + Removed Items -------------lib/eventdev/rte_eventdev.h +0
-0
lib/eventdev/rte_eventdev.h struct rte_event; · line 451
Quoted 6 lines
lib/eventdev/rte_eventdev.h +3
-0@@ -446,6 +446,31 @@ struct rte_event;* @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ (1ULL << 16) +/**< Event device is capable of independent enqueue. +* A new capability, RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, will indicate that Eventdev
Eventdev->eventdev
lib/eventdev/rte_eventdev.h struct rte_event; · line 453
Quoted 2 lines
lib/eventdev/rte_eventdev.h +2
-0+* supports the enqueue in any order or specifically in a different order than the +* dequeue. Eventdev PMD can either transmit events in the changed order in which
transmit->enqueue
lib/eventdev/rte_eventdev.h struct rte_event; · line 457
Quoted 4 lines
lib/eventdev/rte_eventdev.h +4
-0+* they are enqueued or restore the original order before sending them to the +* underlying hardware device. A flag is provided during the port configuration to +* inform Eventdev PMD that the application intends to use an independent enqueue +* order on a particular port. Note that this capability only matters for Eventdevs
Eventdevs->eventdevs
lib/eventdev/rte_eventdev.h struct rte_event; · line 460
Quoted 3 lines
lib/eventdev/rte_eventdev.h +3
-0+* supporting burst mode. +* +* To Inform PMD that the application plans to use independent enqueue order on a port
Inform->inform
lib/eventdev/rte_eventdev.h struct rte_event; · line 469
Quoted 9 lines
lib/eventdev/rte_eventdev.h +9
-0+* this code example can be used: +* +* if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) +* port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; +* +* When an implicit release is enabled on a port, Eventdev PMD will also handle +* the insertion of RELEASE events in place of dropped events. The independent enqueue +* feature only applies to FORWARD and RELEASE events. New events (op=RTE_EVENT_OP_NEW) +* will be transmitted in the order the application enqueues them and do not maintain
transmitted->enqueued
Quoted 10 lines
lib/eventdev/rte_eventdev.h +4
-0+* any order relative to FORWARD/RELEASE events. FORWARD vs NEW relaxed ordering +* only applies to ports that have enabled independent enqueue feature. +*/ +/* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0/**< Highest priority level for events and queues. @@ -1072,6 +1097,18 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* * @see rte_event_port_setup()
lib/eventdev/rte_eventdev.h rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id, · line 1108
Quoted 10 lines
lib/eventdev/rte_eventdev.h +9
-0*/ +#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) +/**< Flag to enable independent enqueue. Must not be set if the device +* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature +* allows an application to enqueue RTE_EVENT_OP_FORWARD or +* RTE_EVENT_OP_RELEASE in an order different than the order the +* events were dequeued from the event device, while maintaining +* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. +* +* Note that this flag only matters for Eventdevs supporting burst mode.
Eventdevs->eventdevs
Quoted 9 lines
lib/eventdev/rte_eventdev.h +3
-1+* +* @see rte_event_port_setup() +*/ /** Event port configuration structure */ struct rte_event_port_conf { --2.25.1
PATCH v11 2/3 event/dlb2: add support for independent enqueue
In reply to Abdullah SevincerDLB devices need events to be enqueued in the same order they are dequeued. Applications are not suppose to change event order between dequeue and to enqueue. Since Eventdev standard does not add such restrictions independent enqueue support is needed for DLB PMD so that it restores dequeue order on enqueue if applications happen to change it. It also adds missing releases in places where events are dropped by the application and it expects implicit release to handle it.
By default the feature will be off on all DLB ports and they will behave the same as older releases. To enable reordering feature, applications need to add the flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ to port configuration if only the device advertises the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ.
--- doc/guides/eventdevs/dlb2.rst | 41 +++ doc/guides/rel_notes/release_24_11.rst | 6 + drivers/event/dlb2/dlb2.c | 492 ++++++++++++++++--------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 10 + 7 files changed, 419 insertions(+), 190 deletions(-)
doc/guides/eventdevs/dlb2.rst +41 -0
@@ -456,6 +456,47 @@ Example command to enable QE Weight feature: --allow ea:00.0,enable_cq_weight=<y/Y> +Independent Enqueue Capability +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +DLB2 hardware device expects all forwarded events to be enqueued in the same +order as they are dequeued. For dropped events, their releases should come at +the same location as the original event was expected. Hardware has this +restriction as it uses the order to retrieve information about the original +event that was sent to the CPU. This contains information like atomic flow +ID to release the flow lock and ordered events sequence number to restore the +original order. + +Some applications, like those based on the DPDK dispatcher library, want +enqueue order independence. To support this, DLB2 PMD supports the +``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` capability. + +This capability applies to Eventdevs supporting burst mode. On ports where +the application is going to change enqueue order, +``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` support should be enabled. + +Example code to inform PMD that the application plans to use independent enqueue +order on a port: + + .. code-block:: c + + if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) + port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; + +This code example enables enqueue event reordering inside DLB2 PMD before the events +are sent to the DLB2 hardware. If the application is not going to change the enqueue +order, this flag should not be enabled to get better performance. DLB2 PMD saves +ordering information inside the impl_opaque field of the event, and this field should +be preserved for all FORWARD or RELEASE events. Following MACROs are provided to get +and set this field inside the event in case the same event is not used for forwarding +(e.g., a new RELEASE event is created when the original event is dropped instead of +reusing the same event). + + .. code-block:: c + + #define RTE_EVENT_GET_IMPL_OPAQUE(ev) (ev->impl_opaque) + #define RTE_EVENT_SET_IMPL_OPAQUE(ev, val) (ev->impl_opaque = val) + Running Eventdev Applications with DLB Device ---------------------------------------------
doc/guides/rel_notes/release_24_11.rst +6 -0
@@ -60,6 +60,12 @@ New Features * Added support for independent enqueue feature. Updated Event Device and PMD feature list. +* **Updated DLB2 Driver for independent enqueue feature** + + Added support for DLB independent enqueue feature. Applications should use + ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability + ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. + Removed Items -------------
drivers/event/dlb2/dlb2.c +322 -170
691 lines not on this page · raw message
drivers/event/dlb2/dlb2_avx512.c +14 -13
@@ -151,20 +151,20 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port,*/ #define DLB2_QE_EV_TYPE_WORD 0 sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[0 ].sub_event_type <<8 | - ev[0 ].event_type, + ev[0 ].sub_event_type <<4 | + ev[0 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[1 ].sub_event_type <<8 | - ev[1 ].event_type, + ev[1 ].sub_event_type <<4 | + ev[1 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[2 ].sub_event_type <<8 | - ev[2 ].event_type, + ev[2 ].sub_event_type <<4 | + ev[2 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[3 ].sub_event_type <<8 | - ev[3 ].event_type, + ev[3 ].sub_event_type <<4 | + ev[3 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 );if (qm_port->use_avx512) {
@@ -238,11 +238,11 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, }/* will only be set for DLB 2.5 + */ -if (qm_port->cq_weight) { - qe[0 ].weight = ev[0 ].impl_opaque &3 ; - qe[1 ].weight = ev[1 ].impl_opaque &3 ; - qe[2 ].weight = ev[2 ].impl_opaque &3 ; - qe[3 ].weight = ev[3 ].impl_opaque &3 ; +if (qm_port->dlb2->enable_cq_weight) { + qe[0 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[0 ]); + qe[1 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[1 ]); + qe[2 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[2 ]); + qe[3 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[3 ]); }break ;
@@ -267,6 +267,7 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, } qe[i].u.event_type.major = ev[i].event_type; qe[i].u.event_type.sub = ev[i].sub_event_type; + qe[i].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[i]); }break ;case 0 :
drivers/event/dlb2/dlb2_inline_fns.h +8 -0
@@ -32,4 +32,12 @@ dlb2_movdir64b(void *dest, void *src) : "a" (dest), "d" (src)); } +static inline void +dlb2_movdir64b_single (void *pp_addr,void *qe4) +{ + asmvolatile (".byte 0x66, 0x0f, 0x38, 0xf8, 0x02" + : + :"a" (pp_addr),"d" (qe4)); +} +#endif /* _DLB2_INLINE_FNS_H_ */
drivers/event/dlb2/dlb2_priv.h +18 -7
@@ -29,7 +29,8 @@#define DLB2_SW_CREDIT_C_QUANTA_DEFAULT 256/* Consumer */ #define DLB2_DEPTH_THRESH_DEFAULT 256#define DLB2_MIN_CQ_DEPTH_OVERRIDE 32 -#define DLB2_MAX_CQ_DEPTH_OVERRIDE 128 +#define DLB2_MAX_CQ_DEPTH_OVERRIDE 1024 +#define DLB2_MAX_CQ_DEPTH_REORDER 128#define DLB2_MIN_ENQ_DEPTH_OVERRIDE 32#define DLB2_MAX_ENQ_DEPTH_OVERRIDE 1024
@@ -387,8 +388,23 @@ struct dlb2_port {bool use_scalar;/* force usage of scalar code */ uint16_t hw_credit_quanta;bool use_avx512; -uint32_t cq_weight;bool is_producer;/* True if port is of type producer */ +uint8_t reorder_id;/* id used for reordering events coming back into the scheduler */ +bool reorder_en; +struct dlb2_reorder *order;/* For ordering enqueues */ +}; + +struct dlb2_reorder { +/* a reorder buffer for events coming back in different order from dequeue +* We use UINT8_MAX + 1 elements, but add on three no-ops to make movdirs easier at the end +*/ +union { +__m128i m128; +struct dlb2_enqueue_qe qe; +uint64_t u64[2 ]; + } enq_reorder[UINT8_MAX +4 ]; +/* id of the next entry in the reorder enqueue ring to send in */ +uint8_t next_to_enqueue; };/* Per-process per-port mmio and memory pointers */
@@ -642,10 +658,6 @@ struct dlb2_qid_depth_thresholds {int val[DLB2_MAX_NUM_QUEUES_ALL ]; }; -struct dlb2_cq_weight { -int limit[DLB2_MAX_NUM_PORTS_ALL ]; -}; -struct dlb2_port_cos {int cos_id[DLB2_MAX_NUM_PORTS_ALL ]; };
@@ -667,7 +679,6 @@ struct dlb2_devargs {bool vector_opts_enabled;int max_cq_depth;int max_enq_depth; -struct dlb2_cq_weight cq_weight;struct dlb2_port_cos port_cos;struct dlb2_cos_bw cos_bw;const char *producer_coremask;
drivers/event/dlb2/rte_pmd_dlb2.h +10 -0
@@ -19,6 +19,16 @@ extern "C" {#include <rte_compat.h> +/** +* Macros to get/set QID depth and QE weight from rte_event metadata. +* Currently 'rsvd' field is used for these. Lower 2 bits are used to store +* QID depth while the upper 2 bits are used for QER weight. +*/ +#define RTE_PMD_DLB2_GET_QID_DEPTH (x) ((x)->rsvd & 0x3) +#define RTE_PMD_DLB2_SET_QID_DEPTH (x, v) ((x)->rsvd = ((x)->rsvd & ~0x3) | (v & 0x3)) +#define RTE_PMD_DLB2_GET_QE_WEIGHT (x) (((x)->rsvd >> 2) & 0x3) +#define RTE_PMD_DLB2_SET_QE_WEIGHT (x, v) ((x)->rsvd = ((x)->rsvd & 0x3) | ((v & 0x3) << 2)) +/** * @warning * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
Signature · 1 line
2.25.1
PATCH v11 3/3 event/dsw: add capability for independent enqueue
In reply to Abdullah SevincerTo use independent enqueue capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists. Hence, this commit adds the capability of independent enqueue to the DSW driver.
--- doc/guides/rel_notes/release_24_11.rst | 4 ++++ drivers/event/dsw/dsw_evdev.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-)
doc/guides/rel_notes/release_24_11.rst +4 -0
@@ -66,6 +66,10 @@ New Features ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. +* **Updated DSW Driver for independent enqueue feature** + + * Added capability flag for DSW to advertise independent enqueue feature. + Removed Items -------------
drivers/event/dsw/dsw_evdev.c +2 -1
@@ -230,7 +230,8 @@ dsw_info_get(struct rte_eventdev *dev __rte_unused,RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE |RTE_EVENT_DEV_CAP_NONSEQ_MODE |RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT | - RTE_EVENT_DEV_CAP_CARRY_FLOW_ID +RTE_EVENT_DEV_CAP_CARRY_FLOW_ID | + RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ }; }
Signature · 1 line
2.25.1
v12 cover Independent Enqueue Support
In reply to Abdullah Sevincerv12: Address comments.
v11: Address comments.
v10: Add acked-by reviewer name.
v9: Address comments.
v8: Address build issues.
v7: Address documentation reviews.
v6: Update patch with more documentation.
v5: Address build issues.
v4: Address comments.
v3: Fix CI/build issues.
v2: Fix CI/build issues.
v1: Initial patchset.
Abdullah Sevincer (3):
eventdev: add support for independent enqueue event/dlb2: add support for independent enqueue event/dsw: add capability for independent enqueue
doc/guides/eventdevs/dlb2.rst | 41 ++ doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_11.rst | 15 + drivers/event/dlb2/dlb2.c | 492 ++++++++++++++-------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 10 + drivers/event/dsw/dsw_evdev.c | 3 +- lib/eventdev/rte_eventdev.h | 37 ++ 11 files changed, 469 insertions(+), 191 deletions(-)
Signature · 1 line
2.25.1
PATCH v12 1/3 eventdev: add support for independent enqueue
This commit adds support for independent enqueue feature and updates Event Device and PMD feature list.
A new capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ is introduced. It allows out-of-order enqueuing of RTE_EVENT_OP_FORWARD or RELEASE type events on an event port where this capability is enabled.
To use this capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists.
--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_11.rst | 5 +++ lib/eventdev/rte_eventdev.h | 37 +++++++++++++++++++++++ 4 files changed, 44 insertions(+)
doc/guides/eventdevs/features/default.ini +1 -0
@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.
doc/guides/eventdevs/features/dlb2.ini +1 -0
@@ -15,6 +15,7 @@ implicit_release_disable = Y runtime_port_link = Y multiple_queue_port = Y maintenance_free = Y +independent_enq = Y [Eth Rx adapter Features]
doc/guides/rel_notes/release_24_11.rst +5 -0
@@ -55,6 +55,11 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* **Updated Event Device Library for independent enqueue feature** + + * Added support for independent enqueue feature. Updated Event Device and + PMD feature list. + Removed Items -------------
lib/eventdev/rte_eventdev.h +37 -0
@@ -446,6 +446,31 @@ struct rte_event;* @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ (1ULL << 16) +/**< Event device is capable of independent enqueue. +* A new capability, RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, will indicate that Eventdev +* supports the enqueue in any order or specifically in a different order than the +* dequeue. Eventdev PMD can either transmit events in the changed order in which +* they are enqueued or restore the original order before sending them to the +* underlying hardware device. A flag is provided during the port configuration to +* inform Eventdev PMD that the application intends to use an independent enqueue +* order on a particular port. Note that this capability only matters for Eventdevs +* supporting burst mode. +* +* To Inform PMD that the application plans to use independent enqueue order on a port +* this code example can be used: +* +* if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) +* port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; +* +* When an implicit release is enabled on a port, Eventdev PMD will also handle +* the insertion of RELEASE events in place of dropped events. The independent enqueue +* feature only applies to FORWARD and RELEASE events. New events (op=RTE_EVENT_OP_NEW) +* will be transmitted in the order the application enqueues them and do not maintain +* any order relative to FORWARD/RELEASE events. FORWARD vs NEW relaxed ordering +* only applies to ports that have enabled independent enqueue feature. +*/ +/* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0/**< Highest priority level for events and queues.
@@ -1072,6 +1097,18 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* * @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) +/**< Flag to enable independent enqueue. Must not be set if the device +* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature +* allows an application to enqueue RTE_EVENT_OP_FORWARD or +* RTE_EVENT_OP_RELEASE in an order different than the order the +* events were dequeued from the event device, while maintaining +* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. +* +* Note that this flag only matters for Eventdevs supporting burst mode. +* +* @see rte_event_port_setup() +*/ /** Event port configuration structure */ struct rte_event_port_conf {
Signature · 1 line
2.25.1
PATCH v12 2/3 event/dlb2: add support for independent enqueue
In reply to Abdullah SevincerDLB devices need events to be enqueued in the same order they are dequeued. Applications are not suppose to change event order between dequeue and to enqueue. Since Eventdev standard does not add such restrictions independent enqueue support is needed for DLB PMD so that it restores dequeue order on enqueue if applications happen to change it. It also adds missing releases in places where events are dropped by the application and it expects implicit release to handle it.
By default the feature will be off on all DLB ports and they will behave the same as older releases. To enable reordering feature, applications need to add the flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ to port configuration if only the device advertises the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ.
--- doc/guides/eventdevs/dlb2.rst | 41 +++ doc/guides/rel_notes/release_24_11.rst | 6 + drivers/event/dlb2/dlb2.c | 492 ++++++++++++++++--------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 10 + 7 files changed, 419 insertions(+), 190 deletions(-)
doc/guides/eventdevs/dlb2.rst +41 -0
@@ -456,6 +456,47 @@ Example command to enable QE Weight feature: --allow ea:00.0,enable_cq_weight=<y/Y> +Independent Enqueue Capability +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +DLB2 hardware device expects all forwarded events to be enqueued in the same +order as they are dequeued. For dropped events, their releases should come at +the same location as the original event was expected. Hardware has this +restriction as it uses the order to retrieve information about the original +event that was sent to the CPU. This contains information like atomic flow +ID to release the flow lock and ordered events sequence number to restore the +original order. + +Some applications, like those based on the DPDK dispatcher library, want +enqueue order independence. To support this, DLB2 PMD supports the +``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` capability. + +This capability applies to Eventdevs supporting burst mode. On ports where +the application is going to change enqueue order, +``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` support should be enabled. + +Example code to inform PMD that the application plans to use independent enqueue +order on a port: + + .. code-block:: c + + if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) + port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; + +This code example enables enqueue event reordering inside DLB2 PMD before the events +are sent to the DLB2 hardware. If the application is not going to change the enqueue +order, this flag should not be enabled to get better performance. DLB2 PMD saves +ordering information inside the impl_opaque field of the event, and this field should +be preserved for all FORWARD or RELEASE events. Following MACROs are provided to get +and set this field inside the event in case the same event is not used for forwarding +(e.g., a new RELEASE event is created when the original event is dropped instead of +reusing the same event). + + .. code-block:: c + + #define RTE_EVENT_GET_IMPL_OPAQUE(ev) (ev->impl_opaque) + #define RTE_EVENT_SET_IMPL_OPAQUE(ev, val) (ev->impl_opaque = val) + Running Eventdev Applications with DLB Device ---------------------------------------------
doc/guides/rel_notes/release_24_11.rst +6 -0
@@ -60,6 +60,12 @@ New Features * Added support for independent enqueue feature. Updated Event Device and PMD feature list. +* **Updated DLB2 Driver for independent enqueue feature** + + Added support for DLB independent enqueue feature. Applications should use + ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability + ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. + Removed Items -------------
drivers/event/dlb2/dlb2.c +322 -170
691 lines not on this page · raw message
drivers/event/dlb2/dlb2_avx512.c +14 -13
@@ -151,20 +151,20 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port,*/ #define DLB2_QE_EV_TYPE_WORD 0 sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[0 ].sub_event_type <<8 | - ev[0 ].event_type, + ev[0 ].sub_event_type <<4 | + ev[0 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[1 ].sub_event_type <<8 | - ev[1 ].event_type, + ev[1 ].sub_event_type <<4 | + ev[1 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[2 ].sub_event_type <<8 | - ev[2 ].event_type, + ev[2 ].sub_event_type <<4 | + ev[2 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[3 ].sub_event_type <<8 | - ev[3 ].event_type, + ev[3 ].sub_event_type <<4 | + ev[3 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 );if (qm_port->use_avx512) {
@@ -238,11 +238,11 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, }/* will only be set for DLB 2.5 + */ -if (qm_port->cq_weight) { - qe[0 ].weight = ev[0 ].impl_opaque &3 ; - qe[1 ].weight = ev[1 ].impl_opaque &3 ; - qe[2 ].weight = ev[2 ].impl_opaque &3 ; - qe[3 ].weight = ev[3 ].impl_opaque &3 ; +if (qm_port->dlb2->enable_cq_weight) { + qe[0 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[0 ]); + qe[1 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[1 ]); + qe[2 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[2 ]); + qe[3 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[3 ]); }break ;
@@ -267,6 +267,7 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, } qe[i].u.event_type.major = ev[i].event_type; qe[i].u.event_type.sub = ev[i].sub_event_type; + qe[i].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[i]); }break ;case 0 :
drivers/event/dlb2/dlb2_inline_fns.h +8 -0
@@ -32,4 +32,12 @@ dlb2_movdir64b(void *dest, void *src) : "a" (dest), "d" (src)); } +static inline void +dlb2_movdir64b_single (void *pp_addr,void *qe4) +{ + asmvolatile (".byte 0x66, 0x0f, 0x38, 0xf8, 0x02" + : + :"a" (pp_addr),"d" (qe4)); +} +#endif /* _DLB2_INLINE_FNS_H_ */
drivers/event/dlb2/dlb2_priv.h +18 -7
@@ -29,7 +29,8 @@#define DLB2_SW_CREDIT_C_QUANTA_DEFAULT 256/* Consumer */ #define DLB2_DEPTH_THRESH_DEFAULT 256#define DLB2_MIN_CQ_DEPTH_OVERRIDE 32 -#define DLB2_MAX_CQ_DEPTH_OVERRIDE 128 +#define DLB2_MAX_CQ_DEPTH_OVERRIDE 1024 +#define DLB2_MAX_CQ_DEPTH_REORDER 128#define DLB2_MIN_ENQ_DEPTH_OVERRIDE 32#define DLB2_MAX_ENQ_DEPTH_OVERRIDE 1024
@@ -387,8 +388,23 @@ struct dlb2_port {bool use_scalar;/* force usage of scalar code */ uint16_t hw_credit_quanta;bool use_avx512; -uint32_t cq_weight;bool is_producer;/* True if port is of type producer */ +uint8_t reorder_id;/* id used for reordering events coming back into the scheduler */ +bool reorder_en; +struct dlb2_reorder *order;/* For ordering enqueues */ +}; + +struct dlb2_reorder { +/* a reorder buffer for events coming back in different order from dequeue +* We use UINT8_MAX + 1 elements, but add on three no-ops to make movdirs easier at the end +*/ +union { +__m128i m128; +struct dlb2_enqueue_qe qe; +uint64_t u64[2 ]; + } enq_reorder[UINT8_MAX +4 ]; +/* id of the next entry in the reorder enqueue ring to send in */ +uint8_t next_to_enqueue; };/* Per-process per-port mmio and memory pointers */
@@ -642,10 +658,6 @@ struct dlb2_qid_depth_thresholds {int val[DLB2_MAX_NUM_QUEUES_ALL ]; }; -struct dlb2_cq_weight { -int limit[DLB2_MAX_NUM_PORTS_ALL ]; -}; -struct dlb2_port_cos {int cos_id[DLB2_MAX_NUM_PORTS_ALL ]; };
@@ -667,7 +679,6 @@ struct dlb2_devargs {bool vector_opts_enabled;int max_cq_depth;int max_enq_depth; -struct dlb2_cq_weight cq_weight;struct dlb2_port_cos port_cos;struct dlb2_cos_bw cos_bw;const char *producer_coremask;
drivers/event/dlb2/rte_pmd_dlb2.h +10 -0
@@ -19,6 +19,16 @@ extern "C" {#include <rte_compat.h> +/** +* Macros to get/set QID depth and QE weight from rte_event metadata. +* Currently 'rsvd' field is used for these. Lower 2 bits are used to store +* QID depth while the upper 2 bits are used for QER weight. +*/ +#define RTE_PMD_DLB2_GET_QID_DEPTH (x) ((x)->rsvd & 0x3) +#define RTE_PMD_DLB2_SET_QID_DEPTH (x, v) ((x)->rsvd = ((x)->rsvd & ~0x3) | (v & 0x3)) +#define RTE_PMD_DLB2_GET_QE_WEIGHT (x) (((x)->rsvd >> 2) & 0x3) +#define RTE_PMD_DLB2_SET_QE_WEIGHT (x, v) ((x)->rsvd = ((x)->rsvd & 0x3) | ((v & 0x3) << 2)) +/** * @warning * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
Signature · 1 line
2.25.1
RE: [EXTERNAL] [PATCH v12 2/3] event/dlb2: add support for independent enqueue
Quoted 65 lines
-----Original Message-----
From: Abdullah Sevincer <[email protected]>
Sent: Monday, September 9, 2024 9:35 PM
To: [email protected]
Cc: Jerin Jacob <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; Abdullah Sevincer <[email protected]>
Subject: [EXTERNAL] [PATCH v12 2/3] event/dlb2: add support for independent enqueueDLB devices need events to be enqueued in the same order they are dequeued. Applications are not suppose to change event order between dequeue and to enqueue. Since Eventdev standard does not add such restrictions independent enqueue support
DLB devices need events to be enqueued in the same order they are dequeued. Applications are not suppose to change event order between dequeue and to enqueue. Since Eventdev standard does not add such restrictions independent enqueue support is needed for DLB PMD so that it restores dequeue order on enqueue if applications happen to change it. It also adds missing releases in places where events are dropped by the application and it expects implicit release to handle it.By default the feature will be off on all DLB ports and they will behave the same as older releases. To enable reordering feature, applications need to add the flag
RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ
to port configuration if only the device advertises the capabilityRTE_EVENT_DEV_CAP_INDEPENDENT_ENQ.Signed-off-by Abdullah Sevincer <[email protected]>Acked-by Mattias Rönnblom <[email protected]>--- doc/guides/eventdevs/dlb2.rst | 41 +++ doc/guides/rel_notes/release_24_11.rst | 6 + drivers/event/dlb2/dlb2.c | 492 ++++++++++++++++--------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 10 + 7 files changed, 419 insertions(+), 190 deletions(-)doc/guides/eventdevs/dlb2.rst +17
-0@@ -456,6 +456,47 @@ Example command to enable QE Weight feature: --allow ea:00.0,enable_cq_weight=<y/Y> +Independent Enqueue Capability +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +DLB2 hardware device expects all forwarded events to be enqueued in the +same order as they are dequeued. For dropped events, their releases +should come at the same location as the original event was expected. +Hardware has this restriction as it uses the order to retrieve +information about the original event that was sent to the CPU. This +contains information like atomic flow ID to release the flow lock and +ordered events sequence number to restore the original order. + +Some applications, like those based on the DPDK dispatcher library, +want enqueue order independence. To support this, DLB2 PMD supports the +``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` capability. + +This capability applies to Eventdevs supporting burst mode. On ports +where the application is going to change enqueue order,
doc/guides/eventdevs/dlb2.rst Example command to enable QE Weight feature: · line 485
Quoted 10 lines
doc/guides/eventdevs/dlb2.rst +10
-0+``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` support should be enabled. + +Example code to inform PMD that the application plans to use +independent enqueue order on a port: + + .. code-block:: c + + if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) + port_config = port_config | + RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ;
A lot of thing in this is generic, update and move that to doc/guides/prog_guide/eventdev/eventdev.rst And add DLB2 specific items here.
Quoted 10 lines
doc/guides/eventdevs/dlb2.rst +9
-0+ +This code example enables enqueue event reordering inside DLB2 PMD +before the events are sent to the DLB2 hardware. If the application is +not going to change the enqueue order, this flag should not be enabled +to get better performance. DLB2 PMD saves ordering information inside +the impl_opaque field of the event, and this field should be preserved +for all FORWARD or RELEASE events. Following MACROs are provided to get +and set this field inside the event in case the same event is not used +for forwarding (e.g., a new RELEASE event is created when the original event isdropped instead of reusing the same event).
doc/guides/eventdevs/dlb2.rst Example command to enable QE Weight feature:
Quoted 6 lines
doc/guides/eventdevs/dlb2.rst +6
-0+ + .. code-block:: c + + #define RTE_EVENT_GET_IMPL_OPAQUE(ev) (ev->impl_opaque) + #define RTE_EVENT_SET_IMPL_OPAQUE(ev, val) (ev->impl_opaque = + val)
Don’t add public RTE_EVENT_ symbol as example macro, use some other prefix like DLB2.
Quoted 10 lines
doc/guides/eventdevs/dlb2.rst +1
-0+ Running Eventdev Applications with DLB Device ---------------------------------------------doc/guides/rel_notes/release_24_11.rst +0
-0
doc/guides/rel_notes/release_24_11.rst New Features · line 63
Quoted 4 lines
doc/guides/rel_notes/release_24_11.rst +1
-0@@ -60,6 +60,12 @@ New Features * Added support for independent enqueue feature. Updated Event Device and PMD feature list. +* **Updated DLB2 Driver for independent enqueue feature**
Driver->driver
doc/guides/rel_notes/release_24_11.rst New Features · line 67
Quoted 4 lines
doc/guides/rel_notes/release_24_11.rst +4
-0+ + Added support for DLB independent enqueue feature. Applications + should use ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the + feature if the capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists.
Next patch add one more item to release notes. Instead, IMO, it better to update the generic section. for this PMD support. I.e. add one item under
"*Updated eventdev to support independent enqueue feature" section. As add DLB2 support.
Quoted 4 lines
doc/guides/rel_notes/release_24_11.rst +1
-0#include <rte_compat.h> +/**
doc/guides/rel_notes/release_24_11.rst New Features
Quoted 10 lines
doc/guides/rel_notes/release_24_11.rst +10
-0+ * Macros to get/set QID depth and QE weight from rte_event metadata. + * Currently 'rsvd' field is used for these. Lower 2 bits are used to +store + * QID depth while the upper 2 bits are used for QER weight. + */ +#define RTE_PMD_DLB2_GET_QID_DEPTH(x) ((x)->rsvd & 0x3) #define +RTE_PMD_DLB2_SET_QID_DEPTH(x, v) ((x)->rsvd = ((x)->rsvd & ~0x3) | (v & +0x3)) #define RTE_PMD_DLB2_GET_QE_WEIGHT(x) (((x)->rsvd >> 2) & 0x3) +#define RTE_PMD_DLB2_SET_QE_WEIGHT(x, v) ((x)->rsvd = ((x)->rsvd & 0x3) +| ((v & 0x3) << 2))
All of the above MACROs are public symbols, Add Doxygen comment for each of them.
Quoted 7 lines
+
/**
* @warning
* @b EXPERIMENTAL: this API may change, or be removed, without prior
notice
--
2.25.1
v13 cover Independent Enqueue Support
In reply to Abdullah Sevincerv13: Address comments.
v12: Address comments.
v11: Address comments.
v10: Add acked-by reviewer name.
v9: Address comments.
v8: Address build issues.
v7: Address documentation reviews.
v6: Update patch with more documentation.
v5: Address build issues.
v4: Address comments.
v3: Fix CI/build issues.
v2: Fix CI/build issues.
v1: Initial patchset.
Abdullah Sevincer (3):
eventdev: add support for independent enqueue event/dlb2: add support for independent enqueue event/dsw: add capability for independent enqueue
doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/prog_guide/eventdev/eventdev.rst | 33 ++ doc/guides/rel_notes/release_24_11.rst | 11 + drivers/event/dlb2/dlb2.c | 490 +++++++++++++------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 24 + drivers/event/dsw/dsw_evdev.c | 3 +- lib/eventdev/rte_eventdev.h | 37 ++ 11 files changed, 469 insertions(+), 191 deletions(-)
Signature · 1 line
2.25.1
PATCH v13 1/3 eventdev: add support for independent enqueue
This commit adds support for independent enqueue feature and updates Event Device and PMD feature list.
A new capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ is introduced. It allows out-of-order enqueuing of RTE_EVENT_OP_FORWARD or RELEASE type events on an event port where this capability is enabled.
To use this capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists.
--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_11.rst | 5 +++ lib/eventdev/rte_eventdev.h | 37 +++++++++++++++++++++++ 4 files changed, 44 insertions(+)
doc/guides/eventdevs/features/default.ini +1 -0
@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.
doc/guides/eventdevs/features/dlb2.ini +1 -0
@@ -15,6 +15,7 @@ implicit_release_disable = Y runtime_port_link = Y multiple_queue_port = Y maintenance_free = Y +independent_enq = Y [Eth Rx adapter Features]
doc/guides/rel_notes/release_24_11.rst +5 -0
@@ -67,6 +67,11 @@ New Features The new statistics are useful for debugging and profiling. +* **Updated Event Device Library for independent enqueue feature** + + * Added support for independent enqueue feature. Updated Event Device and + PMD feature list. + Removed Items -------------
lib/eventdev/rte_eventdev.h +37 -0
@@ -446,6 +446,31 @@ struct rte_event;* @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ (1ULL << 16) +/**< Event device is capable of independent enqueue. +* A new capability, RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, will indicate that Eventdev +* supports the enqueue in any order or specifically in a different order than the +* dequeue. Eventdev PMD can either transmit events in the changed order in which +* they are enqueued or restore the original order before sending them to the +* underlying hardware device. A flag is provided during the port configuration to +* inform Eventdev PMD that the application intends to use an independent enqueue +* order on a particular port. Note that this capability only matters for Eventdevs +* supporting burst mode. +* +* To Inform PMD that the application plans to use independent enqueue order on a port +* this code example can be used: +* +* if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) +* port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; +* +* When an implicit release is enabled on a port, Eventdev PMD will also handle +* the insertion of RELEASE events in place of dropped events. The independent enqueue +* feature only applies to FORWARD and RELEASE events. New events (op=RTE_EVENT_OP_NEW) +* will be transmitted in the order the application enqueues them and do not maintain +* any order relative to FORWARD/RELEASE events. FORWARD vs NEW relaxed ordering +* only applies to ports that have enabled independent enqueue feature. +*/ +/* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0/**< Highest priority level for events and queues.
@@ -1072,6 +1097,18 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* * @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) +/**< Flag to enable independent enqueue. Must not be set if the device +* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature +* allows an application to enqueue RTE_EVENT_OP_FORWARD or +* RTE_EVENT_OP_RELEASE in an order different than the order the +* events were dequeued from the event device, while maintaining +* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. +* +* Note that this flag only matters for Eventdevs supporting burst mode. +* +* @see rte_event_port_setup() +*/ /** Event port configuration structure */ struct rte_event_port_conf {
Signature · 1 line
2.25.1
PATCH v13 2/3 event/dlb2: add support for independent enqueue
In reply to Abdullah SevincerDLB devices need events to be enqueued in the same order they are dequeued. Applications are not suppose to change event order between dequeue and to enqueue. Since Eventdev standard does not add such restrictions independent enqueue support is needed for DLB PMD so that it restores dequeue order on enqueue if applications happen to change it. It also adds missing releases in places where events are dropped by the application and it expects implicit release to handle it.
By default the feature will be off on all DLB ports and they will behave the same as older releases. To enable reordering feature, applications need to add the flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ to port configuration if only the device advertises the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ.
--- doc/guides/prog_guide/eventdev/eventdev.rst | 33 ++ doc/guides/rel_notes/release_24_11.rst | 5 + drivers/event/dlb2/dlb2.c | 490 +++++++++++++------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 24 + 7 files changed, 422 insertions(+), 190 deletions(-)
doc/guides/prog_guide/eventdev/eventdev.rst +33 -0
@@ -472,6 +472,39 @@ A flush callback can be passed to the function to handle any outstanding events. Invocation of this API does not affect the existing port configuration. +Independent Enqueue Capability +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Some eventdev hardware devices such as DLB2 expects all forwarded events to be +enqueued in the same order as they are dequeued. For dropped events, their +releases should come at the same location as the original event was expected. +Hardware has this restriction as it uses the order to retrieve information about +the original event that was sent to the CPU. This contains information like atomic flow +ID to release the flow lock and ordered events sequence number to restore the +original order. + +Some applications, like those based on the DPDK dispatcher library, want +enqueue order independence. To support this, DLB2 PMD supports the +``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` capability. + +This capability applies to Eventdevs supporting burst mode. On ports where +the application is going to change enqueue order, +``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` support should be enabled. + +Example code to inform PMD that the application plans to use independent enqueue +order on a port: + + .. code-block:: c + + if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) + port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; + +This code example enables enqueue event reordering inside DLB2 PMD before the events +are sent to the DLB2 hardware. If the application is not going to change the enqueue +order, this flag should not be enabled to get better performance. DLB2 PMD saves +ordering information inside the impl_opaque field of the event, and this field should +be preserved for all FORWARD or RELEASE events. + Stopping the EventDev ~~~~~~~~~~~~~~~~~~~~~
doc/guides/rel_notes/release_24_11.rst +5 -0
@@ -72,6 +72,11 @@ New Features * Added support for independent enqueue feature. Updated Event Device and PMD feature list. + * Updated DLB2 driver for independent enqueue feature. Applications should + use ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the + capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. + + Removed Items -------------
drivers/event/dlb2/dlb2.c +320 -170
681 lines not on this page · raw message
drivers/event/dlb2/dlb2_avx512.c +14 -13
@@ -151,20 +151,20 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port,*/ #define DLB2_QE_EV_TYPE_WORD 0 sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[0 ].sub_event_type <<8 | - ev[0 ].event_type, + ev[0 ].sub_event_type <<4 | + ev[0 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[1 ].sub_event_type <<8 | - ev[1 ].event_type, + ev[1 ].sub_event_type <<4 | + ev[1 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[2 ].sub_event_type <<8 | - ev[2 ].event_type, + ev[2 ].sub_event_type <<4 | + ev[2 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[3 ].sub_event_type <<8 | - ev[3 ].event_type, + ev[3 ].sub_event_type <<4 | + ev[3 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 );if (qm_port->use_avx512) {
@@ -238,11 +238,11 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, }/* will only be set for DLB 2.5 + */ -if (qm_port->cq_weight) { - qe[0 ].weight = ev[0 ].impl_opaque &3 ; - qe[1 ].weight = ev[1 ].impl_opaque &3 ; - qe[2 ].weight = ev[2 ].impl_opaque &3 ; - qe[3 ].weight = ev[3 ].impl_opaque &3 ; +if (qm_port->dlb2->enable_cq_weight) { + qe[0 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[0 ]); + qe[1 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[1 ]); + qe[2 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[2 ]); + qe[3 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[3 ]); }break ;
@@ -267,6 +267,7 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, } qe[i].u.event_type.major = ev[i].event_type; qe[i].u.event_type.sub = ev[i].sub_event_type; + qe[i].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[i]); }break ;case 0 :
drivers/event/dlb2/dlb2_inline_fns.h +8 -0
@@ -32,4 +32,12 @@ dlb2_movdir64b(void *dest, void *src) : "a" (dest), "d" (src)); } +static inline void +dlb2_movdir64b_single (void *pp_addr,void *qe4) +{ + asmvolatile (".byte 0x66, 0x0f, 0x38, 0xf8, 0x02" + : + :"a" (pp_addr),"d" (qe4)); +} +#endif /* _DLB2_INLINE_FNS_H_ */
drivers/event/dlb2/dlb2_priv.h +18 -7
@@ -29,7 +29,8 @@#define DLB2_SW_CREDIT_C_QUANTA_DEFAULT 256/* Consumer */ #define DLB2_DEPTH_THRESH_DEFAULT 256#define DLB2_MIN_CQ_DEPTH_OVERRIDE 32 -#define DLB2_MAX_CQ_DEPTH_OVERRIDE 128 +#define DLB2_MAX_CQ_DEPTH_OVERRIDE 1024 +#define DLB2_MAX_CQ_DEPTH_REORDER 128#define DLB2_MIN_ENQ_DEPTH_OVERRIDE 32#define DLB2_MAX_ENQ_DEPTH_OVERRIDE 1024
@@ -387,8 +388,23 @@ struct dlb2_port {bool use_scalar;/* force usage of scalar code */ uint16_t hw_credit_quanta;bool use_avx512; -uint32_t cq_weight;bool is_producer;/* True if port is of type producer */ +uint8_t reorder_id;/* id used for reordering events coming back into the scheduler */ +bool reorder_en; +struct dlb2_reorder *order;/* For ordering enqueues */ +}; + +struct dlb2_reorder { +/* a reorder buffer for events coming back in different order from dequeue +* We use UINT8_MAX + 1 elements, but add on three no-ops to make movdirs easier at the end +*/ +union { +__m128i m128; +struct dlb2_enqueue_qe qe; +uint64_t u64[2 ]; + } enq_reorder[UINT8_MAX +4 ]; +/* id of the next entry in the reorder enqueue ring to send in */ +uint8_t next_to_enqueue; };/* Per-process per-port mmio and memory pointers */
@@ -642,10 +658,6 @@ struct dlb2_qid_depth_thresholds {int val[DLB2_MAX_NUM_QUEUES_ALL ]; }; -struct dlb2_cq_weight { -int limit[DLB2_MAX_NUM_PORTS_ALL ]; -}; -struct dlb2_port_cos {int cos_id[DLB2_MAX_NUM_PORTS_ALL ]; };
@@ -667,7 +679,6 @@ struct dlb2_devargs {bool vector_opts_enabled;int max_cq_depth;int max_enq_depth; -struct dlb2_cq_weight cq_weight;struct dlb2_port_cos port_cos;struct dlb2_cos_bw cos_bw;const char *producer_coremask;
drivers/event/dlb2/rte_pmd_dlb2.h +24 -0
@@ -19,6 +19,30 @@ extern "C" {#include <rte_compat.h> +/** +* Macro function to get QID depth of rte_event metadata. +* Currently lower 2 bits of 'rsvd' field are used to store QID depth. +*/ +#define RTE_PMD_DLB2_GET_QID_DEPTH (x) ((x)->rsvd & 0x3) + +/** +* Macro function to set QID depth of rte_event metadata. +* Currently lower 2 bits of 'rsvd' field are used to store QID depth. +*/ +#define RTE_PMD_DLB2_SET_QID_DEPTH (x, v) ((x)->rsvd = ((x)->rsvd & ~0x3) | (v & 0x3)) + +/** +* Macro function to get QE weight from rte_event metadata. +* Currently upper 2 bits of 'rsvd' field are used to store QE weight. +*/ +#define RTE_PMD_DLB2_GET_QE_WEIGHT (x) (((x)->rsvd >> 2) & 0x3) + +/** +* Macro function to set QE weight from rte_event metadata. +* Currently upper 2 bits of 'rsvd' field are used to store QE weight. +*/ +#define RTE_PMD_DLB2_SET_QE_WEIGHT (x, v) ((x)->rsvd = ((x)->rsvd & 0x3) | ((v & 0x3) << 2)) +/** * @warning * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
Signature · 1 line
2.25.1
Re: [PATCH v13 2/3] event/dlb2: add support for independent enqueue
Quoted 31 lines · Abdullah Sevincer
DLB devices need events to be enqueued in the same order they are dequeued. Applications are not suppose to change event order between dequeue and to enqueue. Since Eventdev standard does not add such restrictions independent enqueue support is needed for DLB PMD so that it restores dequeue order on enqueue if applications happen to change it. It also adds missing releases in places where events are dropped by the application and it expects implicit release to handle it.
By default the feature will be off on all DLB ports and they will behave the same as older releases. To enable reordering feature, applications need to add the flag
RTE_EVENT_PORT_CFG_INDEPENDENT_ENQto port configuration if only the device advertises the capabilityRTE_EVENT_DEV_CAP_INDEPENDENT_ENQ.Signed-off-by Abdullah Sevincer <[email protected]>Acked-by Mattias Rönnblom <[email protected]>--- doc/guides/prog_guide/eventdev/eventdev.rst | 33 ++ doc/guides/rel_notes/release_24_11.rst | 5 + drivers/event/dlb2/dlb2.c | 490 +++++++++++++------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 24 + 7 files changed, 422 insertions(+), 190 deletions(-)doc/guides/prog_guide/eventdev/eventdev.rst +0
-0
doc/guides/prog_guide/eventdev/eventdev.rst A flush callback can be passed to the function to handle any outstanding events. · line 478
Quoted 4 lines
doc/guides/prog_guide/eventdev/eventdev.rst +4
-0+Independent Enqueue Capability +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Some eventdev hardware devices such as DLB2 expects all forwarded events to be
Remove DLB2 from _generic+ documentation. Instead, express with capability.
doc/guides/prog_guide/eventdev/eventdev.rst A flush callback can be passed to the function to handle any outstanding events. · line 487
Quoted 9 lines
doc/guides/prog_guide/eventdev/eventdev.rst +9
-0+enqueued in the same order as they are dequeued. For dropped events, their +releases should come at the same location as the original event was expected. +Hardware has this restriction as it uses the order to retrieve information about +the original event that was sent to the CPU. This contains information like atomic flow +ID to release the flow lock and ordered events sequence number to restore the +original order. + +Some applications, like those based on the DPDK dispatcher library, want +enqueue order independence. To support this, DLB2 PMD supports the
Remove DLB2 from generic documentation.
Quoted 4 lines
+``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` capability.
doc/guides/prog_guide/eventdev/eventdev.rst +3
-0+ +This capability applies to Eventdevs supporting burst mode. On ports where +the application is going to change enqueue order,
doc/guides/prog_guide/eventdev/eventdev.rst A flush callback can be passed to the function to handle any outstanding events. · line 501
Quoted 10 lines
doc/guides/prog_guide/eventdev/eventdev.rst +10
-0+``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` support should be enabled. + +Example code to inform PMD that the application plans to use independent enqueue +order on a port: + + .. code-block:: c + + if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) + port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; +
--------------------
AS MENTIONED IN THE LAST comment, Please move this section to 1/3 patch.
doc/guides/prog_guide/eventdev/eventdev.rst A flush callback can be passed to the function to handle any outstanding events. · line 506
Quoted 5 lines
doc/guides/prog_guide/eventdev/eventdev.rst +5
-0+This code example enables enqueue event reordering inside DLB2 PMD before the events +are sent to the DLB2 hardware. If the application is not going to change the enqueue +order, this flag should not be enabled to get better performance. DLB2 PMD saves +ordering information inside the impl_opaque field of the event, and this field should +be preserved for all FORWARD or RELEASE events.
This section is a candidate for DLB2 specific documentation. DONT ADD IN doc/guides/prog_guide/eventdev/eventdev.rst instead move any DLB2 specific documentation
DLB2 specific document if needed.
Quoted 9 lines
doc/guides/prog_guide/eventdev/eventdev.rst +1
-0+ Stopping the EventDev ~~~~~~~~~~~~~~~~~~~~~doc/guides/rel_notes/release_24_11.rst +0
-0
doc/guides/rel_notes/release_24_11.rst New Features · line 77
Quoted 6 lines
doc/guides/rel_notes/release_24_11.rst +3
-0@@ -72,6 +72,11 @@ New Features * Added support for independent enqueue feature. Updated Event Device and PMD feature list. + * Updated DLB2 driver for independent enqueue feature. Applications should + use ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the + capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists.
Starting from “Applications ...” is not specific to DLB2, remove from release notes.
Please send the next version on Monday, planning to submit rc1 PR on Tuesday.
PATCH v13 3/3 event/dsw: add capability for independent enqueue
In reply to Abdullah SevincerTo use independent enqueue capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists. Hence, this commit adds the capability of independent enqueue to the DSW driver.
--- doc/guides/rel_notes/release_24_11.rst | 1 + drivers/event/dsw/dsw_evdev.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
doc/guides/rel_notes/release_24_11.rst +1 -0
@@ -76,6 +76,7 @@ New Features use ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. + * Updated DSW driver for independent enqueue feature. Removed Items
drivers/event/dsw/dsw_evdev.c +2 -1
@@ -230,7 +230,8 @@ dsw_info_get(struct rte_eventdev *dev __rte_unused,RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE |RTE_EVENT_DEV_CAP_NONSEQ_MODE |RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT | - RTE_EVENT_DEV_CAP_CARRY_FLOW_ID +RTE_EVENT_DEV_CAP_CARRY_FLOW_ID | + RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ }; }
Signature · 1 line
2.25.1
v14 cover Independent Enqueue Support
In reply to Abdullah Sevincerv14: Address comments.
v13: Address comments.
v12: Address comments.
v11: Address comments.
v10: Add acked-by reviewer name.
v9: Address comments.
v8: Address build issues.
v7: Address documentation reviews.
v6: Update patch with more documentation.
v5: Address build issues.
v4: Address comments.
v3: Fix CI/build issues.
v2: Fix CI/build issues.
v1: Initial patchset.
Abdullah Sevincer (3):
eventdev: add support for independent enqueue event/dlb2: add support for independent enqueue event/dsw: add capability for independent enqueue
doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/prog_guide/eventdev/eventdev.rst | 33 ++ doc/guides/rel_notes/release_24_11.rst | 11 + drivers/event/dlb2/dlb2.c | 490 +++++++++++++------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 24 + drivers/event/dsw/dsw_evdev.c | 3 +- lib/eventdev/rte_eventdev.h | 37 ++ 11 files changed, 469 insertions(+), 191 deletions(-)
Signature · 1 line
2.25.1
PATCH v14 1/3 eventdev: add support for independent enqueue
This commit adds support for independent enqueue feature and updates Event Device and PMD feature list.
A new capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ is introduced. It allows out-of-order enqueuing of RTE_EVENT_OP_FORWARD or RELEASE type events on an event port where this capability is enabled.
To use this capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists.
--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_11.rst | 5 +++ lib/eventdev/rte_eventdev.h | 37 +++++++++++++++++++++++ 4 files changed, 44 insertions(+)
doc/guides/eventdevs/features/default.ini +1 -0
@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.
doc/guides/eventdevs/features/dlb2.ini +1 -0
@@ -15,6 +15,7 @@ implicit_release_disable = Y runtime_port_link = Y multiple_queue_port = Y maintenance_free = Y +independent_enq = Y [Eth Rx adapter Features]
doc/guides/rel_notes/release_24_11.rst +5 -0
@@ -67,6 +67,11 @@ New Features The new statistics are useful for debugging and profiling. +* **Updated Event Device Library for independent enqueue feature** + + * Added support for independent enqueue feature. Updated Event Device and + PMD feature list. + Removed Items -------------
lib/eventdev/rte_eventdev.h +37 -0
@@ -446,6 +446,31 @@ struct rte_event;* @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ (1ULL << 16) +/**< Event device is capable of independent enqueue. +* A new capability, RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, will indicate that Eventdev +* supports the enqueue in any order or specifically in a different order than the +* dequeue. Eventdev PMD can either transmit events in the changed order in which +* they are enqueued or restore the original order before sending them to the +* underlying hardware device. A flag is provided during the port configuration to +* inform Eventdev PMD that the application intends to use an independent enqueue +* order on a particular port. Note that this capability only matters for Eventdevs +* supporting burst mode. +* +* To Inform PMD that the application plans to use independent enqueue order on a port +* this code example can be used: +* +* if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) +* port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; +* +* When an implicit release is enabled on a port, Eventdev PMD will also handle +* the insertion of RELEASE events in place of dropped events. The independent enqueue +* feature only applies to FORWARD and RELEASE events. New events (op=RTE_EVENT_OP_NEW) +* will be transmitted in the order the application enqueues them and do not maintain +* any order relative to FORWARD/RELEASE events. FORWARD vs NEW relaxed ordering +* only applies to ports that have enabled independent enqueue feature. +*/ +/* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0/**< Highest priority level for events and queues.
@@ -1072,6 +1097,18 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* * @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) +/**< Flag to enable independent enqueue. Must not be set if the device +* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature +* allows an application to enqueue RTE_EVENT_OP_FORWARD or +* RTE_EVENT_OP_RELEASE in an order different than the order the +* events were dequeued from the event device, while maintaining +* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. +* +* Note that this flag only matters for Eventdevs supporting burst mode. +* +* @see rte_event_port_setup() +*/ /** Event port configuration structure */ struct rte_event_port_conf {
Signature · 1 line
2.25.1
Re: [PATCH v14 1/3] eventdev: add support for independent enqueue
Quoted 2 lines · Abdullah Sevincer
This commit adds support for independent enqueue feature
Remove "This commit adds"
Quoted 48 lines
and updates Event Device and PMD feature list.
A new capability
RTE_EVENT_DEV_CAP_INDEPENDENT_ENQis introduced. It allows out-of-order enqueuing ofRTE_EVENT_OP_FORWARDor RELEASE type events on an event port where this capability is enabled.To use this capability applications need to set flag
RTE_EVENT_PORT_CFG_INDEPENDENT_ENQduring port setup only if the capabilityRTE_EVENT_DEV_CAP_INDEPENDENT_ENQexists.Signed-off-by Abdullah Sevincer <[email protected]>Acked-by Mattias Rönnblom <[email protected]>--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_11.rst | 5 +++ lib/eventdev/rte_eventdev.h | 37 +++++++++++++++++++++++ 4 files changed, 44 insertions(+)doc/guides/eventdevs/features/default.ini +1
-0@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.doc/guides/eventdevs/features/dlb2.ini +1
-0@@ -15,6 +15,7 @@ implicit_release_disable = Y runtime_port_link = Y multiple_queue_port = Y maintenance_free = Y +independent_enq = Y [Eth Rx adapter Features]doc/guides/rel_notes/release_24_11.rst +0
-0
doc/guides/rel_notes/release_24_11.rst New Features · line 73
Quoted 7 lines
doc/guides/rel_notes/release_24_11.rst +4
-0@@ -67,6 +67,11 @@ New Features The new statistics are useful for debugging and profiling. +* **Updated Event Device Library for independent enqueue feature** + + * Added support for independent enqueue feature. Updated Event Device and + PMD feature list.
No need to add "Updated Event Device and PMD feature list." Instead, very short summary of features
can be added here.
Quoted 13 lines
doc/guides/rel_notes/release_24_11.rst +1
-0+ Removed Items -------------lib/eventdev/rte_eventdev.h +1
-0@@ -446,6 +446,31 @@ struct rte_event;* @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ (1ULL << 16)
lib/eventdev/rte_eventdev.h struct rte_event; · line 459
Quoted 10 lines
lib/eventdev/rte_eventdev.h +10
-0+/**< Event device is capable of independent enqueue. +* A new capability, RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, will indicate that Eventdev +* supports the enqueue in any order or specifically in a different order than the +* dequeue. Eventdev PMD can either transmit events in the changed order in which +* they are enqueued or restore the original order before sending them to the +* underlying hardware device. A flag is provided during the port configuration to +* inform Eventdev PMD that the application intends to use an independent enqueue +* order on a particular port. Note that this capability only matters for Eventdevs +* supporting burst mode. +*
----------- see below---
lib/eventdev/rte_eventdev.h struct rte_event; · line 464
Quoted 5 lines
lib/eventdev/rte_eventdev.h +5
-0+* To Inform PMD that the application plans to use independent enqueue order on a port +* this code example can be used: +* +* if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) +* port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ;
--------------------------
Above section, please move to programming guide, no need to add code in Doxygen comments.
lib/eventdev/rte_eventdev.h struct rte_event; · line 469
Quoted 5 lines
lib/eventdev/rte_eventdev.h +5
-0+* +* When an implicit release is enabled on a port, Eventdev PMD will also handle +* the insertion of RELEASE events in place of dropped events. The independent enqueue +* feature only applies to FORWARD and RELEASE events. New events (op=RTE_EVENT_OP_NEW) +* will be transmitted in the order the application enqueues them and do not maintain
transmitted -> dequeded?
Quoted 29 lines
lib/eventdev/rte_eventdev.h +16
-1+* any order relative to FORWARD/RELEASE events. FORWARD vs NEW relaxed ordering +* only applies to ports that have enabled independent enqueue feature. +*/ +/* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0/**< Highest priority level for events and queues. @@ -1072,6 +1097,18 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* * @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) +/**< Flag to enable independent enqueue. Must not be set if the device +* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature +* allows an application to enqueue RTE_EVENT_OP_FORWARD or +* RTE_EVENT_OP_RELEASE in an order different than the order the +* events were dequeued from the event device, while maintaining +* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. +* +* Note that this flag only matters for Eventdevs supporting burst mode. +* +* @see rte_event_port_setup() +*/ /** Event port configuration structure */ struct rte_event_port_conf { --2.25.1
v15 cover Independent Enqueue Support
In reply to Abdullah Sevincerv15: Address comments.
v13: Address comments.
v13: Address comments.
v12: Address comments.
v11: Address comments.
v10: Add acked-by reviewer name.
v9: Address comments.
v8: Address build issues.
v7: Address documentation reviews.
v6: Update patch with more documentation.
v5: Address build issues.
v4: Address comments.
v3: Fix CI/build issues.
v2: Fix CI/build issues.
v1: Initial patchset.
Abdullah Sevincer (3):
eventdev: add support for independent enqueue event/dlb2: add support for independent enqueue event/dsw: add capability for independent enqueue
doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/prog_guide/eventdev/eventdev.rst | 33 ++ doc/guides/rel_notes/release_24_11.rst | 12 + drivers/event/dlb2/dlb2.c | 490 +++++++++++++------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 24 + drivers/event/dsw/dsw_evdev.c | 3 +- lib/eventdev/rte_eventdev.h | 31 ++ 11 files changed, 464 insertions(+), 191 deletions(-)
Signature · 1 line
2.25.1
PATCH v15 1/3 eventdev: add support for independent enqueue
Support for independent enqueue feature and updates Event Device and PMD feature list.
A new capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ is introduced. It allows out-of-order enqueuing of RTE_EVENT_OP_FORWARD or RELEASE type events on an event port where this capability is enabled.
To use this capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists.
--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_11.rst | 6 +++++ lib/eventdev/rte_eventdev.h | 31 +++++++++++++++++++++++ 4 files changed, 39 insertions(+)
doc/guides/eventdevs/features/default.ini +1 -0
@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.
doc/guides/eventdevs/features/dlb2.ini +1 -0
@@ -15,6 +15,7 @@ implicit_release_disable = Y runtime_port_link = Y multiple_queue_port = Y maintenance_free = Y +independent_enq = Y [Eth Rx adapter Features]
doc/guides/rel_notes/release_24_11.rst +6 -0
@@ -67,6 +67,12 @@ New Features The new statistics are useful for debugging and profiling. +* **Updated Event Device Library for independent enqueue feature** + + * Added support for independent enqueue feature. With this feature Eventdev + supports enqueue in any order or specifically in a different order than + dequeue. The feature is intended for eventdevs supporting burst mode. + Removed Items -------------
lib/eventdev/rte_eventdev.h +31 -0
@@ -446,6 +446,25 @@ struct rte_event;* @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ (1ULL << 16) +/**< Event device is capable of independent enqueue. +* A new capability, RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, will indicate that Eventdev +* supports the enqueue in any order or specifically in a different order than the +* dequeue. Eventdev PMD can either dequeue events in the changed order in which +* they are enqueued or restore the original order before sending them to the +* underlying hardware device. A flag is provided during the port configuration to +* inform Eventdev PMD that the application intends to use an independent enqueue +* order on a particular port. Note that this capability only matters for eventdevs +* supporting burst mode. +* +* When an implicit release is enabled on a port, Eventdev PMD will also handle +* the insertion of RELEASE events in place of dropped events. The independent enqueue +* feature only applies to FORWARD and RELEASE events. New events (op=RTE_EVENT_OP_NEW) +* will be dequeued in the order the application enqueues them and do not maintain +* any order relative to FORWARD/RELEASE events. FORWARD vs NEW relaxed ordering +* only applies to ports that have enabled independent enqueue feature. +*/ +/* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0/**< Highest priority level for events and queues.
@@ -1072,6 +1091,18 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* * @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) +/**< Flag to enable independent enqueue. Must not be set if the device +* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature +* allows an application to enqueue RTE_EVENT_OP_FORWARD or +* RTE_EVENT_OP_RELEASE in an order different than the order the +* events were dequeued from the event device, while maintaining +* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. +* +* Note that this flag only matters for Eventdevs supporting burst mode. +* +* @see rte_event_port_setup() +*/ /** Event port configuration structure */ struct rte_event_port_conf {
Signature · 1 line
2.25.1
PATCH v15 2/3 event/dlb2: add support for independent enqueue
In reply to Abdullah SevincerDLB devices need events to be enqueued in the same order they are dequeued. Applications are not suppose to change event order between dequeue and to enqueue. Since Eventdev standard does not add such restrictions independent enqueue support is needed for DLB PMD so that it restores dequeue order on enqueue if applications happen to change it. It also adds missing releases in places where events are dropped by the application and it expects implicit release to handle it.
By default the feature will be off on all DLB ports and they will behave the same as older releases. To enable reordering feature, applications need to add the flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ to port configuration if only the device advertises the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ.
--- doc/guides/prog_guide/eventdev/eventdev.rst | 33 ++ doc/guides/rel_notes/release_24_11.rst | 4 + drivers/event/dlb2/dlb2.c | 490 +++++++++++++------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 24 + 7 files changed, 421 insertions(+), 190 deletions(-)
doc/guides/prog_guide/eventdev/eventdev.rst +33 -0
@@ -472,6 +472,39 @@ A flush callback can be passed to the function to handle any outstanding events. Invocation of this API does not affect the existing port configuration. +Independent Enqueue Capability +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Some eventdev hardware devices such as DLB2 expects all forwarded events to be +enqueued in the same order as they are dequeued. For dropped events, their +releases should come at the same location as the original event was expected. +Hardware has this restriction as it uses the order to retrieve information about +the original event that was sent to the CPU. This contains information like atomic +flow ID to release the flow lock and ordered events sequence number to restore the +original order. + +Some applications, like those based on the DPDK dispatcher library, want +enqueue order independence. To support this, DLB2 PMD supports the +``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` capability. + +This capability applies to Eventdevs supporting burst mode. On ports where +the application is going to change enqueue order, +``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` support should be enabled. + +Example code to inform PMD that the application plans to use independent enqueue +order on a port: + + .. code-block:: c + + if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) + port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; + +This code example enables enqueue event reordering inside DLB2 PMD before the events +are sent to the DLB2 hardware. If the application is not going to change the enqueue +order, this flag should not be enabled to get better performance. DLB2 PMD saves +ordering information inside the impl_opaque field of the event, and this field should +be preserved for all FORWARD or RELEASE events. + Stopping the EventDev ~~~~~~~~~~~~~~~~~~~~~
doc/guides/rel_notes/release_24_11.rst +4 -0
@@ -73,6 +73,10 @@ New Features supports enqueue in any order or specifically in a different order than dequeue. The feature is intended for eventdevs supporting burst mode. + * Updated DLB2 driver for independent enqueue feature. Applications should + use ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the + capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. + Removed Items -------------
drivers/event/dlb2/dlb2.c +320 -170
681 lines not on this page · raw message
drivers/event/dlb2/dlb2_avx512.c +14 -13
@@ -151,20 +151,20 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port,*/ #define DLB2_QE_EV_TYPE_WORD 0 sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[0 ].sub_event_type <<8 | - ev[0 ].event_type, + ev[0 ].sub_event_type <<4 | + ev[0 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[1 ].sub_event_type <<8 | - ev[1 ].event_type, + ev[1 ].sub_event_type <<4 | + ev[1 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[2 ].sub_event_type <<8 | - ev[2 ].event_type, + ev[2 ].sub_event_type <<4 | + ev[2 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[3 ].sub_event_type <<8 | - ev[3 ].event_type, + ev[3 ].sub_event_type <<4 | + ev[3 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 );if (qm_port->use_avx512) {
@@ -238,11 +238,11 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, }/* will only be set for DLB 2.5 + */ -if (qm_port->cq_weight) { - qe[0 ].weight = ev[0 ].impl_opaque &3 ; - qe[1 ].weight = ev[1 ].impl_opaque &3 ; - qe[2 ].weight = ev[2 ].impl_opaque &3 ; - qe[3 ].weight = ev[3 ].impl_opaque &3 ; +if (qm_port->dlb2->enable_cq_weight) { + qe[0 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[0 ]); + qe[1 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[1 ]); + qe[2 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[2 ]); + qe[3 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[3 ]); }break ;
@@ -267,6 +267,7 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, } qe[i].u.event_type.major = ev[i].event_type; qe[i].u.event_type.sub = ev[i].sub_event_type; + qe[i].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[i]); }break ;case 0 :
drivers/event/dlb2/dlb2_inline_fns.h +8 -0
@@ -32,4 +32,12 @@ dlb2_movdir64b(void *dest, void *src) : "a" (dest), "d" (src)); } +static inline void +dlb2_movdir64b_single (void *pp_addr,void *qe4) +{ + asmvolatile (".byte 0x66, 0x0f, 0x38, 0xf8, 0x02" + : + :"a" (pp_addr),"d" (qe4)); +} +#endif /* _DLB2_INLINE_FNS_H_ */
drivers/event/dlb2/dlb2_priv.h +18 -7
@@ -29,7 +29,8 @@#define DLB2_SW_CREDIT_C_QUANTA_DEFAULT 256/* Consumer */ #define DLB2_DEPTH_THRESH_DEFAULT 256#define DLB2_MIN_CQ_DEPTH_OVERRIDE 32 -#define DLB2_MAX_CQ_DEPTH_OVERRIDE 128 +#define DLB2_MAX_CQ_DEPTH_OVERRIDE 1024 +#define DLB2_MAX_CQ_DEPTH_REORDER 128#define DLB2_MIN_ENQ_DEPTH_OVERRIDE 32#define DLB2_MAX_ENQ_DEPTH_OVERRIDE 1024
@@ -387,8 +388,23 @@ struct dlb2_port {bool use_scalar;/* force usage of scalar code */ uint16_t hw_credit_quanta;bool use_avx512; -uint32_t cq_weight;bool is_producer;/* True if port is of type producer */ +uint8_t reorder_id;/* id used for reordering events coming back into the scheduler */ +bool reorder_en; +struct dlb2_reorder *order;/* For ordering enqueues */ +}; + +struct dlb2_reorder { +/* a reorder buffer for events coming back in different order from dequeue +* We use UINT8_MAX + 1 elements, but add on three no-ops to make movdirs easier at the end +*/ +union { +__m128i m128; +struct dlb2_enqueue_qe qe; +uint64_t u64[2 ]; + } enq_reorder[UINT8_MAX +4 ]; +/* id of the next entry in the reorder enqueue ring to send in */ +uint8_t next_to_enqueue; };/* Per-process per-port mmio and memory pointers */
@@ -642,10 +658,6 @@ struct dlb2_qid_depth_thresholds {int val[DLB2_MAX_NUM_QUEUES_ALL ]; }; -struct dlb2_cq_weight { -int limit[DLB2_MAX_NUM_PORTS_ALL ]; -}; -struct dlb2_port_cos {int cos_id[DLB2_MAX_NUM_PORTS_ALL ]; };
@@ -667,7 +679,6 @@ struct dlb2_devargs {bool vector_opts_enabled;int max_cq_depth;int max_enq_depth; -struct dlb2_cq_weight cq_weight;struct dlb2_port_cos port_cos;struct dlb2_cos_bw cos_bw;const char *producer_coremask;
drivers/event/dlb2/rte_pmd_dlb2.h +24 -0
@@ -19,6 +19,30 @@ extern "C" {#include <rte_compat.h> +/** +* Macro function to get QID depth of rte_event metadata. +* Currently lower 2 bits of 'rsvd' field are used to store QID depth. +*/ +#define RTE_PMD_DLB2_GET_QID_DEPTH (x) ((x)->rsvd & 0x3) + +/** +* Macro function to set QID depth of rte_event metadata. +* Currently lower 2 bits of 'rsvd' field are used to store QID depth. +*/ +#define RTE_PMD_DLB2_SET_QID_DEPTH (x, v) ((x)->rsvd = ((x)->rsvd & ~0x3) | (v & 0x3)) + +/** +* Macro function to get QE weight from rte_event metadata. +* Currently upper 2 bits of 'rsvd' field are used to store QE weight. +*/ +#define RTE_PMD_DLB2_GET_QE_WEIGHT (x) (((x)->rsvd >> 2) & 0x3) + +/** +* Macro function to set QE weight from rte_event metadata. +* Currently upper 2 bits of 'rsvd' field are used to store QE weight. +*/ +#define RTE_PMD_DLB2_SET_QE_WEIGHT (x, v) ((x)->rsvd = ((x)->rsvd & 0x3) | ((v & 0x3) << 2)) +/** * @warning * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
Signature · 1 line
2.25.1
PATCH v15 3/3 event/dsw: add capability for independent enqueue
In reply to Abdullah SevincerTo use independent enqueue capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists. Hence, this commit adds the capability of independent enqueue to the DSW driver.
--- doc/guides/rel_notes/release_24_11.rst | 2 ++ drivers/event/dsw/dsw_evdev.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-)
doc/guides/rel_notes/release_24_11.rst +2 -0
@@ -77,6 +77,8 @@ New Features use ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. + * Updated DSW driver for independent enqueue feature. + Removed Items -------------
drivers/event/dsw/dsw_evdev.c +2 -1
@@ -230,7 +230,8 @@ dsw_info_get(struct rte_eventdev *dev __rte_unused,RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE |RTE_EVENT_DEV_CAP_NONSEQ_MODE |RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT | - RTE_EVENT_DEV_CAP_CARRY_FLOW_ID +RTE_EVENT_DEV_CAP_CARRY_FLOW_ID | + RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ }; }
Signature · 1 line
2.25.1
v16 cover Independent Enqueue Support
In reply to Abdullah Sevincerv16: Address comments.
v15: Address comments.
v14: Address comments.
v13: Address comments.
v12: Address comments.
v11: Address comments.
v10: Add acked-by reviewer name.
v9: Address comments.
v8: Address build issues.
v7: Address documentation reviews.
v6: Update patch with more documentation.
v5: Address build issues.
v4: Address comments.
v3: Fix CI/build issues.
v2: Fix CI/build issues.
v1: Initial patchset.
Abdullah Sevincer (3):
eventdev: add support for independent enqueue event/dlb2: add support for independent enqueue event/dsw: add capability for independent enqueue
doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/prog_guide/eventdev/eventdev.rst | 33 ++ doc/guides/rel_notes/release_24_11.rst | 12 + drivers/event/dlb2/dlb2.c | 490 +++++++++++++------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 24 + drivers/event/dsw/dsw_evdev.c | 3 +- lib/eventdev/rte_eventdev.h | 31 ++ 11 files changed, 464 insertions(+), 191 deletions(-)
Signature · 1 line
2.25.1
PATCH v16 1/3 eventdev: add support for independent enqueue
Support for independent enqueue feature and updates Event Device and PMD feature list.
A new capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ is introduced. It allows out-of-order enqueuing of RTE_EVENT_OP_FORWARD or RELEASE type events on an event port where this capability is enabled.
To use this capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists.
--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_11.rst | 6 +++++ lib/eventdev/rte_eventdev.h | 31 +++++++++++++++++++++++ 4 files changed, 39 insertions(+)
doc/guides/eventdevs/features/default.ini +1 -0
@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.
doc/guides/eventdevs/features/dlb2.ini +1 -0
@@ -15,6 +15,7 @@ implicit_release_disable = Y runtime_port_link = Y multiple_queue_port = Y maintenance_free = Y +independent_enq = Y [Eth Rx adapter Features]
doc/guides/rel_notes/release_24_11.rst +6 -0
@@ -67,6 +67,12 @@ New Features The new statistics are useful for debugging and profiling. +* **Updated Event Device Library for independent enqueue feature** + + * Added support for independent enqueue feature. With this feature Eventdev + supports enqueue in any order or specifically in a different order than + dequeue. The feature is intended for eventdevs supporting burst mode. + Removed Items -------------
lib/eventdev/rte_eventdev.h +31 -0
@@ -446,6 +446,25 @@ struct rte_event;* @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ (1ULL << 16) +/**< Event device is capable of independent enqueue. +* A new capability, RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, will indicate that Eventdev +* supports the enqueue in any order or specifically in a different order than the +* dequeue. Eventdev PMD can either dequeue events in the changed order in which +* they are enqueued or restore the original order before sending them to the +* underlying hardware device. A flag is provided during the port configuration to +* inform Eventdev PMD that the application intends to use an independent enqueue +* order on a particular port. Note that this capability only matters for eventdevs +* supporting burst mode. +* +* When an implicit release is enabled on a port, Eventdev PMD will also handle +* the insertion of RELEASE events in place of dropped events. The independent enqueue +* feature only applies to FORWARD and RELEASE events. New events (op=RTE_EVENT_OP_NEW) +* will be dequeued in the order the application enqueues them and do not maintain +* any order relative to FORWARD/RELEASE events. FORWARD vs NEW relaxed ordering +* only applies to ports that have enabled independent enqueue feature. +*/ +/* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0/**< Highest priority level for events and queues.
@@ -1072,6 +1091,18 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* * @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) +/**< Flag to enable independent enqueue. Must not be set if the device +* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature +* allows an application to enqueue RTE_EVENT_OP_FORWARD or +* RTE_EVENT_OP_RELEASE in an order different than the order the +* events were dequeued from the event device, while maintaining +* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. +* +* Note that this flag only matters for Eventdevs supporting burst mode. +* +* @see rte_event_port_setup() +*/ /** Event port configuration structure */ struct rte_event_port_conf {
Signature · 1 line
2.25.1
PATCH v16 2/3 event/dlb2: add support for independent enqueue
In reply to Abdullah SevincerDLB devices need events to be enqueued in the same order they are dequeued. Applications are not suppose to change event order between dequeue and to enqueue. Since Eventdev standard does not add such restrictions independent enqueue support is needed for DLB PMD so that it restores dequeue order on enqueue if applications happen to change it. It also adds missing releases in places where events are dropped by the application and it expects implicit release to handle it.
By default the feature will be off on all DLB ports and they will behave the same as older releases. To enable reordering feature, applications need to add the flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ to port configuration if only the device advertises the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ.
--- doc/guides/prog_guide/eventdev/eventdev.rst | 33 ++ doc/guides/rel_notes/release_24_11.rst | 4 + drivers/event/dlb2/dlb2.c | 490 +++++++++++++------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 24 + 7 files changed, 421 insertions(+), 190 deletions(-)
doc/guides/prog_guide/eventdev/eventdev.rst +33 -0
@@ -472,6 +472,39 @@ A flush callback can be passed to the function to handle any outstanding events. Invocation of this API does not affect the existing port configuration. +Independent Enqueue Capability +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Some eventdev hardware devices such as DLB2 expects all forwarded events to be +enqueued in the same order as they are dequeued. For dropped events, their +releases should come at the same location as the original event was expected. +Hardware has this restriction as it uses the order to retrieve information about +the original event that was sent to the CPU. This contains information like atomic +flow ID to release the flow lock and ordered events sequence number to restore the +original order. + +Some applications, like those based on the DPDK dispatcher library, want +enqueue order independence. To support this, DLB2 PMD supports the +``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` capability. + +This capability applies to Eventdevs supporting burst mode. On ports where +the application is going to change enqueue order, +``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` support should be enabled. + +Example code to inform PMD that the application plans to use independent enqueue +order on a port: + + .. code-block:: c + + if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) + port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; + +This code example enables enqueue event reordering inside DLB2 PMD before the events +are sent to the DLB2 hardware. If the application is not going to change the enqueue +order, this flag should not be enabled to get better performance. DLB2 PMD saves +ordering information inside the impl_opaque field of the event, and this field should +be preserved for all FORWARD or RELEASE events. + Stopping the EventDev ~~~~~~~~~~~~~~~~~~~~~
doc/guides/rel_notes/release_24_11.rst +4 -0
@@ -73,6 +73,10 @@ New Features supports enqueue in any order or specifically in a different order than dequeue. The feature is intended for eventdevs supporting burst mode. + * Updated DLB2 driver for independent enqueue feature. Applications should + use ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the + capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. + Removed Items -------------
drivers/event/dlb2/dlb2.c +320 -170
681 lines not on this page · raw message
drivers/event/dlb2/dlb2_avx512.c +14 -13
@@ -151,20 +151,20 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port,*/ #define DLB2_QE_EV_TYPE_WORD 0 sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[0 ].sub_event_type <<8 | - ev[0 ].event_type, + ev[0 ].sub_event_type <<4 | + ev[0 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[1 ].sub_event_type <<8 | - ev[1 ].event_type, + ev[1 ].sub_event_type <<4 | + ev[1 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[2 ].sub_event_type <<8 | - ev[2 ].event_type, + ev[2 ].sub_event_type <<4 | + ev[2 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[3 ].sub_event_type <<8 | - ev[3 ].event_type, + ev[3 ].sub_event_type <<4 | + ev[3 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 );if (qm_port->use_avx512) {
@@ -238,11 +238,11 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, }/* will only be set for DLB 2.5 + */ -if (qm_port->cq_weight) { - qe[0 ].weight = ev[0 ].impl_opaque &3 ; - qe[1 ].weight = ev[1 ].impl_opaque &3 ; - qe[2 ].weight = ev[2 ].impl_opaque &3 ; - qe[3 ].weight = ev[3 ].impl_opaque &3 ; +if (qm_port->dlb2->enable_cq_weight) { + qe[0 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[0 ]); + qe[1 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[1 ]); + qe[2 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[2 ]); + qe[3 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[3 ]); }break ;
@@ -267,6 +267,7 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, } qe[i].u.event_type.major = ev[i].event_type; qe[i].u.event_type.sub = ev[i].sub_event_type; + qe[i].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[i]); }break ;case 0 :
drivers/event/dlb2/dlb2_inline_fns.h +8 -0
@@ -32,4 +32,12 @@ dlb2_movdir64b(void *dest, void *src) : "a" (dest), "d" (src)); } +static inline void +dlb2_movdir64b_single (void *pp_addr,void *qe4) +{ + asmvolatile (".byte 0x66, 0x0f, 0x38, 0xf8, 0x02" + : + :"a" (pp_addr),"d" (qe4)); +} +#endif /* _DLB2_INLINE_FNS_H_ */
drivers/event/dlb2/dlb2_priv.h +18 -7
@@ -29,7 +29,8 @@#define DLB2_SW_CREDIT_C_QUANTA_DEFAULT 256/* Consumer */ #define DLB2_DEPTH_THRESH_DEFAULT 256#define DLB2_MIN_CQ_DEPTH_OVERRIDE 32 -#define DLB2_MAX_CQ_DEPTH_OVERRIDE 128 +#define DLB2_MAX_CQ_DEPTH_OVERRIDE 1024 +#define DLB2_MAX_CQ_DEPTH_REORDER 128#define DLB2_MIN_ENQ_DEPTH_OVERRIDE 32#define DLB2_MAX_ENQ_DEPTH_OVERRIDE 1024
@@ -387,8 +388,23 @@ struct dlb2_port {bool use_scalar;/* force usage of scalar code */ uint16_t hw_credit_quanta;bool use_avx512; -uint32_t cq_weight;bool is_producer;/* True if port is of type producer */ +uint8_t reorder_id;/* id used for reordering events coming back into the scheduler */ +bool reorder_en; +struct dlb2_reorder *order;/* For ordering enqueues */ +}; + +struct dlb2_reorder { +/* a reorder buffer for events coming back in different order from dequeue +* We use UINT8_MAX + 1 elements, but add on three no-ops to make movdirs easier at the end +*/ +union { +__m128i m128; +struct dlb2_enqueue_qe qe; +uint64_t u64[2 ]; + } enq_reorder[UINT8_MAX +4 ]; +/* id of the next entry in the reorder enqueue ring to send in */ +uint8_t next_to_enqueue; };/* Per-process per-port mmio and memory pointers */
@@ -642,10 +658,6 @@ struct dlb2_qid_depth_thresholds {int val[DLB2_MAX_NUM_QUEUES_ALL ]; }; -struct dlb2_cq_weight { -int limit[DLB2_MAX_NUM_PORTS_ALL ]; -}; -struct dlb2_port_cos {int cos_id[DLB2_MAX_NUM_PORTS_ALL ]; };
@@ -667,7 +679,6 @@ struct dlb2_devargs {bool vector_opts_enabled;int max_cq_depth;int max_enq_depth; -struct dlb2_cq_weight cq_weight;struct dlb2_port_cos port_cos;struct dlb2_cos_bw cos_bw;const char *producer_coremask;
drivers/event/dlb2/rte_pmd_dlb2.h +24 -0
@@ -19,6 +19,30 @@ extern "C" {#include <rte_compat.h> +/** +* Macro function to get QID depth of rte_event metadata. +* Currently lower 2 bits of 'rsvd' field are used to store QID depth. +*/ +#define RTE_PMD_DLB2_GET_QID_DEPTH (x) ((x)->rsvd & 0x3) + +/** +* Macro function to set QID depth of rte_event metadata. +* Currently lower 2 bits of 'rsvd' field are used to store QID depth. +*/ +#define RTE_PMD_DLB2_SET_QID_DEPTH (x, v) ((x)->rsvd = ((x)->rsvd & ~0x3) | (v & 0x3)) + +/** +* Macro function to get QE weight from rte_event metadata. +* Currently upper 2 bits of 'rsvd' field are used to store QE weight. +*/ +#define RTE_PMD_DLB2_GET_QE_WEIGHT (x) (((x)->rsvd >> 2) & 0x3) + +/** +* Macro function to set QE weight from rte_event metadata. +* Currently upper 2 bits of 'rsvd' field are used to store QE weight. +*/ +#define RTE_PMD_DLB2_SET_QE_WEIGHT (x, v) ((x)->rsvd = ((x)->rsvd & 0x3) | ((v & 0x3) << 2)) +/** * @warning * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
Signature · 1 line
2.25.1
PATCH v16 3/3 event/dsw: add capability for independent enqueue
In reply to Abdullah SevincerTo use independent enqueue capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists. Hence, this commit adds the capability of independent enqueue to the DSW driver.
--- doc/guides/rel_notes/release_24_11.rst | 2 ++ drivers/event/dsw/dsw_evdev.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-)
doc/guides/rel_notes/release_24_11.rst +2 -0
@@ -77,6 +77,8 @@ New Features use ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. + * Updated DSW driver for independent enqueue feature. + Removed Items -------------
drivers/event/dsw/dsw_evdev.c +2 -1
@@ -230,7 +230,8 @@ dsw_info_get(struct rte_eventdev *dev __rte_unused,RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE |RTE_EVENT_DEV_CAP_NONSEQ_MODE |RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT | - RTE_EVENT_DEV_CAP_CARRY_FLOW_ID +RTE_EVENT_DEV_CAP_CARRY_FLOW_ID | + RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ }; }
Signature · 1 line
2.25.1
v17 cover Independent Enqueue Support
In reply to Abdullah Sevincerv17: Address comments.
v16: Address comments.
v15: Address comments.
v14: Address comments.
v13: Address comments.
v12: Address comments.
v11: Address comments.
v10: Add acked-by reviewer name.
v9: Address comments.
v8: Address build issues.
v7: Address documentation reviews.
v6: Update patch with more documentation.
v5: Address build issues.
v4: Address comments.
v3: Fix CI/build issues.
v2: Fix CI/build issues.
v1: Initial patchset.
Abdullah Sevincer (3):
eventdev: add support for independent enqueue event/dlb2: add support for independent enqueue event/dsw: add capability for independent enqueue
doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/prog_guide/eventdev/eventdev.rst | 27 ++ doc/guides/rel_notes/release_24_11.rst | 12 + drivers/event/dlb2/dlb2.c | 490 +++++++++++++------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 24 + drivers/event/dsw/dsw_evdev.c | 3 +- lib/eventdev/rte_eventdev.h | 31 ++ 11 files changed, 458 insertions(+), 191 deletions(-)
Signature · 1 line
2.25.1
PATCH v17 1/3 eventdev: add support for independent enqueue
Support for independent enqueue feature and updates Event Device and PMD feature list.
A new capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ is introduced. It allows out-of-order enqueuing of RTE_EVENT_OP_FORWARD or RELEASE type events on an event port where this capability is enabled.
To use this capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists.
--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/prog_guide/eventdev/eventdev.rst | 27 ++++++++++++++++++ doc/guides/rel_notes/release_24_11.rst | 8 ++++++ lib/eventdev/rte_eventdev.h | 31 +++++++++++++++++++++ 5 files changed, 68 insertions(+)
doc/guides/eventdevs/features/default.ini +1 -0
@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.
doc/guides/eventdevs/features/dlb2.ini +1 -0
@@ -15,6 +15,7 @@ implicit_release_disable = Y runtime_port_link = Y multiple_queue_port = Y maintenance_free = Y +independent_enq = Y [Eth Rx adapter Features]
doc/guides/prog_guide/eventdev/eventdev.rst +27 -0
@@ -472,6 +472,33 @@ A flush callback can be passed to the function to handle any outstanding events. Invocation of this API does not affect the existing port configuration. +Independent Enqueue Capability +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This capability applies to eventdev devices that expects all forwarded events to be +enqueued in the same order as they are dequeued. For dropped events, their +releases should come at the same location as the original event was expected. +The eventdev device has this restriction as it uses the order to retrieve information about +the original event that was sent to the CPU. This contains information like atomic +flow ID to release the flow lock and ordered events sequence number to restore the +original order. + +This capability only matters to eventdevs supporting burst mode. On ports where +the application is going to change enqueue order, +``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` support should be enabled. + +Example code to inform PMD that the application plans to use independent enqueue +order on a port: + + .. code-block:: c + + if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) + port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; + +This code example enables enqueue event reordering inside PMD before the events +are sent to the hardware. If the application is not going to change the enqueue +order, this flag should not be enabled to get better performance. + Stopping the EventDev ~~~~~~~~~~~~~~~~~~~~~
doc/guides/rel_notes/release_24_11.rst +8 -0
@@ -67,6 +67,14 @@ New Features The new statistics are useful for debugging and profiling. +* **Updated Event Device Library for independent enqueue feature** + + * Added support for independent enqueue feature. With this feature Eventdev + supports enqueue in any order or specifically in a different order than + dequeue. The feature is intended for eventdevs supporting burst mode. + Applications should use ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable + the feature if the capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. + Removed Items -------------
lib/eventdev/rte_eventdev.h +31 -0
@@ -446,6 +446,25 @@ struct rte_event;* @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ (1ULL << 16) +/**< Event device is capable of independent enqueue. +* A new capability, RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, will indicate that Eventdev +* supports the enqueue in any order or specifically in a different order than the +* dequeue. Eventdev PMD can either dequeue events in the changed order in which +* they are enqueued or restore the original order before sending them to the +* underlying hardware device. A flag is provided during the port configuration to +* inform Eventdev PMD that the application intends to use an independent enqueue +* order on a particular port. Note that this capability only matters for eventdevs +* supporting burst mode. +* +* When an implicit release is enabled on a port, Eventdev PMD will also handle +* the insertion of RELEASE events in place of dropped events. The independent enqueue +* feature only applies to FORWARD and RELEASE events. New events (op=RTE_EVENT_OP_NEW) +* will be dequeued in the order the application enqueues them and do not maintain +* any order relative to FORWARD/RELEASE events. FORWARD vs NEW relaxed ordering +* only applies to ports that have enabled independent enqueue feature. +*/ +/* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0/**< Highest priority level for events and queues.
@@ -1072,6 +1091,18 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* * @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) +/**< Flag to enable independent enqueue. Must not be set if the device +* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature +* allows an application to enqueue RTE_EVENT_OP_FORWARD or +* RTE_EVENT_OP_RELEASE in an order different than the order the +* events were dequeued from the event device, while maintaining +* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. +* +* Note that this flag only matters for Eventdevs supporting burst mode. +* +* @see rte_event_port_setup() +*/ /** Event port configuration structure */ struct rte_event_port_conf {
Signature · 1 line
2.25.1
Re: [PATCH v17 1/3] eventdev: add support for independent enqueue
doc/guides/eventdevs/features/dlb2.ini
Quoted 35 lines · Abdullah Sevincer
Support for independent enqueue feature and updates Event Device and PMD feature list.
A new capability
RTE_EVENT_DEV_CAP_INDEPENDENT_ENQis introduced. It allows out-of-order enqueuing ofRTE_EVENT_OP_FORWARDor RELEASE type events on an event port where this capability is enabled.To use this capability applications need to set flag
RTE_EVENT_PORT_CFG_INDEPENDENT_ENQduring port setup only if the capabilityRTE_EVENT_DEV_CAP_INDEPENDENT_ENQexists.Signed-off-by Abdullah Sevincer <[email protected]>Acked-by Mattias Rönnblom <[email protected]>--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/prog_guide/eventdev/eventdev.rst | 27 ++++++++++++++++++ doc/guides/rel_notes/release_24_11.rst | 8 ++++++ lib/eventdev/rte_eventdev.h | 31 +++++++++++++++++++++ 5 files changed, 68 insertions(+)doc/guides/eventdevs/features/default.ini +1
-0@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.doc/guides/eventdevs/features/dlb2.ini +0
-0
Why adding dlb2.ini update in 1/3. Move to 2/3.
Also add the same for DSW in 3/3.
Quoted 32 lines
index
7b80286927..c7193b47c1100644doc/guides/eventdevs/features/dlb2.ini +1
-0@@ -15,6 +15,7 @@ implicit_release_disable = Y runtime_port_link = Y multiple_queue_port = Y maintenance_free = Y +independent_enq = Y [Eth Rx adapter Features]doc/guides/prog_guide/eventdev/eventdev.rst +13
-0@@ -472,6 +472,33 @@ A flush callback can be passed to the function to handle any outstanding events. Invocation of this API does not affect the existing port configuration. +Independent Enqueue Capability +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This capability applies to eventdev devices that expects all forwarded events to be +enqueued in the same order as they are dequeued. For dropped events, their +releases should come at the same location as the original event was expected. +The eventdev device has this restriction as it uses the order to retrieve information about +the original event that was sent to the CPU. This contains information like atomic +flow ID to release the flow lock and ordered events sequence number to restore the +original order. + +This capability only matters to eventdevs supporting burst mode. On ports where +the application is going to change enqueue order,
doc/guides/prog_guide/eventdev/eventdev.rst A flush callback can be passed to the function to handle any outstanding events. · line 497
Quoted 10 lines
doc/guides/prog_guide/eventdev/eventdev.rst +10
-0+``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` support should be enabled. + +Example code to inform PMD that the application plans to use independent enqueue +order on a port: + + .. code-block:: c + + if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) + port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; +
The below section does not have any code. It is an orphan section. Move _below section_(only below) along with code in 2/3 patch to doc/guides/eventdevs/dlb2.rst as it is not specific generic.
doc/guides/prog_guide/eventdev/eventdev.rst A flush callback can be passed to the function to handle any outstanding events. · line 500
Quoted 3 lines
doc/guides/prog_guide/eventdev/eventdev.rst +3
-0+This code example enables enqueue event reordering inside PMD before the events +are sent to the hardware. If the application is not going to change the enqueue +order, this flag should not be enabled to get better performance.
PLEASE PAY SOME ATTENTION before sending the next version. I am repeating the same.
RE: [PATCH v17 1/3] eventdev: add support for independent enqueue
That part below was intended for continuation of the above code sample. Remember there was a DLB2 related information below I removed that. But, It looks like it is thought to be an orphan section I will remove it in the next patch set.
Quoted 6 lines
(quoted diff) +5
-0+The below section does not have any code. It is an orphan section. +Move _below section_(only below) along with code in 2/3 patch to doc/guides/eventdevs/dlb2.rst as it is not specific generic. +This code example enables enqueue event reordering inside PMD before +the events are sent to the hardware. If the application is not going +to change the enqueue order, this flag should not be enabled to get better performance.
PATCH v17 2/3 event/dlb2: add support for independent enqueue
In reply to Abdullah SevincerDLB devices need events to be enqueued in the same order they are dequeued. Applications are not suppose to change event order between dequeue and to enqueue. Since Eventdev standard does not add such restrictions independent enqueue support is needed for DLB PMD so that it restores dequeue order on enqueue if applications happen to change it. It also adds missing releases in places where events are dropped by the application and it expects implicit release to handle it.
By default the feature will be off on all DLB ports and they will behave the same as older releases. To enable reordering feature, applications need to add the flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ to port configuration if only the device advertises the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ.
--- doc/guides/rel_notes/release_24_11.rst | 2 + drivers/event/dlb2/dlb2.c | 490 ++++++++++++++++--------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 24 ++ 6 files changed, 386 insertions(+), 190 deletions(-)
doc/guides/rel_notes/release_24_11.rst +2 -0
@@ -75,6 +75,8 @@ New Features Applications should use ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. + * Updated DLB2 driver for independent enqueue feature. + Removed Items -------------
drivers/event/dlb2/dlb2.c +320 -170
681 lines not on this page · raw message
drivers/event/dlb2/dlb2_avx512.c +14 -13
@@ -151,20 +151,20 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port,*/ #define DLB2_QE_EV_TYPE_WORD 0 sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[0 ].sub_event_type <<8 | - ev[0 ].event_type, + ev[0 ].sub_event_type <<4 | + ev[0 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[1 ].sub_event_type <<8 | - ev[1 ].event_type, + ev[1 ].sub_event_type <<4 | + ev[1 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[2 ].sub_event_type <<8 | - ev[2 ].event_type, + ev[2 ].sub_event_type <<4 | + ev[2 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[3 ].sub_event_type <<8 | - ev[3 ].event_type, + ev[3 ].sub_event_type <<4 | + ev[3 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 );if (qm_port->use_avx512) {
@@ -238,11 +238,11 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, }/* will only be set for DLB 2.5 + */ -if (qm_port->cq_weight) { - qe[0 ].weight = ev[0 ].impl_opaque &3 ; - qe[1 ].weight = ev[1 ].impl_opaque &3 ; - qe[2 ].weight = ev[2 ].impl_opaque &3 ; - qe[3 ].weight = ev[3 ].impl_opaque &3 ; +if (qm_port->dlb2->enable_cq_weight) { + qe[0 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[0 ]); + qe[1 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[1 ]); + qe[2 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[2 ]); + qe[3 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[3 ]); }break ;
@@ -267,6 +267,7 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, } qe[i].u.event_type.major = ev[i].event_type; qe[i].u.event_type.sub = ev[i].sub_event_type; + qe[i].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[i]); }break ;case 0 :
drivers/event/dlb2/dlb2_inline_fns.h +8 -0
@@ -32,4 +32,12 @@ dlb2_movdir64b(void *dest, void *src) : "a" (dest), "d" (src)); } +static inline void +dlb2_movdir64b_single (void *pp_addr,void *qe4) +{ + asmvolatile (".byte 0x66, 0x0f, 0x38, 0xf8, 0x02" + : + :"a" (pp_addr),"d" (qe4)); +} +#endif /* _DLB2_INLINE_FNS_H_ */
drivers/event/dlb2/dlb2_priv.h +18 -7
@@ -29,7 +29,8 @@#define DLB2_SW_CREDIT_C_QUANTA_DEFAULT 256/* Consumer */ #define DLB2_DEPTH_THRESH_DEFAULT 256#define DLB2_MIN_CQ_DEPTH_OVERRIDE 32 -#define DLB2_MAX_CQ_DEPTH_OVERRIDE 128 +#define DLB2_MAX_CQ_DEPTH_OVERRIDE 1024 +#define DLB2_MAX_CQ_DEPTH_REORDER 128#define DLB2_MIN_ENQ_DEPTH_OVERRIDE 32#define DLB2_MAX_ENQ_DEPTH_OVERRIDE 1024
@@ -387,8 +388,23 @@ struct dlb2_port {bool use_scalar;/* force usage of scalar code */ uint16_t hw_credit_quanta;bool use_avx512; -uint32_t cq_weight;bool is_producer;/* True if port is of type producer */ +uint8_t reorder_id;/* id used for reordering events coming back into the scheduler */ +bool reorder_en; +struct dlb2_reorder *order;/* For ordering enqueues */ +}; + +struct dlb2_reorder { +/* a reorder buffer for events coming back in different order from dequeue +* We use UINT8_MAX + 1 elements, but add on three no-ops to make movdirs easier at the end +*/ +union { +__m128i m128; +struct dlb2_enqueue_qe qe; +uint64_t u64[2 ]; + } enq_reorder[UINT8_MAX +4 ]; +/* id of the next entry in the reorder enqueue ring to send in */ +uint8_t next_to_enqueue; };/* Per-process per-port mmio and memory pointers */
@@ -642,10 +658,6 @@ struct dlb2_qid_depth_thresholds {int val[DLB2_MAX_NUM_QUEUES_ALL ]; }; -struct dlb2_cq_weight { -int limit[DLB2_MAX_NUM_PORTS_ALL ]; -}; -struct dlb2_port_cos {int cos_id[DLB2_MAX_NUM_PORTS_ALL ]; };
@@ -667,7 +679,6 @@ struct dlb2_devargs {bool vector_opts_enabled;int max_cq_depth;int max_enq_depth; -struct dlb2_cq_weight cq_weight;struct dlb2_port_cos port_cos;struct dlb2_cos_bw cos_bw;const char *producer_coremask;
drivers/event/dlb2/rte_pmd_dlb2.h +24 -0
@@ -19,6 +19,30 @@ extern "C" {#include <rte_compat.h> +/** +* Macro function to get QID depth of rte_event metadata. +* Currently lower 2 bits of 'rsvd' field are used to store QID depth. +*/ +#define RTE_PMD_DLB2_GET_QID_DEPTH (x) ((x)->rsvd & 0x3) + +/** +* Macro function to set QID depth of rte_event metadata. +* Currently lower 2 bits of 'rsvd' field are used to store QID depth. +*/ +#define RTE_PMD_DLB2_SET_QID_DEPTH (x, v) ((x)->rsvd = ((x)->rsvd & ~0x3) | (v & 0x3)) + +/** +* Macro function to get QE weight from rte_event metadata. +* Currently upper 2 bits of 'rsvd' field are used to store QE weight. +*/ +#define RTE_PMD_DLB2_GET_QE_WEIGHT (x) (((x)->rsvd >> 2) & 0x3) + +/** +* Macro function to set QE weight from rte_event metadata. +* Currently upper 2 bits of 'rsvd' field are used to store QE weight. +*/ +#define RTE_PMD_DLB2_SET_QE_WEIGHT (x, v) ((x)->rsvd = ((x)->rsvd & 0x3) | ((v & 0x3) << 2)) +/** * @warning * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
Signature · 1 line
2.25.1
PATCH v17 3/3 event/dsw: add capability for independent enqueue
In reply to Abdullah SevincerTo use independent enqueue capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists. Hence, this commit adds the capability of independent enqueue to the DSW driver.
--- doc/guides/rel_notes/release_24_11.rst | 2 ++ drivers/event/dsw/dsw_evdev.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-)
doc/guides/rel_notes/release_24_11.rst +2 -0
@@ -77,6 +77,8 @@ New Features * Updated DLB2 driver for independent enqueue feature. + * Updated DSW driver for independent enqueue feature. + Removed Items -------------
drivers/event/dsw/dsw_evdev.c +2 -1
@@ -230,7 +230,8 @@ dsw_info_get(struct rte_eventdev *dev __rte_unused,RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE |RTE_EVENT_DEV_CAP_NONSEQ_MODE |RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT | - RTE_EVENT_DEV_CAP_CARRY_FLOW_ID +RTE_EVENT_DEV_CAP_CARRY_FLOW_ID | + RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ }; }
Signature · 1 line
2.25.1
v18 cover Independent Enqueue Support
In reply to Abdullah Sevincerv18: Address comments.
v17: Address comments.
v16: Address comments.
v15: Address comments.
v14: Address comments.
v13: Address comments.
v12: Address comments.
v11: Address comments.
v10: Add acked-by reviewer name.
v9: Address comments.
v8: Address build issues.
v7: Address documentation reviews.
v6: Update patch with more documentation.
v5: Address build issues.
v4: Address comments.
v3: Fix CI/build issues.
v2: Fix CI/build issues.
v1: Initial patchset.
Abdullah Sevincer (3):
eventdev: add support for independent enqueue event/dlb2: add support for independent enqueue event/dsw: add capability for independent enqueue
doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/eventdevs/features/dsw.ini | 1 + doc/guides/prog_guide/eventdev/eventdev.rst | 23 + doc/guides/rel_notes/release_24_11.rst | 12 + drivers/event/dlb2/dlb2.c | 490 +++++++++++++------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 24 + drivers/event/dsw/dsw_evdev.c | 3 +- lib/eventdev/rte_eventdev.h | 31 ++ 12 files changed, 455 insertions(+), 191 deletions(-)
Signature · 1 line
2.25.1
PATCH v18 1/3 eventdev: add support for independent enqueue
Support for independent enqueue feature and updates Event Device and PMD feature list.
A new capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ is introduced. It allows out-of-order enqueuing of RTE_EVENT_OP_FORWARD or RELEASE type events on an event port where this capability is enabled.
To use this capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists.
--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/prog_guide/eventdev/eventdev.rst | 23 +++++++++++++++ doc/guides/rel_notes/release_24_11.rst | 8 ++++++ lib/eventdev/rte_eventdev.h | 31 +++++++++++++++++++++ 4 files changed, 63 insertions(+)
doc/guides/eventdevs/features/default.ini +1 -0
@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.
doc/guides/prog_guide/eventdev/eventdev.rst +23 -0
@@ -472,6 +472,29 @@ A flush callback can be passed to the function to handle any outstanding events. Invocation of this API does not affect the existing port configuration. +Independent Enqueue Capability +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This capability applies to eventdev devices that expects all forwarded events to be +enqueued in the same order as they are dequeued. For dropped events, their +releases should come at the same location as the original event was expected. +The eventdev device has this restriction as it uses the order to retrieve information about +the original event that was sent to the CPU. This contains information like atomic +flow ID to release the flow lock and ordered events sequence number to restore the +original order. + +This capability only matters to eventdevs supporting burst mode. On ports where +the application is going to change enqueue order, +``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` support should be enabled. + +Example code to inform PMD that the application plans to use independent enqueue +order on a port: + + .. code-block:: c + + if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) + port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; + Stopping the EventDev ~~~~~~~~~~~~~~~~~~~~~
doc/guides/rel_notes/release_24_11.rst +8 -0
@@ -67,6 +67,14 @@ New Features The new statistics are useful for debugging and profiling. +* **Updated Event Device Library for independent enqueue feature** + + * Added support for independent enqueue feature. With this feature Eventdev + supports enqueue in any order or specifically in a different order than + dequeue. The feature is intended for eventdevs supporting burst mode. + Applications should use ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable + the feature if the capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. + Removed Items -------------
lib/eventdev/rte_eventdev.h +31 -0
@@ -446,6 +446,25 @@ struct rte_event;* @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ (1ULL << 16) +/**< Event device is capable of independent enqueue. +* A new capability, RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, will indicate that Eventdev +* supports the enqueue in any order or specifically in a different order than the +* dequeue. Eventdev PMD can either dequeue events in the changed order in which +* they are enqueued or restore the original order before sending them to the +* underlying hardware device. A flag is provided during the port configuration to +* inform Eventdev PMD that the application intends to use an independent enqueue +* order on a particular port. Note that this capability only matters for eventdevs +* supporting burst mode. +* +* When an implicit release is enabled on a port, Eventdev PMD will also handle +* the insertion of RELEASE events in place of dropped events. The independent enqueue +* feature only applies to FORWARD and RELEASE events. New events (op=RTE_EVENT_OP_NEW) +* will be dequeued in the order the application enqueues them and do not maintain +* any order relative to FORWARD/RELEASE events. FORWARD vs NEW relaxed ordering +* only applies to ports that have enabled independent enqueue feature. +*/ +/* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0/**< Highest priority level for events and queues.
@@ -1072,6 +1091,18 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* * @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) +/**< Flag to enable independent enqueue. Must not be set if the device +* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature +* allows an application to enqueue RTE_EVENT_OP_FORWARD or +* RTE_EVENT_OP_RELEASE in an order different than the order the +* events were dequeued from the event device, while maintaining +* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. +* +* Note that this flag only matters for Eventdevs supporting burst mode. +* +* @see rte_event_port_setup() +*/ /** Event port configuration structure */ struct rte_event_port_conf {
Signature · 1 line
2.25.1
Re: [PATCH v18 1/3] eventdev: add support for independent enqueue
Quoted 8 lines · Abdullah Sevincer
Support for independent enqueue feature and updates Event Device and PMD feature list.
A new capability
RTE_EVENT_DEV_CAP_INDEPENDENT_ENQis introduced. It allows out-of-order enqueuing ofRTE_EVENT_OP_FORWARDor RELEASE type events on an event port where this capability is enabled.
Quoted 6 lines
To use this capability applications need to set flag
RTE_EVENT_PORT_CFG_INDEPENDENT_ENQduring port setup only if the capabilityRTE_EVENT_DEV_CAP_INDEPENDENT_ENQexists.Signed-off-by Abdullah Sevincer <[email protected]>Acked-by Mattias Rönnblom <[email protected]>
Series applied to dpdk-next-net-eventdev/for-main. Thanks
Quoted 124 lines
--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/prog_guide/eventdev/eventdev.rst | 23 +++++++++++++++ doc/guides/rel_notes/release_24_11.rst | 8 ++++++ lib/eventdev/rte_eventdev.h | 31 +++++++++++++++++++++ 4 files changed, 63 insertions(+)doc/guides/eventdevs/features/default.ini +1
-0@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.doc/guides/prog_guide/eventdev/eventdev.rst +23
-0@@ -472,6 +472,29 @@ A flush callback can be passed to the function to handle any outstanding events. Invocation of this API does not affect the existing port configuration. +Independent Enqueue Capability +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This capability applies to eventdev devices that expects all forwarded events to be +enqueued in the same order as they are dequeued. For dropped events, their +releases should come at the same location as the original event was expected. +The eventdev device has this restriction as it uses the order to retrieve information about +the original event that was sent to the CPU. This contains information like atomic +flow ID to release the flow lock and ordered events sequence number to restore the +original order. + +This capability only matters to eventdevs supporting burst mode. On ports where +the application is going to change enqueue order, +``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` support should be enabled. + +Example code to inform PMD that the application plans to use independent enqueue +order on a port: + + .. code-block:: c + + if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) + port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; + Stopping the EventDev ~~~~~~~~~~~~~~~~~~~~~doc/guides/rel_notes/release_24_11.rst +8
-0@@ -67,6 +67,14 @@ New Features The new statistics are useful for debugging and profiling. +* **Updated Event Device Library for independent enqueue feature** + + * Added support for independent enqueue feature. With this feature Eventdev + supports enqueue in any order or specifically in a different order than + dequeue. The feature is intended for eventdevs supporting burst mode. + Applications should use ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable + the feature if the capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. + Removed Items -------------lib/eventdev/rte_eventdev.h +31
-1@@ -446,6 +446,25 @@ struct rte_event;* @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ (1ULL << 16) +/**< Event device is capable of independent enqueue. +* A new capability, RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, will indicate that Eventdev +* supports the enqueue in any order or specifically in a different order than the +* dequeue. Eventdev PMD can either dequeue events in the changed order in which +* they are enqueued or restore the original order before sending them to the +* underlying hardware device. A flag is provided during the port configuration to +* inform Eventdev PMD that the application intends to use an independent enqueue +* order on a particular port. Note that this capability only matters for eventdevs +* supporting burst mode. +* +* When an implicit release is enabled on a port, Eventdev PMD will also handle +* the insertion of RELEASE events in place of dropped events. The independent enqueue +* feature only applies to FORWARD and RELEASE events. New events (op=RTE_EVENT_OP_NEW) +* will be dequeued in the order the application enqueues them and do not maintain +* any order relative to FORWARD/RELEASE events. FORWARD vs NEW relaxed ordering +* only applies to ports that have enabled independent enqueue feature. +*/ +/* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0/**< Highest priority level for events and queues. @@ -1072,6 +1091,18 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* * @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) +/**< Flag to enable independent enqueue. Must not be set if the device +* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature +* allows an application to enqueue RTE_EVENT_OP_FORWARD or +* RTE_EVENT_OP_RELEASE in an order different than the order the +* events were dequeued from the event device, while maintaining +* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. +* +* Note that this flag only matters for Eventdevs supporting burst mode. +* +* @see rte_event_port_setup() +*/ /** Event port configuration structure */ struct rte_event_port_conf { --2.25.1
PATCH v18 2/3 event/dlb2: add support for independent enqueue
In reply to Abdullah SevincerDLB devices need events to be enqueued in the same order they are dequeued. Applications are not suppose to change event order between dequeue and to enqueue. Since Eventdev standard does not add such restrictions independent enqueue support is needed for DLB PMD so that it restores dequeue order on enqueue if applications happen to change it. It also adds missing releases in places where events are dropped by the application and it expects implicit release to handle it.
By default the feature will be off on all DLB ports and they will behave the same as older releases. To enable reordering feature, applications need to add the flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ to port configuration if only the device advertises the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ.
--- doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_11.rst | 2 + drivers/event/dlb2/dlb2.c | 490 ++++++++++++++++--------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 24 ++ 7 files changed, 387 insertions(+), 190 deletions(-)
doc/guides/eventdevs/features/dlb2.ini +1 -0
@@ -15,6 +15,7 @@ implicit_release_disable = Y runtime_port_link = Y multiple_queue_port = Y maintenance_free = Y +independent_enq = Y [Eth Rx adapter Features]
doc/guides/rel_notes/release_24_11.rst +2 -0
@@ -75,6 +75,8 @@ New Features Applications should use ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. + * Updated DLB2 driver for independent enqueue feature. + Removed Items -------------
drivers/event/dlb2/dlb2.c +320 -170
681 lines not on this page · raw message
drivers/event/dlb2/dlb2_avx512.c +14 -13
@@ -151,20 +151,20 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port,*/ #define DLB2_QE_EV_TYPE_WORD 0 sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[0 ].sub_event_type <<8 | - ev[0 ].event_type, + ev[0 ].sub_event_type <<4 | + ev[0 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[1 ].sub_event_type <<8 | - ev[1 ].event_type, + ev[1 ].sub_event_type <<4 | + ev[1 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[2 ].sub_event_type <<8 | - ev[2 ].event_type, + ev[2 ].sub_event_type <<4 | + ev[2 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[3 ].sub_event_type <<8 | - ev[3 ].event_type, + ev[3 ].sub_event_type <<4 | + ev[3 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 );if (qm_port->use_avx512) {
@@ -238,11 +238,11 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, }/* will only be set for DLB 2.5 + */ -if (qm_port->cq_weight) { - qe[0 ].weight = ev[0 ].impl_opaque &3 ; - qe[1 ].weight = ev[1 ].impl_opaque &3 ; - qe[2 ].weight = ev[2 ].impl_opaque &3 ; - qe[3 ].weight = ev[3 ].impl_opaque &3 ; +if (qm_port->dlb2->enable_cq_weight) { + qe[0 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[0 ]); + qe[1 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[1 ]); + qe[2 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[2 ]); + qe[3 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[3 ]); }break ;
@@ -267,6 +267,7 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, } qe[i].u.event_type.major = ev[i].event_type; qe[i].u.event_type.sub = ev[i].sub_event_type; + qe[i].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[i]); }break ;case 0 :
drivers/event/dlb2/dlb2_inline_fns.h +8 -0
@@ -32,4 +32,12 @@ dlb2_movdir64b(void *dest, void *src) : "a" (dest), "d" (src)); } +static inline void +dlb2_movdir64b_single (void *pp_addr,void *qe4) +{ + asmvolatile (".byte 0x66, 0x0f, 0x38, 0xf8, 0x02" + : + :"a" (pp_addr),"d" (qe4)); +} +#endif /* _DLB2_INLINE_FNS_H_ */
drivers/event/dlb2/dlb2_priv.h +18 -7
@@ -29,7 +29,8 @@#define DLB2_SW_CREDIT_C_QUANTA_DEFAULT 256/* Consumer */ #define DLB2_DEPTH_THRESH_DEFAULT 256#define DLB2_MIN_CQ_DEPTH_OVERRIDE 32 -#define DLB2_MAX_CQ_DEPTH_OVERRIDE 128 +#define DLB2_MAX_CQ_DEPTH_OVERRIDE 1024 +#define DLB2_MAX_CQ_DEPTH_REORDER 128#define DLB2_MIN_ENQ_DEPTH_OVERRIDE 32#define DLB2_MAX_ENQ_DEPTH_OVERRIDE 1024
@@ -387,8 +388,23 @@ struct dlb2_port {bool use_scalar;/* force usage of scalar code */ uint16_t hw_credit_quanta;bool use_avx512; -uint32_t cq_weight;bool is_producer;/* True if port is of type producer */ +uint8_t reorder_id;/* id used for reordering events coming back into the scheduler */ +bool reorder_en; +struct dlb2_reorder *order;/* For ordering enqueues */ +}; + +struct dlb2_reorder { +/* a reorder buffer for events coming back in different order from dequeue +* We use UINT8_MAX + 1 elements, but add on three no-ops to make movdirs easier at the end +*/ +union { +__m128i m128; +struct dlb2_enqueue_qe qe; +uint64_t u64[2 ]; + } enq_reorder[UINT8_MAX +4 ]; +/* id of the next entry in the reorder enqueue ring to send in */ +uint8_t next_to_enqueue; };/* Per-process per-port mmio and memory pointers */
@@ -642,10 +658,6 @@ struct dlb2_qid_depth_thresholds {int val[DLB2_MAX_NUM_QUEUES_ALL ]; }; -struct dlb2_cq_weight { -int limit[DLB2_MAX_NUM_PORTS_ALL ]; -}; -struct dlb2_port_cos {int cos_id[DLB2_MAX_NUM_PORTS_ALL ]; };
@@ -667,7 +679,6 @@ struct dlb2_devargs {bool vector_opts_enabled;int max_cq_depth;int max_enq_depth; -struct dlb2_cq_weight cq_weight;struct dlb2_port_cos port_cos;struct dlb2_cos_bw cos_bw;const char *producer_coremask;
drivers/event/dlb2/rte_pmd_dlb2.h +24 -0
@@ -19,6 +19,30 @@ extern "C" {#include <rte_compat.h> +/** +* Macro function to get QID depth of rte_event metadata. +* Currently lower 2 bits of 'rsvd' field are used to store QID depth. +*/ +#define RTE_PMD_DLB2_GET_QID_DEPTH (x) ((x)->rsvd & 0x3) + +/** +* Macro function to set QID depth of rte_event metadata. +* Currently lower 2 bits of 'rsvd' field are used to store QID depth. +*/ +#define RTE_PMD_DLB2_SET_QID_DEPTH (x, v) ((x)->rsvd = ((x)->rsvd & ~0x3) | (v & 0x3)) + +/** +* Macro function to get QE weight from rte_event metadata. +* Currently upper 2 bits of 'rsvd' field are used to store QE weight. +*/ +#define RTE_PMD_DLB2_GET_QE_WEIGHT (x) (((x)->rsvd >> 2) & 0x3) + +/** +* Macro function to set QE weight from rte_event metadata. +* Currently upper 2 bits of 'rsvd' field are used to store QE weight. +*/ +#define RTE_PMD_DLB2_SET_QE_WEIGHT (x, v) ((x)->rsvd = ((x)->rsvd & 0x3) | ((v & 0x3) << 2)) +/** * @warning * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
Signature · 1 line
2.25.1
PATCH v18 3/3 event/dsw: add capability for independent enqueue
In reply to Abdullah SevincerTo use independent enqueue capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists. Hence, this commit adds the capability of independent enqueue to the DSW driver.
--- doc/guides/eventdevs/features/dsw.ini | 1 + doc/guides/rel_notes/release_24_11.rst | 2 ++ drivers/event/dsw/dsw_evdev.c | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-)
doc/guides/eventdevs/features/dsw.ini +1 -0
@@ -11,6 +11,7 @@ burst_mode = Y nonseq_mode = Y multiple_queue_port = Y carry_flow_id = Y +independent_enq = Y [Eth Rx adapter Features] multi_eventq = Y
doc/guides/rel_notes/release_24_11.rst +2 -0
@@ -77,6 +77,8 @@ New Features * Updated DLB2 driver for independent enqueue feature. + * Updated DSW driver for independent enqueue feature. + Removed Items -------------
drivers/event/dsw/dsw_evdev.c +2 -1
@@ -230,7 +230,8 @@ dsw_info_get(struct rte_eventdev *dev __rte_unused,RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE |RTE_EVENT_DEV_CAP_NONSEQ_MODE |RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT | - RTE_EVENT_DEV_CAP_CARRY_FLOW_ID +RTE_EVENT_DEV_CAP_CARRY_FLOW_ID | + RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ }; }
Signature · 1 line
2.25.1
PATCH v14 2/3 event/dlb2: add support for independent enqueue
In reply to Abdullah SevincerDLB devices need events to be enqueued in the same order they are dequeued. Applications are not suppose to change event order between dequeue and to enqueue. Since Eventdev standard does not add such restrictions independent enqueue support is needed for DLB PMD so that it restores dequeue order on enqueue if applications happen to change it. It also adds missing releases in places where events are dropped by the application and it expects implicit release to handle it.
By default the feature will be off on all DLB ports and they will behave the same as older releases. To enable reordering feature, applications need to add the flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ to port configuration if only the device advertises the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ.
--- doc/guides/prog_guide/eventdev/eventdev.rst | 33 ++ doc/guides/rel_notes/release_24_11.rst | 5 + drivers/event/dlb2/dlb2.c | 490 +++++++++++++------- drivers/event/dlb2/dlb2_avx512.c | 27 +- drivers/event/dlb2/dlb2_inline_fns.h | 8 + drivers/event/dlb2/dlb2_priv.h | 25 +- drivers/event/dlb2/rte_pmd_dlb2.h | 24 + 7 files changed, 422 insertions(+), 190 deletions(-)
doc/guides/prog_guide/eventdev/eventdev.rst +33 -0
@@ -472,6 +472,39 @@ A flush callback can be passed to the function to handle any outstanding events. Invocation of this API does not affect the existing port configuration. +Independent Enqueue Capability +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Some eventdev hardware devices such as DLB2 expects all forwarded events to be +enqueued in the same order as they are dequeued. For dropped events, their +releases should come at the same location as the original event was expected. +Hardware has this restriction as it uses the order to retrieve information about +the original event that was sent to the CPU. This contains information like atomic +flow ID to release the flow lock and ordered events sequence number to restore the +original order. + +Some applications, like those based on the DPDK dispatcher library, want +enqueue order independence. To support this, DLB2 PMD supports the +``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` capability. + +This capability applies to Eventdevs supporting burst mode. On ports where +the application is going to change enqueue order, +``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` support should be enabled. + +Example code to inform PMD that the application plans to use independent enqueue +order on a port: + + .. code-block:: c + + if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) + port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; + +This code example enables enqueue event reordering inside DLB2 PMD before the events +are sent to the DLB2 hardware. If the application is not going to change the enqueue +order, this flag should not be enabled to get better performance. DLB2 PMD saves +ordering information inside the impl_opaque field of the event, and this field should +be preserved for all FORWARD or RELEASE events. + Stopping the EventDev ~~~~~~~~~~~~~~~~~~~~~
doc/guides/rel_notes/release_24_11.rst +5 -0
@@ -72,6 +72,11 @@ New Features * Added support for independent enqueue feature. Updated Event Device and PMD feature list. + * Updated DLB2 driver for independent enqueue feature. Applications should + use ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the + capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. + + Removed Items -------------
drivers/event/dlb2/dlb2.c +320 -170
681 lines not on this page · raw message
drivers/event/dlb2/dlb2_avx512.c +14 -13
@@ -151,20 +151,20 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port,*/ #define DLB2_QE_EV_TYPE_WORD 0 sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[0 ].sub_event_type <<8 | - ev[0 ].event_type, + ev[0 ].sub_event_type <<4 | + ev[0 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[0 ] =_mm_insert_epi16 (sse_qe[0 ], - ev[1 ].sub_event_type <<8 | - ev[1 ].event_type, + ev[1 ].sub_event_type <<4 | + ev[1 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[2 ].sub_event_type <<8 | - ev[2 ].event_type, + ev[2 ].sub_event_type <<4 | + ev[2 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD ); sse_qe[1 ] =_mm_insert_epi16 (sse_qe[1 ], - ev[3 ].sub_event_type <<8 | - ev[3 ].event_type, + ev[3 ].sub_event_type <<4 | + ev[3 ].event_type <<12 ,DLB2_QE_EV_TYPE_WORD +4 );if (qm_port->use_avx512) {
@@ -238,11 +238,11 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, }/* will only be set for DLB 2.5 + */ -if (qm_port->cq_weight) { - qe[0 ].weight = ev[0 ].impl_opaque &3 ; - qe[1 ].weight = ev[1 ].impl_opaque &3 ; - qe[2 ].weight = ev[2 ].impl_opaque &3 ; - qe[3 ].weight = ev[3 ].impl_opaque &3 ; +if (qm_port->dlb2->enable_cq_weight) { + qe[0 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[0 ]); + qe[1 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[1 ]); + qe[2 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[2 ]); + qe[3 ].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[3 ]); }break ;
@@ -267,6 +267,7 @@ dlb2_event_build_hcws(struct dlb2_port *qm_port, } qe[i].u.event_type.major = ev[i].event_type; qe[i].u.event_type.sub = ev[i].sub_event_type; + qe[i].weight =RTE_PMD_DLB2_GET_QE_WEIGHT (&ev[i]); }break ;case 0 :
drivers/event/dlb2/dlb2_inline_fns.h +8 -0
@@ -32,4 +32,12 @@ dlb2_movdir64b(void *dest, void *src) : "a" (dest), "d" (src)); } +static inline void +dlb2_movdir64b_single (void *pp_addr,void *qe4) +{ + asmvolatile (".byte 0x66, 0x0f, 0x38, 0xf8, 0x02" + : + :"a" (pp_addr),"d" (qe4)); +} +#endif /* _DLB2_INLINE_FNS_H_ */
drivers/event/dlb2/dlb2_priv.h +18 -7
@@ -29,7 +29,8 @@#define DLB2_SW_CREDIT_C_QUANTA_DEFAULT 256/* Consumer */ #define DLB2_DEPTH_THRESH_DEFAULT 256#define DLB2_MIN_CQ_DEPTH_OVERRIDE 32 -#define DLB2_MAX_CQ_DEPTH_OVERRIDE 128 +#define DLB2_MAX_CQ_DEPTH_OVERRIDE 1024 +#define DLB2_MAX_CQ_DEPTH_REORDER 128#define DLB2_MIN_ENQ_DEPTH_OVERRIDE 32#define DLB2_MAX_ENQ_DEPTH_OVERRIDE 1024
@@ -387,8 +388,23 @@ struct dlb2_port {bool use_scalar;/* force usage of scalar code */ uint16_t hw_credit_quanta;bool use_avx512; -uint32_t cq_weight;bool is_producer;/* True if port is of type producer */ +uint8_t reorder_id;/* id used for reordering events coming back into the scheduler */ +bool reorder_en; +struct dlb2_reorder *order;/* For ordering enqueues */ +}; + +struct dlb2_reorder { +/* a reorder buffer for events coming back in different order from dequeue +* We use UINT8_MAX + 1 elements, but add on three no-ops to make movdirs easier at the end +*/ +union { +__m128i m128; +struct dlb2_enqueue_qe qe; +uint64_t u64[2 ]; + } enq_reorder[UINT8_MAX +4 ]; +/* id of the next entry in the reorder enqueue ring to send in */ +uint8_t next_to_enqueue; };/* Per-process per-port mmio and memory pointers */
@@ -642,10 +658,6 @@ struct dlb2_qid_depth_thresholds {int val[DLB2_MAX_NUM_QUEUES_ALL ]; }; -struct dlb2_cq_weight { -int limit[DLB2_MAX_NUM_PORTS_ALL ]; -}; -struct dlb2_port_cos {int cos_id[DLB2_MAX_NUM_PORTS_ALL ]; };
@@ -667,7 +679,6 @@ struct dlb2_devargs {bool vector_opts_enabled;int max_cq_depth;int max_enq_depth; -struct dlb2_cq_weight cq_weight;struct dlb2_port_cos port_cos;struct dlb2_cos_bw cos_bw;const char *producer_coremask;
drivers/event/dlb2/rte_pmd_dlb2.h +24 -0
@@ -19,6 +19,30 @@ extern "C" {#include <rte_compat.h> +/** +* Macro function to get QID depth of rte_event metadata. +* Currently lower 2 bits of 'rsvd' field are used to store QID depth. +*/ +#define RTE_PMD_DLB2_GET_QID_DEPTH (x) ((x)->rsvd & 0x3) + +/** +* Macro function to set QID depth of rte_event metadata. +* Currently lower 2 bits of 'rsvd' field are used to store QID depth. +*/ +#define RTE_PMD_DLB2_SET_QID_DEPTH (x, v) ((x)->rsvd = ((x)->rsvd & ~0x3) | (v & 0x3)) + +/** +* Macro function to get QE weight from rte_event metadata. +* Currently upper 2 bits of 'rsvd' field are used to store QE weight. +*/ +#define RTE_PMD_DLB2_GET_QE_WEIGHT (x) (((x)->rsvd >> 2) & 0x3) + +/** +* Macro function to set QE weight from rte_event metadata. +* Currently upper 2 bits of 'rsvd' field are used to store QE weight. +*/ +#define RTE_PMD_DLB2_SET_QE_WEIGHT (x, v) ((x)->rsvd = ((x)->rsvd & 0x3) | ((v & 0x3) << 2)) +/** * @warning * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
Signature · 1 line
2.25.1
PATCH v14 3/3 event/dsw: add capability for independent enqueue
In reply to Abdullah SevincerTo use independent enqueue capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists. Hence, this commit adds the capability of independent enqueue to the DSW driver.
--- doc/guides/rel_notes/release_24_11.rst | 1 + drivers/event/dsw/dsw_evdev.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
doc/guides/rel_notes/release_24_11.rst +1 -0
@@ -76,6 +76,7 @@ New Features use ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. + * Updated DSW driver for independent enqueue feature. Removed Items
drivers/event/dsw/dsw_evdev.c +2 -1
@@ -230,7 +230,8 @@ dsw_info_get(struct rte_eventdev *dev __rte_unused,RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE |RTE_EVENT_DEV_CAP_NONSEQ_MODE |RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT | - RTE_EVENT_DEV_CAP_CARRY_FLOW_ID +RTE_EVENT_DEV_CAP_CARRY_FLOW_ID | + RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ }; }
Signature · 1 line
2.25.1
PATCH v12 3/3 event/dsw: add capability for independent enqueue
In reply to Abdullah SevincerTo use independent enqueue capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists. Hence, this commit adds the capability of independent enqueue to the DSW driver.
--- doc/guides/rel_notes/release_24_11.rst | 4 ++++ drivers/event/dsw/dsw_evdev.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-)
doc/guides/rel_notes/release_24_11.rst +4 -0
@@ -66,6 +66,10 @@ New Features ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. +* **Updated DSW Driver for independent enqueue feature** + + * Added capability flag for DSW to advertise independent enqueue feature. + Removed Items -------------
drivers/event/dsw/dsw_evdev.c +2 -1
@@ -230,7 +230,8 @@ dsw_info_get(struct rte_eventdev *dev __rte_unused,RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE |RTE_EVENT_DEV_CAP_NONSEQ_MODE |RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT | - RTE_EVENT_DEV_CAP_CARRY_FLOW_ID +RTE_EVENT_DEV_CAP_CARRY_FLOW_ID | + RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ }; }
Signature · 1 line
2.25.1
Re: [PATCH v12 3/3] event/dsw: add capability for independent enqueue
Quoted 18 lines · Abdullah Sevincer
To use independent enqueue capability applications need to set flag
RTE_EVENT_PORT_CFG_INDEPENDENT_ENQduring port setup only if the capabilityRTE_EVENT_DEV_CAP_INDEPENDENT_ENQexists. Hence, this commit adds the capability of independent enqueue to the DSW driver.Signed-off-by Abdullah Sevincer <[email protected]>Acked-by Mattias Rönnblom <[email protected]>--- doc/guides/rel_notes/release_24_11.rst | 4 ++++ drivers/event/dsw/dsw_evdev.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-)doc/guides/rel_notes/release_24_11.rst +0
-0
doc/guides/rel_notes/release_24_11.rst New Features · line 71
Quoted 6 lines
doc/guides/rel_notes/release_24_11.rst +3
-0@@ -66,6 +66,10 @@ New Features ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. +* **Updated DSW Driver for independent enqueue feature** + + * Added capability flag for DSW to advertise independent enqueue feature.
Same documenation comment as 2/3 patch.
Quoted 21 lines
doc/guides/rel_notes/release_24_11.rst +1
-0+ Removed Items -------------drivers/event/dsw/dsw_evdev.c +2
-2@@ -230,7 +230,8 @@ dsw_info_get(struct rte_eventdev *dev __rte_unused,RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE |RTE_EVENT_DEV_CAP_NONSEQ_MODE |RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT | -RTE_EVENT_DEV_CAP_CARRY_FLOW_ID +RTE_EVENT_DEV_CAP_CARRY_FLOW_ID | + RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ }; } --2.25.1
PATCH v10 2/3 eventdev: add support for independent enqueue
In reply to Abdullah SevincerThis commit adds support for independent enqueue feature and updates Event Device and PMD feature list.
A new capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ is introduced. It allows out-of-order enqueuing of RTE_EVENT_OP_FORWARD or RELEASE type events on an event port where this capability is enabled.
To use this capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists.
--- doc/guides/eventdevs/features/default.ini | 1 + doc/guides/eventdevs/features/dlb2.ini | 1 + doc/guides/rel_notes/release_24_11.rst | 5 +++ lib/eventdev/rte_eventdev.h | 37 +++++++++++++++++++++++ 4 files changed, 44 insertions(+)
doc/guides/eventdevs/features/default.ini +1 -0
@@ -22,6 +22,7 @@ carry_flow_id = maintenance_free = runtime_queue_attr = profile_links = +independent_enq = ; ; Features of a default Ethernet Rx adapter.
doc/guides/eventdevs/features/dlb2.ini +1 -0
@@ -15,6 +15,7 @@ implicit_release_disable = Y runtime_port_link = Y multiple_queue_port = Y maintenance_free = Y +independent_enq = Y [Eth Rx adapter Features]
doc/guides/rel_notes/release_24_11.rst +5 -0
@@ -30,6 +30,11 @@ New Features ``RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ`` to enable the feature if the capability ``RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ`` exists. +* **Updated Event Device Library for independent enqueue feature** + + * Added support for independent enqueue feature. Updated Event Device and + PMD feature list. + Removed Items -------------
lib/eventdev/rte_eventdev.h +37 -0
@@ -446,6 +446,31 @@ struct rte_event;* @see RTE_SCHED_TYPE_PARALLEL */ +#define RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ (1ULL << 16) +/**< Event device is capable of independent enqueue. +* A new capability, RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ, will indicate that Eventdev +* supports the enqueue in any order or specifically in a different order than the +* dequeue. Eventdev PMD can either transmit events in the changed order in which +* they are enqueued or restore the original order before sending them to the +* underlying hardware device. A flag is provided during the port configuration to +* inform Eventdev PMD that the application intends to use an independent enqueue +* order on a particular port. Note that this capability only matters for Eventdevs +* supporting burst mode. +* +* To Inform PMD that the application plans to use independent enqueue order on a port +* this code example can be used: +* +* if (capability & RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ) +* port_config = port_config | RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ; +* +* When an implicit release is enabled on a port, Eventdev PMD will also handle +* the insertion of RELEASE events in place of dropped events. The independent enqueue +* feature only applies to FORWARD and RELEASE events. New events (op=RTE_EVENT_OP_NEW) +* will be transmitted in the order the application enqueues them and do not maintain +* any order relative to FORWARD/RELEASE events. FORWARD vs NEW relaxed ordering +* only applies to ports that have enabled independent enqueue feature. +*/ +/* Event device priority levels */ #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0/**< Highest priority level for events and queues.
@@ -1072,6 +1097,18 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* * @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) +/**< Flag to enable independent enqueue. Must not be set if the device +* is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature +* allows an application to enqueue RTE_EVENT_OP_FORWARD or +* RTE_EVENT_OP_RELEASE in an order different than the order the +* events were dequeued from the event device, while maintaining +* RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. +* +* Note that this flag only matters for Eventdevs supporting burst mode. +* +* @see rte_event_port_setup() +*/ /** Event port configuration structure */ struct rte_event_port_conf {
Signature · 1 line
2.25.1
PATCH v10 3/3 event/dsw: add capability for independent enqueue
In reply to Abdullah SevincerTo use independent enqueue capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists. Hence, this commit adds the capability of independent enqueue to the DSW driver.
--- doc/guides/rel_notes/release_24_11.rst | 4 ++++ drivers/event/dsw/dsw_evdev.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-)
doc/guides/rel_notes/release_24_11.rst +4 -0
@@ -35,6 +35,10 @@ New Features * Added support for independent enqueue feature. Updated Event Device and PMD feature list. +* **Updated DSW Driver for independent enqueue feature** + + * Added capability flag for DSW to advertise independent enqueue feature. + Removed Items -------------
drivers/event/dsw/dsw_evdev.c +2 -1
@@ -230,7 +230,8 @@ dsw_info_get(struct rte_eventdev *dev __rte_unused,RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE |RTE_EVENT_DEV_CAP_NONSEQ_MODE |RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT | - RTE_EVENT_DEV_CAP_CARRY_FLOW_ID +RTE_EVENT_DEV_CAP_CARRY_FLOW_ID | + RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ }; }
Signature · 1 line
2.25.1
PATCH v8 3/3 event/dsw: add capability for independent enqueue
In reply to Abdullah SevincerTo use independent enqueue capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists. Hence, this commit adds the capability of independent enqueue to the DSW driver.
--- doc/guides/rel_notes/release_24_11.rst | 4 ++++ drivers/event/dsw/dsw_evdev.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-)
doc/guides/rel_notes/release_24_11.rst +4 -0
@@ -35,6 +35,10 @@ New Features * Added support for independent enqueue feature. Updated Event Device and PMD feature list. +* **Updated DSW Driver for independent enqueue feature** + + * Added capability flag for DSW to advertise independent enqueue feature. + Removed Items -------------
drivers/event/dsw/dsw_evdev.c +2 -1
@@ -230,7 +230,8 @@ dsw_info_get(struct rte_eventdev *dev __rte_unused,RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE |RTE_EVENT_DEV_CAP_NONSEQ_MODE |RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT | - RTE_EVENT_DEV_CAP_CARRY_FLOW_ID +RTE_EVENT_DEV_CAP_CARRY_FLOW_ID | + RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ }; }
Signature · 1 line
2.25.1
Re: [PATCH v8 3/3] event/dsw: add capability for independent enqueue
Quoted 31 lines · Abdullah Sevincer
To use independent enqueue capability applications need to set flag
RTE_EVENT_PORT_CFG_INDEPENDENT_ENQduring port setup only if the capabilityRTE_EVENT_DEV_CAP_INDEPENDENT_ENQexists. Hence, this commit adds the capability of independent enqueue to the DSW driver.Signed-off-by Abdullah Sevincer <[email protected]>--- doc/guides/rel_notes/release_24_11.rst | 4 ++++ drivers/event/dsw/dsw_evdev.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-)doc/guides/rel_notes/release_24_11.rst +4
-0@@ -35,6 +35,10 @@ New Features * Added support for independent enqueue feature. Updated Event Device and PMD feature list. +* **Updated DSW Driver for independent enqueue feature** + + * Added capability flag for DSW to advertise independent enqueue feature. + Removed Items -------------drivers/event/dsw/dsw_evdev.c +0
-0
drivers/event/dsw/dsw_evdev.c dsw_info_get(struct rte_eventdev *dev __rte_unused, · line 237
Quoted 9 lines
drivers/event/dsw/dsw_evdev.c +2
-1@@ -230,7 +230,8 @@ dsw_info_get(struct rte_eventdev *dev __rte_unused,RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE |RTE_EVENT_DEV_CAP_NONSEQ_MODE |RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT | - RTE_EVENT_DEV_CAP_CARRY_FLOW_ID +RTE_EVENT_DEV_CAP_CARRY_FLOW_ID | + RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ }; }
PATCH v6 3/3 event/dsw: add capability for independent enqueue
In reply to Abdullah SevincerTo use independent enqueue capability applications need to set flag RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ during port setup only if the capability RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ exists. Hence, this commit adds the capability of independent enqueue to the DSW driver.
--- doc/guides/rel_notes/release_24_07.rst | 4 ++++ drivers/event/dsw/dsw_evdev.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-)
doc/guides/rel_notes/release_24_07.rst +4 -0
@@ -167,6 +167,10 @@ New Features * Added support for independent enqueue feature. Updated Event Device and PMD feature list. +* **Updated DSW Driver for independent enqueue feature** + + * Added capability flag for DSW to advertise independent enqueue feature. + Removed Items -------------
drivers/event/dsw/dsw_evdev.c +2 -1
@@ -230,7 +230,8 @@ dsw_info_get(struct rte_eventdev *dev __rte_unused,RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE |RTE_EVENT_DEV_CAP_NONSEQ_MODE |RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT | - RTE_EVENT_DEV_CAP_CARRY_FLOW_ID +RTE_EVENT_DEV_CAP_CARRY_FLOW_ID | + RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ }; }
Signature · 1 line
2.25.1
Re: [PATCH v6 3/3] event/dsw: add capability for independent enqueue
Quoted 31 lines · Abdullah Sevincer
To use independent enqueue capability applications need to set flag
RTE_EVENT_PORT_CFG_INDEPENDENT_ENQduring port setup only if the capabilityRTE_EVENT_DEV_CAP_INDEPENDENT_ENQexists. Hence, this commit adds the capability of independent enqueue to the DSW driver.Signed-off-by Abdullah Sevincer <[email protected]>--- doc/guides/rel_notes/release_24_07.rst | 4 ++++ drivers/event/dsw/dsw_evdev.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-)doc/guides/rel_notes/release_24_07.rst +4
-0@@ -167,6 +167,10 @@ New Features * Added support for independent enqueue feature. Updated Event Device and PMD feature list. +* **Updated DSW Driver for independent enqueue feature** + + * Added capability flag for DSW to advertise independent enqueue feature. + Removed Items -------------drivers/event/dsw/dsw_evdev.c +0
-0
drivers/event/dsw/dsw_evdev.c dsw_info_get(struct rte_eventdev *dev __rte_unused, · line 237
Quoted 9 lines
drivers/event/dsw/dsw_evdev.c +2
-1@@ -230,7 +230,8 @@ dsw_info_get(struct rte_eventdev *dev __rte_unused,RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE |RTE_EVENT_DEV_CAP_NONSEQ_MODE |RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT | - RTE_EVENT_DEV_CAP_CARRY_FLOW_ID +RTE_EVENT_DEV_CAP_CARRY_FLOW_ID | + RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ }; }
Thanks!
PATCH 2/2 eventdev: add support for enqueue reorder
In reply to Abdullah SevincerThis commit adds support flag to enable enqueue reorder feature.
When this flag is enabled in the port configuration PMD restores dequeue order on enqueue if applications happen to change it.
--- lib/eventdev/rte_eventdev.h | 8 ++++++++ 1 file changed, 8 insertions(+)
lib/eventdev/rte_eventdev.h +8 -0
@@ -1073,6 +1073,14 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,* @see rte_event_port_setup() */ +#define RTE_EVENT_PORT_CFG_RESTORE_DEQ_ORDER (1ULL << 5) +/**< Flag to enable feature enqueue reordering to dequeue. +* The feature restores dequeue order on enqueue if applications +* happen to change the order. +* +* @see rte_event_port_setup() +*/ +/** Event port configuration structure */ struct rte_event_port_conf {int32_t new_event_threshold;
Signature · 1 line
2.25.1