Skip to contentSkip to conversation

event/dlb2: revise QE Weight Feature

PATCH In review Abdullah Sevincer 2 participants 2 messages Jun 27, 2023 – Aug 8, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 event/dlb2: revise QE Weight Feature

Revise QE weight feature to enable from command line just passing a flag. If QE weight feature is enabled simply port cq weight will be same as dequeue depth.

Also, update DLB documentation for revised QE weight feature and usage of eventdev application with DLB hardware.

---
 doc/guides/eventdevs/dlb2.rst  | 107 ++++++++++++++++++++------
 drivers/event/dlb2/dlb2.c      | 132 +++++++++++----------------------
 drivers/event/dlb2/dlb2_priv.h |   4 +-
 3 files changed, 131 insertions(+), 112 deletions(-)
doc/guides/eventdevs/dlb2.rst +85 -22
index f5bf5757c6..c84d153a56 100644
@@ -17,8 +17,8 @@ Configuration
 -------------
 
 The DLB PF PMD is a user-space PMD that uses VFIO to gain direct
-device access. To use this operation mode, the PCIe PF device must be bound
-to a DPDK-compatible VFIO driver, such as vfio-pci.
+device access. To use this operation mode, the PCIe PF device must
+be bound to a DPDK-compatible VFIO driver, such as vfio-pci.
 
 Eventdev API Notes
 ------------------
@@ -395,26 +395,6 @@ The depth must be between 32 and 1024, and must be a power of 2.
 
        --allow ea:00.0,max_enqueue_depth=<depth>
 
-QE Weight
-~~~~~~~~~
-
-DLB supports advanced scheduling mechanisms, such as CQ weight.
-Each load balanced CQ has a configurable work capacity (max 256)
-which corresponds to the total QE weight DLB will allow to be enqueued
-to that consumer. Every load balanced event/QE carries a weight of 0, 2, 4,
-or 8 and DLB will increment a (per CQ) load indicator when it schedules a
-QE to that CQ. The weight is also stored in the history list. When a
-completion arrives, the weight is popped from the history list and used to
-decrement the load indicator. This creates a new scheduling condition - a CQ
-whose load is equal to or in excess of capacity is not available for traffic.
-Note that the weight may not exceed the maximum CQ depth.
-
-    .. code-block:: console
-
-       --allow ea:00.0,cq_weight=all:<weight>
-       --allow ea:00.0,cq_weight=qidA-qidB:<weight>
-       --allow ea:00.0,cq_weight=qid:<weight>
-
 Producer Coremask
 ~~~~~~~~~~~~~~~~~
 
@@ -450,3 +430,86 @@ won't be used.
     .. code-block:: console
 
        --allow ea:00.0,default_port_allocation=<y/Y>
+
+QE Weight
+~~~~~~~~~
+
+DLB supports advanced scheduling mechanisms, such as CQ weight.
+Each load balanced CQ has a configurable work capacity (max 256)
+which corresponds to the total QE weight DLB will allow to be enqueued
+to that consumer. Every load balanced event/QE carries a weight of 0, 2, 4,
+or 8 and DLB will increment a (per CQ) load indicator when it schedules a
+QE to that CQ. The weight is also stored in the history list. When a
+completion arrives, the weight is popped from the history list and used to
+decrement the load indicator. This creates a new scheduling condition - a CQ
+whose load is equal to or in excess of capacity is not available for traffic.
+Note that the weight may not exceed the maximum CQ depth.
+
+Example command to enable QE Weight feature:
+
+    .. code-block:: console
+
+       --allow ea:00.0,enable_cq_weight=<y/Y>
+
+Running Eventdev Applications with DLB Device
+---------------------------------------------
+This section explains how to run eventdev applications
+with DLB hardware as well as difference in command line parameter
+to switch between a DLB hardware and a virtual eventdev device such as SW0, hence
+users can run applications with or without DLB device to compare performance of
+a DLB device.
+
+In order to run eventdev applications, DLB device must be bound
+to a DPDK-compatible VFIO driver, such as vfio-pci.
+
+Example command to bind DLB device to vfio-pci driver:
+
+    .. code-block:: console
+
+       ../usertools/dpdk-devbind.py -b vfio-pci ea:00.0
+
+Eventdev applications can be run with or without a DLB device.
+Below examples give details of running eventdev application without DLB device
+and with DLB device. Notice that the primary difference between two examples are
+passing the parameter ``--vdev <driver><id>``. The first example run uses a virtual
+eventdev device SW0 while second example run directly and picks DLB device from
+VFIO driver.
+
+Example command to run eventdev application without a DLB device:
+
+	.. code-block:: console
+
+	   sudo <build_dir>/app/dpdk-test-eventdev --vdev=event_sw0 -- \
+					--test=order_queue --plcores 1 --wlcores 2,3
+
+After binding DLB device to a supported pci driver such as vfio-pci,
+eventdev applications can be run on the DLB device.
+
+Example command to run eventdev application with a DLB device:
+
+	.. code-block:: console
+
+		sudo build/app/dpdk-test-eventdev -- --test=order_queue\
+			--plcores=1 --wlcores=2-7 --stlist=o --worker_deq_depth=128\
+			--prod_enq_burst_sz=64 --nb_flows=64 --nb_pkts=1000000
+
+A particular DLB device can also be picked from command line by passing
+	``--a`` or  ``--allow`` option:
+
+	.. code-block:: console
+
+		sudo build/app/dpdk-test-eventdev --allow ea:00.0 -- --test=order_queue\
+			--plcores=1 --wlcores=2-7 --stlist=o --worker_deq_depth=128\
+			--prod_enq_burst_sz=64 --nb_flows=64 --nb_pkts=1000000
+
+Debugging options
+~~~~~~~~~~~~~~~~~
+
+To specify log level for a DLB device use ``--log-level=dlb,8``.
+Example command to run eventdev application with a DLB device log level enabled:
+
+	.. code-block:: console
+
+		sudo build/app/dpdk-test-eventdev --allow ea:00.0 --log-level=dlb,8 -- --test=order_queue\
+			--plcores=1 --wlcores=2-7 --stlist=o --worker_deq_depth=128\
+			--prod_enq_burst_sz=64 --nb_flows=64 --nb_pkts=1000000
\ No newline at end of file
drivers/event/dlb2/dlb2.c +43 -89

