Skip to contentSkip to conversation

event/dlb2: enhancement to DLB credit management

PATCH In review Pravin Pathak 2 participants 2 messages Feb 25, 2025 – Mar 27, 2025 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 event/dlb2: enhancement to DLB credit management

Updates are added to enable releasing of unused credits by threads to avoid deadlock and starving of other active threads needing credits. It also adds compile time options to enable/disable credit checks.

---
 .mailmap                       |   1 +
 doc/guides/eventdevs/dlb2.rst  |  19 ++
 drivers/event/dlb2/dlb2.c      | 316 +++++++++++++++++++++++++++------
 drivers/event/dlb2/dlb2_priv.h |   4 +-
 drivers/event/dlb2/meson.build |  15 ++
 5 files changed, 298 insertions(+), 57 deletions(-)
.mailmap +1 -0
index a03d3cfb59..9688941c92 100644
@@ -1556,6 +1556,7 @@ Tim Shearer <[email protected]>
 Ting-Kai Ku <[email protected]>
 Ting Xu <[email protected]>
 Tingting Liao <[email protected]>
+Tirthendu Sarkar <[email protected]>
 Tiwei Bie <[email protected]> <[email protected]>
 Todd Fujinaka <[email protected]>
 Tomáš Ďurovec <[email protected]>
doc/guides/eventdevs/dlb2.rst +19 -0
index 2532d92888..0ac3027f93 100644
@@ -456,6 +456,25 @@ Example command to enable QE Weight feature:
 
        --allow ea:00.0,enable_cq_weight=<y/Y>
 
+Credit Handling Scenario Improvements
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+It is possible for ports to hold on to unused credits and not release them
+due to insufficient accumulation (i.e. less than 2 * credit quanta). This
+can result in credit deadlocks situation. DLB2 PMD makes worker ports to
+release all accumulated credits when back-to-back zero poll count reaches
+a preset threshold and makes producer ports release all the accumulated
+credits if enqueue fails for a consecutive number of retries.
+
+New meson options are provided through c_args for enabling and disabling
+credits handling option flags. Credit checks are enabled by default.
+
+Example command to use as meson option for credit handling:
+
+    .. code-block:: console
+
+       meson configure -Dc_args='-DDLB_SW_CREDITS_CHECKS=0 -DDLB_HW_CREDITS_CHECKS=1'
+
 Running Eventdev Applications with DLB Device
 ---------------------------------------------
 
drivers/event/dlb2/dlb2.c +261 -55

522 lines not on this page · raw message

drivers/event/dlb2/dlb2_priv.h +2 -2
index 52da31ed31..4dd7532519 100644
@@ -76,8 +76,7 @@
 #define DLB2_MAX_NUM_FLOWS (64 * 1024)
 #define DLB2_MAX_NUM_LDB_CREDITS (8 * 1024)
 #define DLB2_MAX_NUM_DIR_CREDITS(ver)		(ver == DLB2_HW_V2 ? 4096 : 0)
-#define DLB2_MAX_NUM_CREDITS(ver)		(ver == DLB2_HW_V2 ? \
-						 0 : DLB2_MAX_NUM_LDB_CREDITS)
+#define DLB2_MAX_NUM_CREDITS(ver)		(ver == DLB2_HW_V2 ? 0 : 16384)
 #define DLB2_MAX_NUM_LDB_CREDIT_POOLS 64
 #define DLB2_MAX_NUM_DIR_CREDIT_POOLS 64
 #define DLB2_MAX_NUM_HIST_LIST_ENTRIES 2048
@@ -537,6 +536,7 @@ struct __rte_cache_aligned dlb2_eventdev_port {
 	struct rte_event_port_conf conf; /* user-supplied configuration */
 	uint16_t inflight_credits; /* num credits this port has right now */
 	uint16_t credit_update_quanta;
+	uint32_t credit_return_count; /* count till the credit return condition is true */
 	struct dlb2_eventdev *dlb2; /* backlink optimization */
 	alignas(RTE_CACHE_LINE_SIZE) struct dlb2_port_stats stats;
 	struct dlb2_event_queue_link link[DLB2_MAX_NUM_QIDS_PER_LDB_CQ];
drivers/event/dlb2/meson.build +15 -0
index c024edb311..177ae15250 100644
@@ -40,3 +40,18 @@ endif
 headers = files('rte_pmd_dlb2.h')
 
 deps += ['mbuf', 'mempool', 'ring', 'pci', 'bus_pci']
+
+dlb_pmd_defines = ['-DDLB2_BYPASS_FENCE_ON_PP', '-DDLB_HW_CREDITS_CHECKS', '-DDLB_SW_CREDITS_CHECKS', '-DDLB_TYPE_CHECK']
+dlb_pmd_default = ['0','1','1','1']
+
+c_args=get_option('c_args')
+index = 0
+foreach opt: dlb_pmd_defines
+    opt_true = opt + '=1'
+    opt_false = opt + '=0'
+    if not (c_args.contains(opt_true) or c_args.contains(opt_false))
+        cflags += opt + '=' + dlb_pmd_default[index]
+    endif
+
+    index += 1
+endforeach
Signature · 1 line
2.43.5
#1 lore raw
Quoted 21 lines

-----Original Message-----
From: Pravin Pathak <[email protected]>
Sent: Wednesday, February 26, 2025 2:47 AM
To: [email protected]
Cc: Jerin Jacob <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Pravin Pathak <[email protected]>
Subject: [EXTERNAL] [PATCH v1] event/dlb2: enhancement to DLB credit management

Updates are added to enable releasing of unused credits by threads to avoid deadlock and starving of other active threads needing credits. It also adds compile time options to enable/disable credit checks. Signed-off-by: Pravin Pathak <pravin. pathak@ intel. com>
Updates are added to enable releasing of unused credits by threads to avoid deadlock and starving of other active threads needing credits. It also adds compile time options to enable/disable credit checks.

Quoted 2 lines

Updated the git commit as follows and applied to dpdk-next-net-eventdev/for-main. Thanks

event/dlb2: enhance DLB credit management