Skip to contentSkip to conversation

examples/ipsec-secgw: add support for event vector

PATCH Superseded Srujana Challa 5 participants 7 messages Aug 26, 2021 – Nov 3, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 examples/ipsec-secgw: add support for event vector

Adds event vector support to inline protocol offload mode. By default vector support is disabled, it can be enabled by using the option --event-vector.
Additional options to configure vector size and vector timeout are also implemented and can be used by specifying --vector-size and --vector-tmo.

Depends-on: series-18262 ("security: Improve inline fast path routines")
Depends-on: series-18322 ("eventdev: simplify Rx adapter event vector config")

---
 doc/guides/sample_app_ug/ipsec_secgw.rst |  18 +-
 examples/ipsec-secgw/event_helper.c      |  78 +++++-
 examples/ipsec-secgw/event_helper.h      |   8 +
 examples/ipsec-secgw/ipsec-secgw.c       |  41 ++-
 examples/ipsec-secgw/ipsec-secgw.h       |   2 +
 examples/ipsec-secgw/ipsec_worker.c      | 330 ++++++++++++++++++++++-
 6 files changed, 472 insertions(+), 5 deletions(-)
doc/guides/sample_app_ug/ipsec_secgw.rst +17 -1
index 78171b25f9..557ca510f7 100644
@@ -86,6 +86,15 @@ The application supports two modes of operation: poll mode and event mode.
   threads and supports inline protocol only.** It also provides infrastructure for
   non-internal port however does not define any worker threads.
 
+  Event mode also supports event vectorization. The event devices, ethernet device
+  pairs which support the capability ``RTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR`` can
+  aggregate packets based on flow characteristics and generate a ``rte_event``
+  containing ``rte_event_vector``.
+  The aggregation size and timeout can be given using command line options vector-size
+  (default vector-size is 16) and vector-tmo (default vector-tmo is 102400ns).
+  By default event vectorization is disabled and it can be enabled using event-vector
+  option.
+
 Additionally the event mode introduces two submodes of processing packets:
 
 * Driver submode: This submode has bare minimum changes in the application to support
@@ -293,7 +302,8 @@ event app mode::
 
     ./<build_dir>/examples/dpdk-ipsec-secgw -c 0x3 -- -P -p 0x3 -u 0x1       \
            -f /path/to/config_file --transfer-mode event \
-           --event-schedule-type parallel                \
+           --event-schedule-type parallel --event-vector --vector-size 32    \
+           --vector-tmo 102400                           \
 
 where each option means:
 
@@ -312,6 +322,12 @@ where each option means:
 
 *   The ``--event-schedule-type`` option selects parallel ordering of event queues.
 
+*   The ``--event-vector`` option enables event vectorization.
+
+*   The ``--vector-size`` option specifies max vector size.
+
+*   The ``--vector-tmo`` option specifies max timeout in nanoseconds for vectorization.
+
 
 Refer to the *DPDK Getting Started Guide* for general information on running
 applications and the Environment Abstraction Layer (EAL) options.
examples/ipsec-secgw/event_helper.c +77 -1

115 lines not on this page · raw message

examples/ipsec-secgw/event_helper.h +8 -0
index b65b343367..5be6c620cd 100644
@@ -171,10 +171,18 @@ struct eventmode_conf {
 		 * When enabled, all event queues need to be mapped to
 		 * each event port
 		 */
+			uint64_t event_vector                   : 1;
+		/**<
+		 * Enable event vector, when enabled application can
+		 * receive vector of events.
+		 */
+			uint64_t vector_size                    : 16;
 		};
 		uint64_t u64;
 	} ext_params;
 		/**< 64 bit field to specify extended params */
