app/test-eventdev: add burst enqueue support in perf_queue test
PATCH 1/1 app/test-eventdev: add burst enqueue support in perf_queue test
A new command line option prod_enq_burst_sz is introduced to set burst size for eventdev enqueue at producer in perf_queue test. The newly added function perf_producer_burst is called when prod_enq_burst_sz is greater than 1.
--- app/test-eventdev/evt_common.h | 1 + app/test-eventdev/evt_main.c | 2 +- app/test-eventdev/evt_options.c | 14 +++++ app/test-eventdev/evt_options.h | 1 + app/test-eventdev/test_perf_common.c | 80 +++++++++++++++++++++++++++- app/test-eventdev/test_perf_common.h | 1 + 6 files changed, 96 insertions(+), 3 deletions(-)
app/test-eventdev/evt_common.h +1 -0
@@ -64,6 +64,7 @@ struct evt_options {uint32_t nb_flows;uint32_t tx_first;uint32_t max_pkt_sz; +uint32_t prod_enq_burst_sz;uint32_t deq_tmo_nsec; uint32_t q_priority:1; uint32_t fwd_latency:1;
app/test-eventdev/evt_main.c +1 -1
@@ -95,7 +95,7 @@ main(int argc, char **argv)/* Parse the command line arguments */ ret =evt_options_parse (&opt, argc, argv);if (ret) { -evt_err ("parsing on or more user options failed" ); +evt_err ("parsing one or more user options failed" ); goto error; }
app/test-eventdev/evt_options.c +14 -0
@@ -26,6 +26,7 @@ evt_options_default(struct evt_options *opt) opt->nb_flows =1024 ; opt->socket_id =SOCKET_ID_ANY ; opt->pool_sz =16 *1024 ; + opt->prod_enq_burst_sz =1 ; opt->wkr_deq_dep =16 ; opt->nb_pkts = (1ULL <<26 );/* do ~64M packets */ opt->nb_timers =1E8 ;
@@ -304,6 +305,16 @@ evt_parse_per_port_pool(struct evt_options *opt, const char *arg __rte_unused)return 0 ; } +static int +evt_parse_prod_enq_burst_sz (struct evt_options *opt,const char *arg) +{ +int ret; + + ret =parser_read_uint32 (&(opt->prod_enq_burst_sz), arg); + +return ret; +} +static void usage (char *program) {
@@ -336,6 +347,7 @@ usage(char *program)"\t--expiry_nsec : event timer expiry ns.\n" "\t--mbuf_sz : packet mbuf size.\n" "\t--max_pkt_sz : max packet size.\n" +"\t--prod_enq_burst_sz : producer enqueue burst size.\n" "\t--nb_eth_queues : number of ethernet Rx queues.\n" "\t--enable_vector : enable event vectorization.\n" "\t--vector_size : Max vector size.\n"
@@ -412,6 +424,7 @@ static struct option lgopts[] = { { EVT_EXPIRY_NSEC, 1, 0, 0 }, { EVT_MBUF_SZ, 1, 0, 0 }, { EVT_MAX_PKT_SZ, 1, 0, 0 }, + { EVT_PROD_ENQ_BURST_SZ, 1, 0, 0 }, { EVT_NB_ETH_QUEUES, 1, 0, 0 }, { EVT_ENA_VECTOR, 0, 0, 0 }, { EVT_VECTOR_SZ, 1, 0, 0 },
@@ -451,6 +464,7 @@ evt_opts_parse_long(int opt_idx, struct evt_options *opt) { EVT_EXPIRY_NSEC, evt_parse_expiry_nsec}, { EVT_MBUF_SZ, evt_parse_mbuf_sz}, { EVT_MAX_PKT_SZ, evt_parse_max_pkt_sz}, + { EVT_PROD_ENQ_BURST_SZ, evt_parse_prod_enq_burst_sz}, { EVT_NB_ETH_QUEUES, evt_parse_eth_queues}, { EVT_ENA_VECTOR, evt_parse_ena_vector}, { EVT_VECTOR_SZ, evt_parse_vector_size},
app/test-eventdev/evt_options.h +1 -0
@@ -42,6 +42,7 @@#define EVT_EXPIRY_NSEC ("expiry_nsec")#define EVT_MBUF_SZ ("mbuf_sz")#define EVT_MAX_PKT_SZ ("max_pkt_sz") +#define EVT_PROD_ENQ_BURST_SZ ("prod_enq_burst_sz")#define EVT_NB_ETH_QUEUES ("nb_eth_queues")#define EVT_ENA_VECTOR ("enable_vector")#define EVT_VECTOR_SZ ("vector_size")
app/test-eventdev/test_perf_common.c +78 -2
99 lines not on this page · raw message
app/test-eventdev/test_perf_common.h +1 -0
@@ -71,6 +71,7 @@ struct perf_elt { } __rte_cache_aligned;#define BURST_SIZE 16 +#define MAX_PROD_ENQ_BURST_SIZE 128#define PERF_WORKER_INIT \ struct worker_data *w = arg;\
Signature · 1 line
2.25.1
PATCH v2 1/1 app/test-eventdev: add burst enqueue support
This commit introduces a new command line option prod_enq_burst_sz to set burst size for eventdev enqueue at producer in perf_queue test. The newly added function perf_producer_burst is called when prod_enq_burst_sz is greater than 1.
--- app/test-eventdev/evt_common.h | 1 + app/test-eventdev/evt_main.c | 2 +- app/test-eventdev/evt_options.c | 14 +++++ app/test-eventdev/evt_options.h | 1 + app/test-eventdev/test_perf_common.c | 81 +++++++++++++++++++++++++++- app/test-eventdev/test_perf_common.h | 1 + 6 files changed, 97 insertions(+), 3 deletions(-)
app/test-eventdev/evt_common.h +1 -0
@@ -64,6 +64,7 @@ struct evt_options {uint32_t nb_flows;uint32_t tx_first;uint32_t max_pkt_sz; +uint32_t prod_enq_burst_sz;uint32_t deq_tmo_nsec; uint32_t q_priority:1; uint32_t fwd_latency:1;
app/test-eventdev/evt_main.c +1 -1
@@ -95,7 +95,7 @@ main(int argc, char **argv)/* Parse the command line arguments */ ret =evt_options_parse (&opt, argc, argv);if (ret) { -evt_err ("parsing on or more user options failed" ); +evt_err ("parsing one or more user options failed" ); goto error; }
app/test-eventdev/evt_options.c +14 -0
@@ -26,6 +26,7 @@ evt_options_default(struct evt_options *opt) opt->nb_flows =1024 ; opt->socket_id =SOCKET_ID_ANY ; opt->pool_sz =16 *1024 ; + opt->prod_enq_burst_sz =1 ; opt->wkr_deq_dep =16 ; opt->nb_pkts = (1ULL <<26 );/* do ~64M packets */ opt->nb_timers =1E8 ;
@@ -304,6 +305,16 @@ evt_parse_per_port_pool(struct evt_options *opt, const char *arg __rte_unused)return 0 ; } +static int +evt_parse_prod_enq_burst_sz (struct evt_options *opt,const char *arg) +{ +int ret; + + ret =parser_read_uint32 (&(opt->prod_enq_burst_sz), arg); + +return ret; +} +static void usage (char *program) {
@@ -336,6 +347,7 @@ usage(char *program)"\t--expiry_nsec : event timer expiry ns.\n" "\t--mbuf_sz : packet mbuf size.\n" "\t--max_pkt_sz : max packet size.\n" +"\t--prod_enq_burst_sz : producer enqueue burst size.\n" "\t--nb_eth_queues : number of ethernet Rx queues.\n" "\t--enable_vector : enable event vectorization.\n" "\t--vector_size : Max vector size.\n"
@@ -412,6 +424,7 @@ static struct option lgopts[] = { { EVT_EXPIRY_NSEC, 1, 0, 0 }, { EVT_MBUF_SZ, 1, 0, 0 }, { EVT_MAX_PKT_SZ, 1, 0, 0 }, + { EVT_PROD_ENQ_BURST_SZ, 1, 0, 0 }, { EVT_NB_ETH_QUEUES, 1, 0, 0 }, { EVT_ENA_VECTOR, 0, 0, 0 }, { EVT_VECTOR_SZ, 1, 0, 0 },
@@ -451,6 +464,7 @@ evt_opts_parse_long(int opt_idx, struct evt_options *opt) { EVT_EXPIRY_NSEC, evt_parse_expiry_nsec}, { EVT_MBUF_SZ, evt_parse_mbuf_sz}, { EVT_MAX_PKT_SZ, evt_parse_max_pkt_sz}, + { EVT_PROD_ENQ_BURST_SZ, evt_parse_prod_enq_burst_sz}, { EVT_NB_ETH_QUEUES, evt_parse_eth_queues}, { EVT_ENA_VECTOR, evt_parse_ena_vector}, { EVT_VECTOR_SZ, evt_parse_vector_size},
app/test-eventdev/evt_options.h +1 -0
@@ -42,6 +42,7 @@#define EVT_EXPIRY_NSEC ("expiry_nsec")#define EVT_MBUF_SZ ("mbuf_sz")#define EVT_MAX_PKT_SZ ("max_pkt_sz") +#define EVT_PROD_ENQ_BURST_SZ ("prod_enq_burst_sz")#define EVT_NB_ETH_QUEUES ("nb_eth_queues")#define EVT_ENA_VECTOR ("enable_vector")#define EVT_VECTOR_SZ ("vector_size")
app/test-eventdev/test_perf_common.c +79 -2
100 lines not on this page · raw message
app/test-eventdev/test_perf_common.h +1 -0
@@ -71,6 +71,7 @@ struct perf_elt { } __rte_cache_aligned;#define BURST_SIZE 16 +#define MAX_PROD_ENQ_BURST_SIZE 128#define PERF_WORKER_INIT \ struct worker_data *w = arg;\
Signature · 1 line
2.25.1
Re: [dpdk-dev] [PATCH v2] app/test-eventdev: add burst enqueue support
Quoted 6 lines · Rashmi Shetty
This commit introduces a new command line option
prod_enq_burst_szto set burst size for eventdev enqueue at producer inperf_queuetest. The newly added functionperf_producer_burstis called whenprod_enq_burst_szis greater than 1.
Quoted 8 lines
Signed-off-by Rashmi Shetty <[email protected]>--- app/test-eventdev/evt_common.h | 1 + app/test-eventdev/evt_main.c | 2 +- app/test-eventdev/evt_options.c | 14 +++++ app/test-eventdev/evt_options.h | 1 + app/test-eventdev/test_perf_common.c | 81 +++++++++++++++++++++++++++- app/test-eventdev/test_perf_common.h | 1 +
Update doc/guides/tools/testeventdev.rst for this new command-line option and extended existing example command to use the new one as a separate command.
app/test-eventdev/evt_common.h
Quoted 6 lines
6 files changed, 97 insertions(+), 3 deletions(-)app/test-eventdev/evt_common.h +1
-0+struct perf_elt *m[MAX_PROD_ENQ_BURST_SIZE +1 ] = {NULL };
Use memcpy, some old compiler may issue with this kind of usage.
Quoted 11 lines
app/test-eventdev/evt_common.h +11
-0+struct rte_event ev[MAX_PROD_ENQ_BURST_SIZE +1 ]; +uint32_t burst_size = opt->prod_enq_burst_sz; + +rte_event_dev_info_get (dev_id, &dev_info); +if (dev_info.max_event_port_enqueue_depth < burst_size) + burst_size = dev_info.max_event_port_enqueue_depth; + +if (opt->verbose_level >1 ) +printf ("%s(): lcore %d dev_id %d port=%d queue %d\n" , __func__, +rte_lcore_id (), dev_id, port, p->queue_id); +
PATCH v3 1/1 app/test-eventdev: add burst enqueue support
In reply to Rashmi ShettyThis commit introduces a new command line option prod_enq_burst_sz to set burst size for eventdev enqueue at producer in perf_queue test. The newly added function perf_producer_burst is called when prod_enq_burst_sz is greater than 1.
---
v3:
- Updated testeventdev.rst to document and show new command line option usage (Jerin)
- Used memset() to zero stack struct instead of = {NULL}; syntax (Jerin)
--- app/test-eventdev/evt_common.h | 1 + app/test-eventdev/evt_main.c | 2 +- app/test-eventdev/evt_options.c | 14 +++++ app/test-eventdev/evt_options.h | 1 + app/test-eventdev/test_perf_common.c | 82 +++++++++++++++++++++++++++- app/test-eventdev/test_perf_common.h | 1 + doc/guides/tools/testeventdev.rst | 22 +++++++- 7 files changed, 117 insertions(+), 6 deletions(-)
app/test-eventdev/evt_common.h +1 -0
@@ -64,6 +64,7 @@ struct evt_options {uint32_t nb_flows;uint32_t tx_first;uint32_t max_pkt_sz; +uint32_t prod_enq_burst_sz;uint32_t deq_tmo_nsec; uint32_t q_priority:1; uint32_t fwd_latency:1;
app/test-eventdev/evt_main.c +1 -1
@@ -95,7 +95,7 @@ main(int argc, char **argv)/* Parse the command line arguments */ ret =evt_options_parse (&opt, argc, argv);if (ret) { -evt_err ("parsing on or more user options failed" ); +evt_err ("parsing one or more user options failed" ); goto error; }
app/test-eventdev/evt_options.c +14 -0
@@ -26,6 +26,7 @@ evt_options_default(struct evt_options *opt) opt->nb_flows =1024 ; opt->socket_id =SOCKET_ID_ANY ; opt->pool_sz =16 *1024 ; + opt->prod_enq_burst_sz =1 ; opt->wkr_deq_dep =16 ; opt->nb_pkts = (1ULL <<26 );/* do ~64M packets */ opt->nb_timers =1E8 ;
@@ -304,6 +305,16 @@ evt_parse_per_port_pool(struct evt_options *opt, const char *arg __rte_unused)return 0 ; } +static int +evt_parse_prod_enq_burst_sz (struct evt_options *opt,const char *arg) +{ +int ret; + + ret =parser_read_uint32 (&(opt->prod_enq_burst_sz), arg); + +return ret; +} +static void usage (char *program) {
@@ -336,6 +347,7 @@ usage(char *program)"\t--expiry_nsec : event timer expiry ns.\n" "\t--mbuf_sz : packet mbuf size.\n" "\t--max_pkt_sz : max packet size.\n" +"\t--prod_enq_burst_sz : producer enqueue burst size.\n" "\t--nb_eth_queues : number of ethernet Rx queues.\n" "\t--enable_vector : enable event vectorization.\n" "\t--vector_size : Max vector size.\n"
@@ -412,6 +424,7 @@ static struct option lgopts[] = { { EVT_EXPIRY_NSEC, 1, 0, 0 }, { EVT_MBUF_SZ, 1, 0, 0 }, { EVT_MAX_PKT_SZ, 1, 0, 0 }, + { EVT_PROD_ENQ_BURST_SZ, 1, 0, 0 }, { EVT_NB_ETH_QUEUES, 1, 0, 0 }, { EVT_ENA_VECTOR, 0, 0, 0 }, { EVT_VECTOR_SZ, 1, 0, 0 },
@@ -451,6 +464,7 @@ evt_opts_parse_long(int opt_idx, struct evt_options *opt) { EVT_EXPIRY_NSEC, evt_parse_expiry_nsec}, { EVT_MBUF_SZ, evt_parse_mbuf_sz}, { EVT_MAX_PKT_SZ, evt_parse_max_pkt_sz}, + { EVT_PROD_ENQ_BURST_SZ, evt_parse_prod_enq_burst_sz}, { EVT_NB_ETH_QUEUES, evt_parse_eth_queues}, { EVT_ENA_VECTOR, evt_parse_ena_vector}, { EVT_VECTOR_SZ, evt_parse_vector_size},
app/test-eventdev/evt_options.h +1 -0
@@ -42,6 +42,7 @@#define EVT_EXPIRY_NSEC ("expiry_nsec")#define EVT_MBUF_SZ ("mbuf_sz")#define EVT_MAX_PKT_SZ ("max_pkt_sz") +#define EVT_PROD_ENQ_BURST_SZ ("prod_enq_burst_sz")#define EVT_NB_ETH_QUEUES ("nb_eth_queues")#define EVT_ENA_VECTOR ("enable_vector")#define EVT_VECTOR_SZ ("vector_size")
app/test-eventdev/test_perf_common.c +80 -2
101 lines not on this page · raw message
app/test-eventdev/test_perf_common.h +1 -0
@@ -71,6 +71,7 @@ struct perf_elt { } __rte_cache_aligned;#define BURST_SIZE 16 +#define MAX_PROD_ENQ_BURST_SIZE 128#define PERF_WORKER_INIT \ struct worker_data *w = arg;\
doc/guides/tools/testeventdev.rst +19 -3
@@ -155,9 +155,15 @@ The following are the application command-line options: * ``--max_pkt_sz`` - Set max packet mbuf size. Can be used configure Rx/Tx scatter gather. + Set max packet mbuf size. Can be used to configure Rx/Tx scatter gather. Only applicable for `pipeline_atq` and `pipeline_queue` tests. +* ``--prod_enq_burst_sz`` + + Set producer enqueue burst size. Can be used to configure the number of + events the producer(s) will enqueue as a burst to the event device. + Only applicable for `perf_queue` test. + * ``--nb_eth_queues`` Configure multiple Rx queues per each ethernet port.
@@ -374,8 +380,9 @@ The user can choose the number of workers, the number of producers and number of stages through the ``--wlcores``, ``--plcores`` and the ``--stlist`` application command line arguments respectively. -The producer(s) injects the events to eventdev based the first stage sched type -list requested by the user through ``--stlist`` the command line argument. +The producer(s) injects the events to eventdev based on the first stage sched type +list requested by the user through ``--stlist`` command line argument. It can +inject a burst of events using ``--prod_enq_burst_sz`` command line argument. Based on the number of stages to process(selected through ``--stlist``), The application forwards the event to next upstream queue and terminates when it
@@ -413,6 +420,7 @@ Supported application command line options are following:: --prod_type_ethdev --prod_type_timerdev_burst --prod_type_timerdev + --prod_enq_burst_sz --timer_tick_nsec --max_tmo_nsec --expiry_nsec
@@ -430,6 +438,14 @@ Example command to run perf queue test: sudo <build_dir>/app/dpdk-test-eventdev -c 0xf -s 0x1 --vdev=event_sw0 -- \ --test=perf_queue --plcores=2 --wlcore=3 --stlist=p --nb_pkts=0 +Example command to run perf queue test with producer enqueuing a burst of events: + +.. code-block:: console + + sudo <build_dir>/app/dpdk-test-eventdev -c 0xf -s 0x1 --vdev=event_sw0 -- \ + --test=perf_queue --plcores=2 --wlcore=3 --stlist=p --nb_pkts=0 \ + --prod_enq_burst_sz=32 + Example command to run perf queue test with ethernet ports: .. code-block:: console
Signature · 1 line
2.25.1
Re: [dpdk-dev] [EXT] [PATCH v3] app/test-eventdev: add burst enqueue support
Quoted 7 lines
This commit introduces a new command line option
prod_enq_burst_szto set burst size for eventdev enqueue at producer inperf_queuetest. The newly added functionperf_producer_burstis called whenprod_enq_burst_szis greater than 1.Signed-off-by Rashmi Shetty <[email protected]>
LGTM
Quoted 330 lines
---
v3:
- Updatedtesteventdev.rstto document and show new command line option usage (Jerin)
- Usedmemset()to zero stack struct instead of = {NULL}; syntax (Jerin)---
app/test-eventdev/evt_common.h | 1 + app/test-eventdev/evt_main.c | 2 +- app/test-eventdev/evt_options.c | 14 +++++ app/test-eventdev/evt_options.h | 1 + app/test-eventdev/test_perf_common.c | 82 +++++++++++++++++++++++++++- app/test-eventdev/test_perf_common.h | 1 + doc/guides/tools/testeventdev.rst | 22 +++++++- 7 files changed, 117 insertions(+), 6 deletions(-)app/test- renamed from app/test-eventdev/evt_common.h +0
-0
eventdev/evt_common.h
index28afb114b3..f466434459100644app/test-eventdev/evt_common.h +1
-0@@ -64,6 +64,7 @@ struct evt_options {uint32_t nb_flows;uint32_t tx_first;uint32_t max_pkt_sz; +uint32_t prod_enq_burst_sz;uint32_t deq_tmo_nsec; uint32_t q_priority:1; uint32_t fwd_latency:1;app/test- renamed from app/test-eventdev/evt_main.c +0
-0
eventdev/evt_main.c
indexa8d304bab3..3534aabca7100644app/test-eventdev/evt_main.c +1
-1@@ -95,7 +95,7 @@ main(int argc, char **argv)/* Parse the command line arguments */ ret =evt_options_parse (&opt, argc, argv);if (ret) { -evt_err ("parsing on or more user options failed" ); +evt_err ("parsing one or more user options failed" ); goto error; }app/test- renamed from app/test-eventdev/evt_options.c +0
-0
eventdev/evt_options.c
indexb0bcbc6c96..753a7dbd7d100644app/test-eventdev/evt_options.c +11
-0@@ -26,6 +26,7 @@ evt_options_default(struct evt_options *opt) opt->nb_flows =1024 ; opt->socket_id =SOCKET_ID_ANY ; opt->pool_sz =16 *1024 ; + opt->prod_enq_burst_sz =1 ; opt->wkr_deq_dep =16 ; opt->nb_pkts = (1ULL <<26 );/* do ~64M packets */ opt->nb_timers =1E8 ;@@ -304,6 +305,16 @@ evt_parse_per_port_pool(struct evt_options *opt, const char *arg __rte_unused)return 0 ; } +static int +evt_parse_prod_enq_burst_sz (struct evt_options *opt,const char *arg) +{ +int ret; + + ret =parser_read_uint32 (&(opt->prod_enq_burst_sz), arg); + +return ret; +} +static void
usage(char *program)
{app/test-eventdev/evt_options.c +1
-0@@ -336,6 +347,7 @@ usage(char *program)"\t--expiry_nsec : event timer expiry ns.\n" "\t--mbuf_sz : packet mbuf size.\n" "\t--max_pkt_sz : max packet size.\n" + "\t--prod_enq_burst_sz : producer enqueue burstsize.\n"
"\t--nb_eth_queues : number of ethernet Rx
queues.\n"
"\t--enable_vector : enable event vectorization.\n"
"\t--vector_size : Max vector size.\n"app/test-eventdev/evt_options.c +2
-0@@ -412,6 +424,7 @@ static struct option lgopts[] = { { EVT_EXPIRY_NSEC, 1, 0, 0 }, { EVT_MBUF_SZ, 1, 0, 0 }, { EVT_MAX_PKT_SZ, 1, 0, 0 }, + { EVT_PROD_ENQ_BURST_SZ, 1, 0, 0 }, { EVT_NB_ETH_QUEUES, 1, 0, 0 }, { EVT_ENA_VECTOR, 0, 0, 0 }, { EVT_VECTOR_SZ, 1, 0, 0 },@@ -451,6 +464,7 @@ evt_opts_parse_long(int opt_idx, struct evt_options *opt) { EVT_EXPIRY_NSEC, evt_parse_expiry_nsec}, { EVT_MBUF_SZ, evt_parse_mbuf_sz}, { EVT_MAX_PKT_SZ, evt_parse_max_pkt_sz}, + { EVT_PROD_ENQ_BURST_SZ, evt_parse_prod_enq_burst_sz}, { EVT_NB_ETH_QUEUES, evt_parse_eth_queues},{
EVT_ENA_VECTOR,evt_parse_ena_vector}, {EVT_VECTOR_SZ,evt_parse_vector_size},app/test- renamed from app/test-eventdev/evt_options.h +0
-0
eventdev/evt_options.h
index6436200b40..413d7092f0100644app/test-eventdev/evt_options.h +1
-0@@ -42,6 +42,7 @@#define EVT_EXPIRY_NSEC ("expiry_nsec")#define EVT_MBUF_SZ ("mbuf_sz")#define EVT_MAX_PKT_SZ ("max_pkt_sz") +#define EVT_PROD_ENQ_BURST_SZ ("prod_enq_burst_sz")#define EVT_NB_ETH_QUEUES ("nb_eth_queues")#define EVT_ENA_VECTOR ("enable_vector")#define EVT_VECTOR_SZ ("vector_size")app/test- renamed from app/test-eventdev/test_perf_common.c +0
-0
eventdev/test_perf_common.c
indexcc100650c2..6d0806183d100644app/test-eventdev/test_perf_common.c +29
-0@@ -77,6 +77,71 @@ perf_producer(void *arg)return 0 ; } +static inline int +perf_producer_burst (void *arg) +{ +uint32_t i; +uint64_t timestamp; +struct rte_event_dev_info dev_info; +struct prod_data *p = arg; +struct test_perf *t = p->t; +struct evt_options *opt = t->opt; +const uint8_t dev_id = p->dev_id; +const uint8_t port = p->port_id; +struct rte_mempool *pool = t->pool; +const uint64_t nb_pkts = t->nb_pkts; +const uint32_t nb_flows = t->nb_flows; +uint32_t flow_counter =0 ; +uint16_t enq =0 ; +uint64_t count =0 ; +struct perf_elt *m[MAX_PROD_ENQ_BURST_SIZE +1 ]; +struct rte_event ev[MAX_PROD_ENQ_BURST_SIZE +1 ]; +uint32_t burst_size = opt->prod_enq_burst_sz; + +memset (m,0 ,sizeof (*m) * (MAX_PROD_ENQ_BURST_SIZE +1 )); +rte_event_dev_info_get (dev_id, &dev_info); +if (dev_info.max_event_port_enqueue_depth < burst_size) + burst_size = dev_info.max_event_port_enqueue_depth; + +if (opt->verbose_level >1 ) + printf("%s(): lcore %d dev_id %d port=%d queue %d\n", __func__, + rte_lcore_id(), dev_id, port, p-Quoted 1 line
queue_id);app/test-eventdev/test_perf_common.c +12
-0+ +for (i =0 ; i < burst_size; i++) { + ev[i].op =RTE_EVENT_OP_NEW ; + ev[i].queue_id = p->queue_id; + ev[i].sched_type = t->opt->sched_type_list[0 ]; + ev[i].priority =RTE_EVENT_DEV_PRIORITY_NORMAL ; + ev[i].event_type =RTE_EVENT_TYPE_CPU ; + ev[i].sub_event_type =0 ;/* stage 0 */ + } + +while (count < nb_pkts && t->done == false) { + if (rte_mempool_get_bulk(pool, (void **)m,
burst_size) < 0)app/test-eventdev/test_perf_common.c +8
-0+continue ; + timestamp =rte_get_timer_cycles (); +for (i =0 ; i < burst_size; i++) { + ev[i].flow_id = flow_counter++ % nb_flows; + ev[i].event_ptr = m[i]; + m[i]->timestamp = timestamp; + } + enq = rte_event_enqueue_burst(dev_id, port, ev,
burst_size);app/test-eventdev/test_perf_common.c +2
-0+while (enq < burst_size) { + enq += rte_event_enqueue_burst(dev_id,port,
app/test-eventdev/test_perf_common.c +2
-0+ ev + enq, + burst_size -enq);
app/test-eventdev/test_perf_common.c +12
-0+if (t->done) +break ; +rte_pause (); + timestamp =rte_get_timer_cycles (); +for (i = enq; i < burst_size; i++) + m[i]->timestamp = timestamp; + } + count += burst_size; + } +return 0 ; +} +static inline int
perf_event_timer_producer(void *arg)
{app/test-eventdev/test_perf_common.c +0
-1@@ -212,9 +277,21 @@ perf_producer_wrapper(void *arg) {struct prod_data *p = arg;struct test_perf *t = p->t; -/* Launch the producer function only in case of synthetic producer. */
app/test-eventdev/test_perf_common.c +4
-1-if (t->opt->prod_type ==EVT_PROD_TYPE_SYNT ) +bool burst =evt_has_burst_mode (p->dev_id); + +/* In case of synthetic producer, launch perf_producer or +* perf_producer_burst depending on producer enqueue burst size
app/test-eventdev/test_perf_common.c +3
-0+*/ +if (t->opt->prod_type ==EVT_PROD_TYPE_SYNT && + t->opt->prod_enq_burst_sz ==1 )return perf_producer(arg);app/test-eventdev/test_perf_common.c +4
-0+else if (t->opt->prod_type ==EVT_PROD_TYPE_SYNT && + t->opt->prod_enq_burst_sz >1 ) { +if (!burst) + evt_err("This event device does not supportburst mode");
app/test-eventdev/test_perf_common.c +3
-0+else +return perf_producer_burst (arg); + }else if (t->opt->prod_type == EVT_PROD_TYPE_EVENT_TIMER_ADPTR && !t->opt->timdev_use_burst) return perf_event_timer_producer(arg);app/test-eventdev/test_perf_common.c +1
-0@@ -635,6 +712,7 @@ perf_opt_dump(struct evt_options *opt, uint8_t nb_queues)evt_dump_queue_priority (opt );evt_dump_sched_type_list (opt);evt_dump_producer_type (opt); +evt_dump ("prod_enq_burst_sz" ,"%d" , opt- >prod_enq_burst_sz); }void
app/test- renamed from app/test-eventdev/test_perf_common.h +0
-0
eventdev/test_perf_common.h
index9785dc3e23..14dcf80429100644app/test-eventdev/test_perf_common.h +1
-0@@ -71,6 +71,7 @@ struct perf_elt { } __rte_cache_aligned;#define BURST_SIZE 16 +#define MAX_PROD_ENQ_BURST_SIZE 128#define PERF_WORKER_INIT \ struct worker_data *w = arg;\doc/guides/tools/testeventdev.rst +0
-0@@ -155,9 +155,15 @@ The following are the application command-lineoptions:
* ``--max_pkt_sz``
- Set max packet mbuf size. Can be used configure Rx/Tx scatter
gather.
+ Set max packet mbuf size. Can be used to configure Rx/Tx scatter
gather.
Only applicable forpipeline_atqandpipeline_queuetests.doc/guides/tools/testeventdev.rst +3
-0+* ``--prod_enq_burst_sz`` + + Set producer enqueue burst size. Can be used to configure thenumber of
+ events the producer(s) will enqueue as a burst to the event
device.doc/guides/tools/testeventdev.rst +2
-0+ Only applicable for `perf_queue` test. +* ``--nb_eth_queues``
Configure multiple Rx queues per each ethernet port.
doc/guides/tools/testeventdev.rst +0
-0@@ -374,8 +380,9 @@ The user can choose the number of workers, thenumber of producers and number of
stages through the ``--wlcores``, ``--plcores`` and the ``--stlist`` application
command line arguments respectively.-The producer(s) injects the events to eventdev based the first stage sched type
-list requested by the user through ``--stlist`` the command line argument.
+The producer(s) injects the events to eventdev based on the first stage sched type
+list requested by the user through ``--stlist`` command line argument. It can
+inject a burst of events using ``--prod_enq_burst_sz`` command line argument.Based on the number of stages to process(selected through ``--stlist``), The application forwards the event to next upstream queue and terminates when it
doc/guides/tools/testeventdev.rst +0
-0@@ -413,6 +420,7 @@ Supported application command line options arefollowing::
--prod_type_ethdev
--prod_type_timerdev_burst
--prod_type_timerdevdoc/guides/tools/testeventdev.rst +2
-0+ --prod_enq_burst_sz --timer_tick_nsec --max_tmo_nsec --expiry_nsec@@ -430,6 +438,14 @@ Example command to run perf queue test: sudo <build_dir>/app/dpdk-test-eventdev -c 0xf -s 0x1 -- vdev=event_sw0 -- \ --test=perf_queue --plcores=2 --wlcore=3 --stlist=p --nb_pkts=0 +Example command to run perf queue test with producer enqueuing aburst of events:
doc/guides/tools/testeventdev.rst +4
-0+ +.. code-block:: console + + sudo <build_dir>/app/dpdk-test-eventdev -c 0xf -s 0x1 --vdev=event_sw0 -- \
doc/guides/tools/testeventdev.rst +3
-0+ --test=perf_queue --plcores=2 --wlcore=3 --stlist=p --nb_pkts=0 \ + --prod_enq_burst_sz=32 +Example command to run perf queue test with ethernet ports:
.. code-block:: console
--
2.25.1
Re: [dpdk-dev] [EXT] [PATCH v3] app/test-eventdev: add burst enqueue support
Quoted 6 lines · Pavan Nikhilesh Bhagavatula
Quoted 6 lines
This commit introduces a new command line option
prod_enq_burst_szto set burst size for eventdev enqueue at producer inperf_queuetest. The newly added functionperf_producer_burstis called whenprod_enq_burst_szis greater than 1.
Quoted 6 lines
Quoted 2 lines
Signed-off-by Rashmi Shetty <[email protected]>LGTM
Acked-by Pavan Nikhilesh <[email protected]>
Applied to dpdk-next-eventdev/for-main. Thanks.
Quoted 332 lines
Quoted 331 lines
---
v3:
- Updatedtesteventdev.rstto document and show new command line option usage (Jerin)
- Usedmemset()to zero stack struct instead of = {NULL}; syntax (Jerin)---
app/test-eventdev/evt_common.h | 1 + app/test-eventdev/evt_main.c | 2 +- app/test-eventdev/evt_options.c | 14 +++++ app/test-eventdev/evt_options.h | 1 + app/test-eventdev/test_perf_common.c | 82 +++++++++++++++++++++++++++- app/test-eventdev/test_perf_common.h | 1 + doc/guides/tools/testeventdev.rst | 22 +++++++- 7 files changed, 117 insertions(+), 6 deletions(-)app/test- renamed from app/test-eventdev/evt_common.h +0
-0
eventdev/evt_common.h
index28afb114b3..f466434459100644app/test-eventdev/evt_common.h +1
-0@@ -64,6 +64,7 @@ struct evt_options {uint32_t nb_flows;uint32_t tx_first;uint32_t max_pkt_sz; +uint32_t prod_enq_burst_sz;uint32_t deq_tmo_nsec; uint32_t q_priority:1; uint32_t fwd_latency:1;app/test- renamed from app/test-eventdev/evt_main.c +0
-0
eventdev/evt_main.c
indexa8d304bab3..3534aabca7100644app/test-eventdev/evt_main.c +1
-1@@ -95,7 +95,7 @@ main(int argc, char **argv)/* Parse the command line arguments */ ret =evt_options_parse (&opt, argc, argv);if (ret) { -evt_err ("parsing on or more user options failed" ); +evt_err ("parsing one or more user options failed" ); goto error; }app/test- renamed from app/test-eventdev/evt_options.c +0
-0
eventdev/evt_options.c
indexb0bcbc6c96..753a7dbd7d100644app/test-eventdev/evt_options.c +11
-0@@ -26,6 +26,7 @@ evt_options_default(struct evt_options *opt) opt->nb_flows =1024 ; opt->socket_id =SOCKET_ID_ANY ; opt->pool_sz =16 *1024 ; + opt->prod_enq_burst_sz =1 ; opt->wkr_deq_dep =16 ; opt->nb_pkts = (1ULL <<26 );/* do ~64M packets */ opt->nb_timers =1E8 ;@@ -304,6 +305,16 @@ evt_parse_per_port_pool(struct evt_options *opt, const char *arg __rte_unused)return 0 ; } +static int +evt_parse_prod_enq_burst_sz (struct evt_options *opt,const char *arg) +{ +int ret; + + ret =parser_read_uint32 (&(opt->prod_enq_burst_sz), arg); + +return ret; +} +static void
usage(char *program)
{app/test-eventdev/evt_options.c +1
-0@@ -336,6 +347,7 @@ usage(char *program)"\t--expiry_nsec : event timer expiry ns.\n" "\t--mbuf_sz : packet mbuf size.\n" "\t--max_pkt_sz : max packet size.\n" + "\t--prod_enq_burst_sz : producer enqueue burstsize.\n"
"\t--nb_eth_queues : number of ethernet Rx
queues.\n"
"\t--enable_vector : enable event vectorization.\n"
"\t--vector_size : Max vector size.\n"app/test-eventdev/evt_options.c +2
-0@@ -412,6 +424,7 @@ static struct option lgopts[] = { { EVT_EXPIRY_NSEC, 1, 0, 0 }, { EVT_MBUF_SZ, 1, 0, 0 }, { EVT_MAX_PKT_SZ, 1, 0, 0 }, + { EVT_PROD_ENQ_BURST_SZ, 1, 0, 0 }, { EVT_NB_ETH_QUEUES, 1, 0, 0 }, { EVT_ENA_VECTOR, 0, 0, 0 }, { EVT_VECTOR_SZ, 1, 0, 0 },@@ -451,6 +464,7 @@ evt_opts_parse_long(int opt_idx, struct evt_options *opt) { EVT_EXPIRY_NSEC, evt_parse_expiry_nsec}, { EVT_MBUF_SZ, evt_parse_mbuf_sz}, { EVT_MAX_PKT_SZ, evt_parse_max_pkt_sz}, + { EVT_PROD_ENQ_BURST_SZ, evt_parse_prod_enq_burst_sz}, { EVT_NB_ETH_QUEUES, evt_parse_eth_queues},{
EVT_ENA_VECTOR,evt_parse_ena_vector}, {EVT_VECTOR_SZ,evt_parse_vector_size},app/test- renamed from app/test-eventdev/evt_options.h +0
-0
eventdev/evt_options.h
index6436200b40..413d7092f0100644app/test-eventdev/evt_options.h +1
-0@@ -42,6 +42,7 @@#define EVT_EXPIRY_NSEC ("expiry_nsec")#define EVT_MBUF_SZ ("mbuf_sz")#define EVT_MAX_PKT_SZ ("max_pkt_sz") +#define EVT_PROD_ENQ_BURST_SZ ("prod_enq_burst_sz")#define EVT_NB_ETH_QUEUES ("nb_eth_queues")#define EVT_ENA_VECTOR ("enable_vector")#define EVT_VECTOR_SZ ("vector_size")app/test- renamed from app/test-eventdev/test_perf_common.c +0
-0
eventdev/test_perf_common.c
indexcc100650c2..6d0806183d100644app/test-eventdev/test_perf_common.c +29
-0@@ -77,6 +77,71 @@ perf_producer(void *arg)return 0 ; } +static inline int +perf_producer_burst (void *arg) +{ +uint32_t i; +uint64_t timestamp; +struct rte_event_dev_info dev_info; +struct prod_data *p = arg; +struct test_perf *t = p->t; +struct evt_options *opt = t->opt; +const uint8_t dev_id = p->dev_id; +const uint8_t port = p->port_id; +struct rte_mempool *pool = t->pool; +const uint64_t nb_pkts = t->nb_pkts; +const uint32_t nb_flows = t->nb_flows; +uint32_t flow_counter =0 ; +uint16_t enq =0 ; +uint64_t count =0 ; +struct perf_elt *m[MAX_PROD_ENQ_BURST_SIZE +1 ]; +struct rte_event ev[MAX_PROD_ENQ_BURST_SIZE +1 ]; +uint32_t burst_size = opt->prod_enq_burst_sz; + +memset (m,0 ,sizeof (*m) * (MAX_PROD_ENQ_BURST_SIZE +1 )); +rte_event_dev_info_get (dev_id, &dev_info); +if (dev_info.max_event_port_enqueue_depth < burst_size) + burst_size = dev_info.max_event_port_enqueue_depth; + +if (opt->verbose_level >1 ) + printf("%s(): lcore %d dev_id %d port=%d queue %d\n", __func__, + rte_lcore_id(), dev_id, port, p-Quoted 1 line
queue_id);app/test-eventdev/test_perf_common.c +12
-0+ +for (i =0 ; i < burst_size; i++) { + ev[i].op =RTE_EVENT_OP_NEW ; + ev[i].queue_id = p->queue_id; + ev[i].sched_type = t->opt->sched_type_list[0 ]; + ev[i].priority =RTE_EVENT_DEV_PRIORITY_NORMAL ; + ev[i].event_type =RTE_EVENT_TYPE_CPU ; + ev[i].sub_event_type =0 ;/* stage 0 */ + } + +while (count < nb_pkts && t->done == false) { + if (rte_mempool_get_bulk(pool, (void **)m,
burst_size) < 0)app/test-eventdev/test_perf_common.c +8
-0+continue ; + timestamp =rte_get_timer_cycles (); +for (i =0 ; i < burst_size; i++) { + ev[i].flow_id = flow_counter++ % nb_flows; + ev[i].event_ptr = m[i]; + m[i]->timestamp = timestamp; + } + enq = rte_event_enqueue_burst(dev_id, port, ev,
burst_size);app/test-eventdev/test_perf_common.c +2
-0+while (enq < burst_size) { + enq += rte_event_enqueue_burst(dev_id,port,
app/test-eventdev/test_perf_common.c +2
-0+ ev + enq, + burst_size -enq);
app/test-eventdev/test_perf_common.c +12
-0+if (t->done) +break ; +rte_pause (); + timestamp =rte_get_timer_cycles (); +for (i = enq; i < burst_size; i++) + m[i]->timestamp = timestamp; + } + count += burst_size; + } +return 0 ; +} +static inline int
perf_event_timer_producer(void *arg)
{app/test-eventdev/test_perf_common.c +0
-1@@ -212,9 +277,21 @@ perf_producer_wrapper(void *arg) {struct prod_data *p = arg;struct test_perf *t = p->t; -/* Launch the producer function only in case of synthetic producer. */
app/test-eventdev/test_perf_common.c +4
-1-if (t->opt->prod_type ==EVT_PROD_TYPE_SYNT ) +bool burst =evt_has_burst_mode (p->dev_id); + +/* In case of synthetic producer, launch perf_producer or +* perf_producer_burst depending on producer enqueue burst size
app/test-eventdev/test_perf_common.c +7
-0+*/ +if (t->opt->prod_type ==EVT_PROD_TYPE_SYNT && + t->opt->prod_enq_burst_sz ==1 )return perf_producer (arg); +else if (t->opt->prod_type ==EVT_PROD_TYPE_SYNT && + t->opt->prod_enq_burst_sz >1 ) { +if (!burst) + evt_err("This event device does not supportburst mode");
app/test-eventdev/test_perf_common.c +3
-0+else +return perf_producer_burst (arg); + } else if (t->opt->prod_type ==
EVT_PROD_TYPE_EVENT_TIMER_ADPTR&&!t->opt->timdev_use_burst) return perf_event_timer_producer(arg);app/test-eventdev/test_perf_common.c +1
-0@@ -635,6 +712,7 @@ perf_opt_dump(struct evt_options *opt, uint8_t nb_queues)evt_dump_queue_priority (opt );evt_dump_sched_type_list (opt);evt_dump_producer_type (opt); +evt_dump ("prod_enq_burst_sz" ,"%d" , opt- >prod_enq_burst_sz); }void
app/test- renamed from app/test-eventdev/test_perf_common.h +0
-0
eventdev/test_perf_common.h
index9785dc3e23..14dcf80429100644app/test-eventdev/test_perf_common.h +1
-0@@ -71,6 +71,7 @@ struct perf_elt { } __rte_cache_aligned;#define BURST_SIZE 16 +#define MAX_PROD_ENQ_BURST_SIZE 128#define PERF_WORKER_INIT \ struct worker_data *w = arg;\doc/guides/tools/testeventdev.rst +0
-0@@ -155,9 +155,15 @@ The following are the application command-lineoptions:
* ``--max_pkt_sz``
- Set max packet mbuf size. Can be used configure Rx/Tx scatter
gather.
+ Set max packet mbuf size. Can be used to configure Rx/Tx scatter
gather.
Only applicable forpipeline_atqandpipeline_queuetests.doc/guides/tools/testeventdev.rst +3
-0+* ``--prod_enq_burst_sz`` + + Set producer enqueue burst size. Can be used to configure thenumber of
+ events the producer(s) will enqueue as a burst to the event
device.doc/guides/tools/testeventdev.rst +2
-0+ Only applicable for `perf_queue` test. +* ``--nb_eth_queues``
Configure multiple Rx queues per each ethernet port.
doc/guides/tools/testeventdev.rst +0
-0@@ -374,8 +380,9 @@ The user can choose the number of workers, thenumber of producers and number of
stages through the ``--wlcores``, ``--plcores`` and the ``--stlist`` application
command line arguments respectively.-The producer(s) injects the events to eventdev based the first stage sched type
-list requested by the user through ``--stlist`` the command line argument.
+The producer(s) injects the events to eventdev based on the first stage sched type
+list requested by the user through ``--stlist`` command line argument. It can
+inject a burst of events using ``--prod_enq_burst_sz`` command line argument.Based on the number of stages to process(selected through ``--stlist``), The application forwards the event to next upstream queue and terminates when it
doc/guides/tools/testeventdev.rst +0
-0@@ -413,6 +420,7 @@ Supported application command line options arefollowing::
--prod_type_ethdev
--prod_type_timerdev_burst
--prod_type_timerdevdoc/guides/tools/testeventdev.rst +2
-0+ --prod_enq_burst_sz --timer_tick_nsec --max_tmo_nsec --expiry_nsec@@ -430,6 +438,14 @@ Example command to run perf queue test: sudo <build_dir>/app/dpdk-test-eventdev -c 0xf -s 0x1 -- vdev=event_sw0 -- \ --test=perf_queue --plcores=2 --wlcore=3 --stlist=p --nb_pkts=0 +Example command to run perf queue test with producer enqueuing aburst of events:
doc/guides/tools/testeventdev.rst +4
-0+ +.. code-block:: console + + sudo <build_dir>/app/dpdk-test-eventdev -c 0xf -s 0x1 --vdev=event_sw0 -- \
doc/guides/tools/testeventdev.rst +3
-0+ --test=perf_queue --plcores=2 --wlcore=3 --stlist=p --nb_pkts=0 \ + --prod_enq_burst_sz=32 +Example command to run perf queue test with ethernet ports:
.. code-block:: console
--
2.25.1