194 lines not on this page · raw message

drivers/event/dlb2/dlb2_priv.h +3 -1
index f4b9e7f9ff..31a3beeb6c 100644
@@ -47,11 +47,11 @@
 #define DLB2_VECTOR_OPTS_ENAB_ARG "vector_opts_enable"
 #define DLB2_MAX_CQ_DEPTH "max_cq_depth"
 #define DLB2_MAX_ENQ_DEPTH "max_enqueue_depth"
-#define DLB2_CQ_WEIGHT "cq_weight"
 #define DLB2_PORT_COS "port_cos"
 #define DLB2_COS_BW "cos_bw"
 #define DLB2_PRODUCER_COREMASK "producer_coremask"
 #define DLB2_DEFAULT_LDB_PORT_ALLOCATION_ARG "default_port_allocation"
+#define DLB2_ENABLE_CQ_WEIGHT_ARG "enable_cq_weight"
 
 /* Begin HW related defines and structs */
 
@@ -637,6 +637,7 @@ struct dlb2_eventdev {
 	uint32_t cos_ports[DLB2_COS_NUM_VALS]; /* total ldb ports in each class */
 	uint32_t cos_bw[DLB2_COS_NUM_VALS]; /* bandwidth per cos domain */
 	uint8_t max_cos_port; /* Max LDB port from any cos */
+	bool enable_cq_weight;
 };
 
 /* used for collecting and passing around the dev args */
@@ -674,6 +675,7 @@ struct dlb2_devargs {
 	struct dlb2_cos_bw cos_bw;
 	const char *producer_coremask;
 	bool default_ldb_port_allocation;
+	bool enable_cq_weight;
 };
 
 /* End Eventdev related defines and structs */
Signature · 1 line
2.25.1
#1 lore raw
Quoted 11 lines · Abdullah Sevincer

Revise QE weight feature to enable from command line just passing a flag. If QE weight feature is enabled simply port cq weight will be same as dequeue depth.

Also, update DLB documentation for revised QE weight feature and usage of eventdev application with DLB hardware.

Review dlb2_parse_params(const char *params, · line 4735

Quoted 9 lines
(quoted diff) +1 -1
@@ -4774,11 +4728,11 @@ dlb2_parse_params(const char *params,
                                             DLB2_VECTOR_OPTS_ENAB_ARG,
                                             DLB2_MAX_CQ_DEPTH,
                                             DLB2_MAX_ENQ_DEPTH,
-                                            DLB2_CQ_WEIGHT,
                                             DLB2_PORT_COS,
                                             DLB2_COS_BW,
                                             DLB2_PRODUCER_COREMASK,
                                             DLB2_DEFAULT_LDB_PORT_ALLOCATION_ARG,
+                                                DLB2_ENABLE_CQ_WEIGHT_ARG,

Alignment lost here. Added following diff to the patch

[for-main]dell[dpdk-next-eventdev] $ git diff

drivers/event/dlb2/dlb2.c +0 -0
index 07c9384950..3bc9d7408f 100644
@@ -4732,7 +4732,7 @@ dlb2_parse_params(const char *params,
                                             DLB2_COS_BW,
                                             DLB2_PRODUCER_COREMASK,
 

DLB2_DEFAULT_LDB_PORT_ALLOCATION_ARG,
- DLB2_ENABLE_CQ_WEIGHT_ARG,
+ DLB2_ENABLE_CQ_WEIGHT_ARG,

                                             NULL };

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

event/dlb2: revise QE weight feature

Revise QE weight feature to enable from command line just passing a flag. If QE weight feature is enabled simply port CQ weight will be same as dequeue depth.

Also, updated DLB documentation for revised QE weight feature and usage of eventdev application with DLB hardware.

Quoted 1 line
(quoted diff) +0 -0
                                             NULL };