+	uint64_t vector_tmo_ns;
+		/**< Max vector timeout in nanoseconds */
 };
 
 /**
examples/ipsec-secgw/ipsec-secgw.c +40 -1

89 lines not on this page · raw message

examples/ipsec-secgw/ipsec-secgw.h +2 -0
index 96e22de45e..73d01d8925 100644
@@ -106,6 +106,8 @@ extern uint32_t single_sa_idx;
 
 extern volatile bool force_quit;
 
+extern uint32_t nb_bufs_in_pool;
+
 static inline uint8_t
 is_unprotected_port(uint16_t port_id)
 {
examples/ipsec-secgw/ipsec_worker.c +328 -2

356 lines not on this page · raw message

Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 1/1 examples/ipsec-secgw: add support for event vector

Adds event vector support to inline protocol offload mode. By default vector support is disabled, it can be enabled by using the option --event-vector.
Additional options to configure vector size and vector timeout are also implemented and can be used by specifying --vector-size and --vector-tmo.

---
Depends-on: series-18262 ("security: Improve inline fast path routines")
Depends-on: series-18322 ("eventdev: simplify Rx adapter event vector config")

v2:
* Set rte_event_vector::attr_valid if all packets in the vector uses same port.

 doc/guides/sample_app_ug/ipsec_secgw.rst |  18 +-
 examples/ipsec-secgw/event_helper.c      |  78 ++++-
 examples/ipsec-secgw/event_helper.h      |   8 +
 examples/ipsec-secgw/ipsec-secgw.c       |  41 ++-
 examples/ipsec-secgw/ipsec-secgw.h       |   2 +
 examples/ipsec-secgw/ipsec_worker.c      | 350 ++++++++++++++++++++++-
 6 files changed, 492 insertions(+), 5 deletions(-)
doc/guides/sample_app_ug/ipsec_secgw.rst +17 -1
index 78171b25f9..557ca510f7 100644
@@ -86,6 +86,15 @@ The application supports two modes of operation: poll mode and event mode.
   threads and supports inline protocol only.** It also provides infrastructure for
   non-internal port however does not define any worker threads.
 
+  Event mode also supports event vectorization. The event devices, ethernet device
+  pairs which support the capability ``RTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR`` can
+  aggregate packets based on flow characteristics and generate a ``rte_event``
+  containing ``rte_event_vector``.
+  The aggregation size and timeout can be given using command line options vector-size
+  (default vector-size is 16) and vector-tmo (default vector-tmo is 102400ns).
+  By default event vectorization is disabled and it can be enabled using event-vector
+  option.
+
 Additionally the event mode introduces two submodes of processing packets:
 
 * Driver submode: This submode has bare minimum changes in the application to support
@@ -293,7 +302,8 @@ event app mode::
 
     ./<build_dir>/examples/dpdk-ipsec-secgw -c 0x3 -- -P -p 0x3 -u 0x1       \
            -f /path/to/config_file --transfer-mode event \
-           --event-schedule-type parallel                \
+           --event-schedule-type parallel --event-vector --vector-size 32    \
+           --vector-tmo 102400                           \
 
 where each option means:
 
@@ -312,6 +322,12 @@ where each option means:
 
 *   The ``--event-schedule-type`` option selects parallel ordering of event queues.
 
+*   The ``--event-vector`` option enables event vectorization.
+
+*   The ``--vector-size`` option specifies max vector size.
+
+*   The ``--vector-tmo`` option specifies max timeout in nanoseconds for vectorization.
+
 
 Refer to the *DPDK Getting Started Guide* for general information on running
 applications and the Environment Abstraction Layer (EAL) options.
examples/ipsec-secgw/event_helper.c +77 -1

115 lines not on this page · raw message

examples/ipsec-secgw/event_helper.h +8 -0
index b65b343367..5be6c620cd 100644
@@ -171,10 +171,18 @@ struct eventmode_conf {
 		 * When enabled, all event queues need to be mapped to
 		 * each event port
 		 */
+			uint64_t event_vector                   : 1;
+		/**<
+		 * Enable event vector, when enabled application can
+		 * receive vector of events.
+		 */
+			uint64_t vector_size                    : 16;
 		};
 		uint64_t u64;
 	} ext_params;
 		/**< 64 bit field to specify extended params */
+	uint64_t vector_tmo_ns;
+		/**< Max vector timeout in nanoseconds */
 };
 
 /**
examples/ipsec-secgw/ipsec-secgw.c +40 -1

89 lines not on this page · raw message

examples/ipsec-secgw/ipsec-secgw.h +2 -0
index 96e22de45e..73d01d8925 100644
@@ -106,6 +106,8 @@ extern uint32_t single_sa_idx;
 
 extern volatile bool force_quit;
 
+extern uint32_t nb_bufs_in_pool;
+
 static inline uint8_t
 is_unprotected_port(uint16_t port_id)
 {
examples/ipsec-secgw/ipsec_worker.c +348 -2

382 lines not on this page · raw message

Signature · 1 line
2.25.1
#2 lore raw

Hi Konstantin/Radu,

Quoted 8 lines

Adds event vector support to inline protocol offload mode. By default vector support is disabled, it can be enabled by using the option --event-vector.
Additional options to configure vector size and vector timeout are also implemented and can be used by specifying --vector-size and --vector-tmo.

Quoted 8 lines

---
Depends-on: series-18262 ("security: Improve inline fast path routines")
Depends-on: series-18322 ("eventdev: simplify Rx adapter event vector config")

v2:
* Set rte_event_vector::attr_valid if all packets in the vector uses same port.

Any comments on this patch. It has been in patchworks from quite some time.

Regards,
Akhil

#3 lore raw

Hi Akhil,

Quoted 15 lines

Hi Konstantin/Radu,

Quoted 13 lines

Adds event vector support to inline protocol offload mode. By default vector support is disabled, it can be enabled by using the option --event-vector.
Additional options to configure vector size and vector timeout are also implemented and can be used by specifying --vector-size and --vector-tmo.

---
Depends-on: series-18262 ("security: Improve inline fast path routines")
Depends-on: series-18322 ("eventdev: simplify Rx adapter event vector config")

Quoted 5 lines
Quoted 3 lines

v2:
* Set rte_event_vector::attr_valid if all packets in the vector uses same port.

Any comments on this patch. It has been in patchworks from quite some time.

As I understand it affects only event mode for ipsec-secgw, right? I am not really familiar with that part, so no comments from me. Thanks
Konstantin

#4 lore raw

Hi Akhil, I'm even less familiar with this section, so no objection from me neither.

Quoted 29 lines · Konstantin

Hi Akhil,

Quoted 15 lines

Hi Konstantin/Radu,

Quoted 13 lines

Adds event vector support to inline protocol offload mode. By default vector support is disabled, it can be enabled by using the option --event-vector.
Additional options to configure vector size and vector timeout are also implemented and can be used by specifying --vector-size and --vector-tmo.

---
Depends-on: series-18262 ("security: Improve inline fast path routines")
Depends-on: series-18322 ("eventdev: simplify Rx adapter event vector config")

Quoted 5 lines
Quoted 3 lines

v2:
* Set rte_event_vector::attr_valid if all packets in the vector uses same port.

Any comments on this patch. It has been in patchworks from quite some time.

As I understand it affects only event mode for ipsec-secgw, right? I am not really familiar with that part, so no comments from me. Thanks
Konstantin

#5 lore raw

PATCH v3 1/1 examples/ipsec-secgw: add support for event vector

In reply to Srujana Challa

From: Srujana Challa <[email protected]>

Adds event vector support to inline protocol offload mode. By default vector support is disabled, it can be enabled by using the option --event-vector.
Additional options to configure vector size and vector timeout are also implemented and can be used by specifying --vector-size and --vector-tmo.

---

v3:
* Rebased and updated PKT_* mbuf flags to RTE_MBUF_F*.

v2:
* Set rte_event_vector::attr_valid if all packets in the vector uses same port.

doc/guides/sample_app_ug/ipsec_secgw.rst | 18 +-

 examples/ipsec-secgw/event_helper.c      |  78 ++++++-
 examples/ipsec-secgw/event_helper.h      |   8 +
 examples/ipsec-secgw/ipsec-secgw.c       |  41 +++-
 examples/ipsec-secgw/ipsec-secgw.h       |   2 +
 examples/ipsec-secgw/ipsec_worker.c      | 350 ++++++++++++++++++++++++++++++-
 6 files changed, 492 insertions(+), 5 deletions(-)
doc/guides/sample_app_ug/ipsec_secgw.rst +17 -1
index 639d309..f9f4324 100644
@@ -86,6 +86,15 @@ The application supports two modes of operation: poll mode and event mode.
   threads and supports inline protocol only.** It also provides infrastructure for
   non-internal port however does not define any worker threads.
 
+  Event mode also supports event vectorization. The event devices, ethernet device
+  pairs which support the capability ``RTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR`` can
+  aggregate packets based on flow characteristics and generate a ``rte_event``
+  containing ``rte_event_vector``.
+  The aggregation size and timeout can be given using command line options vector-size
+  (default vector-size is 16) and vector-tmo (default vector-tmo is 102400ns).
+  By default event vectorization is disabled and it can be enabled using event-vector
+  option.
+
 Additionally the event mode introduces two submodes of processing packets:
 
 * Driver submode: This submode has bare minimum changes in the application to support
@@ -293,7 +302,8 @@ event app mode::
 
     ./<build_dir>/examples/dpdk-ipsec-secgw -c 0x3 -- -P -p 0x3 -u 0x1       \
            -f /path/to/config_file --transfer-mode event \
-           --event-schedule-type parallel                \
+           --event-schedule-type parallel --event-vector --vector-size 32    \
+           --vector-tmo 102400                           \
 
 where each option means:
 
@@ -312,6 +322,12 @@ where each option means:
 
 *   The ``--event-schedule-type`` option selects parallel ordering of event queues.
 
+*   The ``--event-vector`` option enables event vectorization.
+
+*   The ``--vector-size`` option specifies max vector size.
+
+*   The ``--vector-tmo`` option specifies max timeout in nanoseconds for vectorization.
+
 
 Refer to the *DPDK Getting Started Guide* for general information on running
 applications and the Environment Abstraction Layer (EAL) options.
examples/ipsec-secgw/event_helper.c +77 -1

115 lines not on this page · raw message

examples/ipsec-secgw/event_helper.h +8 -0
index b65b343..5be6c62 100644
@@ -171,10 +171,18 @@ struct eventmode_conf {
 		 * When enabled, all event queues need to be mapped to
 		 * each event port
 		 */
+			uint64_t event_vector                   : 1;
+		/**<
+		 * Enable event vector, when enabled application can
+		 * receive vector of events.
+		 */
+			uint64_t vector_size                    : 16;
 		};
 		uint64_t u64;
 	} ext_params;
 		/**< 64 bit field to specify extended params */
+	uint64_t vector_tmo_ns;
+		/**< Max vector timeout in nanoseconds */
 };
 
 /**
examples/ipsec-secgw/ipsec-secgw.c +40 -1

89 lines not on this page · raw message

examples/ipsec-secgw/ipsec-secgw.h +2 -0
index 96e22de..73d01d8 100644
@@ -106,6 +106,8 @@ extern uint32_t single_sa_idx;
 
 extern volatile bool force_quit;
 
+extern uint32_t nb_bufs_in_pool;
+
 static inline uint8_t
 is_unprotected_port(uint16_t port_id)
 {
examples/ipsec-secgw/ipsec_worker.c +348 -2

382 lines not on this page · raw message

Signature · 1 line
2.8.4
Acked-by on v3 1/1
#6 lore raw
Quoted 11 lines

From: Srujana Challa <[email protected]>

Adds event vector support to inline protocol offload mode. By default vector support is disabled, it can be enabled by using the option --event-vector.
Additional options to configure vector size and vector timeout are also implemented and can be used by specifying --vector-size and --vector-tmo.

---

Added release notes.
Applied to dpdk-next-crypto

Thanks.