* [dpdk-dev] [PATCH 0/8] app/eventdev: add event eth Rx adapter support
@ 2017-10-18 12:39 Pavan Nikhilesh
2017-10-18 12:39 ` [dpdk-dev] [PATCH 1/8] app/eventdev: add ethernet device producer option Pavan Nikhilesh
` (10 more replies)
0 siblings, 11 replies; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-10-18 12:39 UTC (permalink / raw)
To: bruce.richardson, harry.van.haaren, gage.eads, hemant.agrawal,
nipun.gupta, nikhil.rao, santosh.shukla, jerin.jacob
Cc: dev, Pavan Nikhilesh
The eventdev application uses producer lcores to inject packets as events
into the event device. This approach is suitable for doing synthetic
performance benchmarks. In most real-world scenarios the packets are
received by an Ethernet device.
The Event Ethernet Rx Adapter library enables packet transfer between
ethernet dev and event dev transparently. This patch series adds an option
'--prod_type_ethdev' to configure the attached Ethernet devices as Rx adapters
and use them as producers instead of using synthetic producer cores. Also, this
is an RX only case.
The application has been verified on both sw and hw event devices using the
command:
./build/app/dpdk-test-eventdev -c 0xfffff1 -s 0xf0000 --vdev="event_*"
-- --wlcores 12 --test perf_queue --verbose 20 --stlist=a
--prod_type_ethdev
Pavan Nikhilesh (8):
app/eventdev: add ethernet device producer option
app/eventdev: modify app setup to support ethdev
app/eventdev: add pktmbuf pool for ethdev
app/eventdev: add ethernet device setup helpers
app/eventdev: add ethernet device tear down
app/eventdev: add event Rx adapter setup
app/eventdev: add service core configuration
doc: update app eventdev options
app/test-eventdev/evt_common.h | 41 +++---
app/test-eventdev/evt_options.c | 11 ++
app/test-eventdev/evt_options.h | 29 ++++
app/test-eventdev/test_perf_atq.c | 32 +++--
app/test-eventdev/test_perf_common.c | 269 ++++++++++++++++++++++++++++++-----
app/test-eventdev/test_perf_common.h | 4 +
app/test-eventdev/test_perf_queue.c | 35 +++--
doc/guides/tools/testeventdev.rst | 15 ++
8 files changed, 361 insertions(+), 75 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH 1/8] app/eventdev: add ethernet device producer option
2017-10-18 12:39 [dpdk-dev] [PATCH 0/8] app/eventdev: add event eth Rx adapter support Pavan Nikhilesh
@ 2017-10-18 12:39 ` Pavan Nikhilesh
2017-12-10 8:34 ` Jerin Jacob
2017-10-18 12:39 ` [dpdk-dev] [PATCH 2/8] app/eventdev: modify app setup to support ethdev Pavan Nikhilesh
` (9 subsequent siblings)
10 siblings, 1 reply; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-10-18 12:39 UTC (permalink / raw)
To: bruce.richardson, harry.van.haaren, gage.eads, hemant.agrawal,
nipun.gupta, nikhil.rao, santosh.shukla, jerin.jacob
Cc: dev, Pavan Nikhilesh
Add command line option --prod_type_ethdev to specify that the events
are generated by ethernet device.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
app/test-eventdev/evt_options.c | 11 +++++++++++
app/test-eventdev/evt_options.h | 29 +++++++++++++++++++++++++++++
app/test-eventdev/test_perf_common.c | 34 ++++++++++++++++++++--------------
3 files changed, 60 insertions(+), 14 deletions(-)
diff --git a/app/test-eventdev/evt_options.c b/app/test-eventdev/evt_options.c
index e2187df..7db7cd9 100644
--- a/app/test-eventdev/evt_options.c
+++ b/app/test-eventdev/evt_options.c
@@ -55,6 +55,7 @@ evt_options_default(struct evt_options *opt)
opt->pool_sz = 16 * 1024;
opt->wkr_deq_dep = 16;
opt->nb_pkts = (1ULL << 26); /* do ~64M packets */
+ opt->prod_type = EVT_PROD_TYPE_SYNT;
}
typedef int (*option_parser_t)(struct evt_options *opt,
@@ -107,6 +108,13 @@ evt_parse_queue_priority(struct evt_options *opt, const char *arg __rte_unused)
}
static int
+evt_parse_prod_type(struct evt_options *opt, const char *arg __rte_unused)
+{
+ opt->prod_type = EVT_PROD_TYPE_ETH_RX_ADPTR;
+ return 0;
+}
+
+static int
evt_parse_test_name(struct evt_options *opt, const char *arg)
{
snprintf(opt->test_name, EVT_TEST_NAME_MAX_LEN, "%s", arg);
@@ -189,6 +197,7 @@ usage(char *program)
"\t--worker_deq_depth : dequeue depth of the worker\n"
"\t--fwd_latency : perform fwd_latency measurement\n"
"\t--queue_priority : enable queue priority\n"
+ "\t--prod_type_ethdev : use ethernet device as producer\n."
);
printf("available tests:\n");
evt_test_dump_names();
@@ -249,6 +258,7 @@ static struct option lgopts[] = {
{ EVT_SCHED_TYPE_LIST, 1, 0, 0 },
{ EVT_FWD_LATENCY, 0, 0, 0 },
{ EVT_QUEUE_PRIORITY, 0, 0, 0 },
+ { EVT_PROD_ETHDEV, 0, 0, 0 },
{ EVT_HELP, 0, 0, 0 },
{ NULL, 0, 0, 0 }
};
@@ -272,6 +282,7 @@ evt_opts_parse_long(int opt_idx, struct evt_options *opt)
{ EVT_SCHED_TYPE_LIST, evt_parse_sched_type_list},
{ EVT_FWD_LATENCY, evt_parse_fwd_latency},
{ EVT_QUEUE_PRIORITY, evt_parse_queue_priority},
+ { EVT_PROD_ETHDEV, evt_parse_prod_type},
};
for (i = 0; i < RTE_DIM(parsermap); i++) {
diff --git a/app/test-eventdev/evt_options.h b/app/test-eventdev/evt_options.h
index a9a9125..a6607e1 100644
--- a/app/test-eventdev/evt_options.h
+++ b/app/test-eventdev/evt_options.h
@@ -58,8 +58,16 @@
#define EVT_SCHED_TYPE_LIST ("stlist")
#define EVT_FWD_LATENCY ("fwd_latency")
#define EVT_QUEUE_PRIORITY ("queue_priority")
+#define EVT_PROD_ETHDEV ("prod_type_ethdev")
#define EVT_HELP ("help")
+enum evt_prod_type {
+ EVT_PROD_TYPE_NONE,
+ EVT_PROD_TYPE_SYNT, /* Producer type Synthetic i.e. CPU. */
+ EVT_PROD_TYPE_ETH_RX_ADPTR, /* Producer type Eth Rx Adapter. */
+ EVT_PROD_TYPE_MAX,
+};
+
struct evt_options {
#define EVT_TEST_NAME_MAX_LEN 32
char test_name[EVT_TEST_NAME_MAX_LEN];
@@ -76,6 +84,7 @@ struct evt_options {
uint8_t dev_id;
uint32_t fwd_latency:1;
uint32_t q_priority:1;
+ enum evt_prod_type prod_type;
};
void evt_options_default(struct evt_options *opt);
@@ -266,4 +275,24 @@ evt_dump_sched_type_list(struct evt_options *opt)
evt_dump_end;
}
+#define EVT_PROD_MAX_NAME_LEN 50
+static inline void
+evt_dump_producer_type(struct evt_options *opt)
+{
+ char name[EVT_PROD_MAX_NAME_LEN];
+
+ switch (opt->prod_type) {
+ default:
+ case EVT_PROD_TYPE_SYNT:
+ snprintf(name, EVT_PROD_MAX_NAME_LEN,
+ "Synthetic producer lcores");
+ break;
+ case EVT_PROD_TYPE_ETH_RX_ADPTR:
+ snprintf(name, EVT_PROD_MAX_NAME_LEN,
+ "Rx Adapter producers");
+ break;
+ }
+ evt_dump("prod_type", "%s", name);
+}
+
#endif /* _EVT_OPTIONS_ */
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index e77b472..9d2865e 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -287,8 +287,10 @@ perf_opt_check(struct evt_options *opt, uint64_t nb_queues)
{
unsigned int lcores;
- /* N producer + N worker + 1 master */
- lcores = 3;
+ /* N producer + N worker + 1 master when producer cores are used
+ * Else N worker + 1 master when Rx adapter is used
+ */
+ lcores = opt->prod_type == EVT_PROD_TYPE_SYNT ? 3 : 2;
if (rte_lcore_count() < lcores) {
evt_err("test need minimum %d lcores", lcores);
@@ -313,18 +315,21 @@ perf_opt_check(struct evt_options *opt, uint64_t nb_queues)
return -1;
}
- /* Validate producer lcores */
- if (evt_lcores_has_overlap(opt->plcores, rte_get_master_lcore())) {
- evt_err("producer lcores overlaps with master lcore");
- return -1;
- }
- if (evt_has_disabled_lcore(opt->plcores)) {
- evt_err("one or more producer lcores are not enabled");
- return -1;
- }
- if (!evt_has_active_lcore(opt->plcores)) {
- evt_err("minimum one producer is required");
- return -1;
+ if (opt->prod_type == EVT_PROD_TYPE_SYNT) {
+ /* Validate producer lcores */
+ if (evt_lcores_has_overlap(opt->plcores,
+ rte_get_master_lcore())) {
+ evt_err("producer lcores overlaps with master lcore");
+ return -1;
+ }
+ if (evt_has_disabled_lcore(opt->plcores)) {
+ evt_err("one or more producer lcores are not enabled");
+ return -1;
+ }
+ if (!evt_has_active_lcore(opt->plcores)) {
+ evt_err("minimum one producer is required");
+ return -1;
+ }
}
if (evt_has_invalid_stage(opt))
@@ -369,6 +374,7 @@ perf_opt_dump(struct evt_options *opt, uint8_t nb_queues)
evt_dump("nb_evdev_queues", "%d", nb_queues);
evt_dump_queue_priority(opt);
evt_dump_sched_type_list(opt);
+ evt_dump_producer_type(opt);
}
void
--
2.7.4
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH 2/8] app/eventdev: modify app setup to support ethdev
2017-10-18 12:39 [dpdk-dev] [PATCH 0/8] app/eventdev: add event eth Rx adapter support Pavan Nikhilesh
2017-10-18 12:39 ` [dpdk-dev] [PATCH 1/8] app/eventdev: add ethernet device producer option Pavan Nikhilesh
@ 2017-10-18 12:39 ` Pavan Nikhilesh
2017-12-10 11:56 ` Jerin Jacob
2017-10-18 12:39 ` [dpdk-dev] [PATCH 3/8] app/eventdev: add pktmbuf pool for ethdev Pavan Nikhilesh
` (8 subsequent siblings)
10 siblings, 1 reply; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-10-18 12:39 UTC (permalink / raw)
To: bruce.richardson, harry.van.haaren, gage.eads, hemant.agrawal,
nipun.gupta, nikhil.rao, santosh.shukla, jerin.jacob
Cc: dev, Pavan Nikhilesh
Modify app setup to accommodate event port and queue setup based on the
number of ethernet ports.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
app/test-eventdev/test_perf_atq.c | 18 ++++++++++++++----
app/test-eventdev/test_perf_common.c | 27 +++++++++++++++++++++------
app/test-eventdev/test_perf_common.h | 1 +
app/test-eventdev/test_perf_queue.c | 21 ++++++++++++++++-----
4 files changed, 52 insertions(+), 15 deletions(-)
diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c
index 0e9f2db..f6fd5d9 100644
--- a/app/test-eventdev/test_perf_atq.c
+++ b/app/test-eventdev/test_perf_atq.c
@@ -185,10 +185,20 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
{
int ret;
uint8_t queue;
+ uint8_t nb_queues;
+ uint8_t nb_ports;
+ RTE_SET_USED(test);
+
+ nb_ports = evt_nr_active_lcores(opt->wlcores);
+ nb_ports += opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ? 0 :
+ evt_nr_active_lcores(opt->plcores);
+
+ nb_queues = opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ?
+ rte_eth_dev_count() : atq_nb_event_queues(opt);
const struct rte_event_dev_config config = {
- .nb_event_queues = atq_nb_event_queues(opt),
- .nb_event_ports = perf_nb_event_ports(opt),
+ .nb_event_queues = nb_queues,
+ .nb_event_ports = nb_ports,
.nb_events_limit = 4096,
.nb_event_queue_flows = opt->nb_flows,
.nb_event_port_dequeue_depth = 128,
@@ -208,7 +218,7 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
.nb_atomic_order_sequences = opt->nb_flows,
};
/* queue configurations */
- for (queue = 0; queue < atq_nb_event_queues(opt); queue++) {
+ for (queue = 0; queue < nb_queues; queue++) {
ret = rte_event_queue_setup(opt->dev_id, queue, &q_conf);
if (ret) {
evt_err("failed to setup queue=%d", queue);
@@ -217,7 +227,7 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
}
ret = perf_event_dev_port_setup(test, opt, 1 /* stride */,
- atq_nb_event_queues(opt));
+ nb_queues);
if (ret)
return ret;
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index 9d2865e..f7961be 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -88,6 +88,18 @@ perf_producer(void *arg)
return 0;
}
+static int
+perf_producer_wrapper(void *arg)
+{
+ RTE_SET_USED(arg);
+ struct prod_data *p = arg;
+ struct test_perf *t = p->t;
+ /* Launch the producer function only in case of synthetic producer. */
+ if (t->opt->prod_type == EVT_PROD_TYPE_SYNT)
+ return perf_producer(arg);
+ return 0;
+}
+
static inline uint64_t
processed_pkts(struct test_perf *t)
{
@@ -142,8 +154,8 @@ perf_launch_lcores(struct evt_test *test, struct evt_options *opt,
if (!(opt->plcores[lcore_id]))
continue;
- ret = rte_eal_remote_launch(perf_producer, &t->prod[port_idx],
- lcore_id);
+ ret = rte_eal_remote_launch(perf_producer_wrapper,
+ &t->prod[port_idx], lcore_id);
if (ret) {
evt_err("failed to launch perf_producer %d", lcore_id);
return ret;
@@ -193,14 +205,17 @@ perf_launch_lcores(struct evt_test *test, struct evt_options *opt,
fflush(stdout);
if (remaining <= 0) {
- t->done = true;
t->result = EVT_TEST_SUCCESS;
- rte_smp_wmb();
- break;
+ if (opt->prod_type == EVT_PROD_TYPE_SYNT) {
+ t->done = true;
+ rte_smp_wmb();
+ break;
+ }
}
}
- if (new_cycles - dead_lock_cycles > dead_lock_sample) {
+ if (new_cycles - dead_lock_cycles > dead_lock_sample &&
+ opt->prod_type == EVT_PROD_TYPE_SYNT) {
remaining = t->outstand_pkts - processed_pkts(t);
if (dead_lock_remaining == remaining) {
rte_event_dev_dump(opt->dev_id, stdout);
diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h
index c6fc70c..ab2e599 100644
--- a/app/test-eventdev/test_perf_common.h
+++ b/app/test-eventdev/test_perf_common.h
@@ -38,6 +38,7 @@
#include <unistd.h>
#include <rte_cycles.h>
+#include <rte_ethdev.h>
#include <rte_eventdev.h>
#include <rte_lcore.h>
#include <rte_malloc.h>
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index c0ea894..3467bb5 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -182,10 +182,21 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
uint8_t queue;
int nb_stages = opt->nb_stages;
int ret;
+ int nb_ports;
+ int nb_queues;
+ RTE_SET_USED(test);
+
+ nb_ports = evt_nr_active_lcores(opt->wlcores);
+ nb_ports += opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ? 0 :
+ evt_nr_active_lcores(opt->plcores);
+
+ nb_queues = opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ?
+ rte_eth_dev_count() * nb_stages :
+ perf_queue_nb_event_queues(opt);
const struct rte_event_dev_config config = {
- .nb_event_queues = perf_queue_nb_event_queues(opt),
- .nb_event_ports = perf_nb_event_ports(opt),
+ .nb_event_queues = nb_queues,
+ .nb_event_ports = nb_ports,
.nb_events_limit = 4096,
.nb_event_queue_flows = opt->nb_flows,
.nb_event_port_dequeue_depth = 128,
@@ -204,8 +215,8 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
.nb_atomic_order_sequences = opt->nb_flows,
};
/* queue configurations */
- for (queue = 0; queue < perf_queue_nb_event_queues(opt); queue++) {
- q_conf.event_queue_cfg =
+ for (queue = 0; queue < nb_queues; queue++) {
+ q_conf.schedule_type =
(opt->sched_type_list[queue % nb_stages]);
if (opt->q_priority) {
@@ -228,7 +239,7 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
}
ret = perf_event_dev_port_setup(test, opt, nb_stages /* stride */,
- perf_queue_nb_event_queues(opt));
+ nb_queues);
if (ret)
return ret;
--
2.7.4
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH 3/8] app/eventdev: add pktmbuf pool for ethdev
2017-10-18 12:39 [dpdk-dev] [PATCH 0/8] app/eventdev: add event eth Rx adapter support Pavan Nikhilesh
2017-10-18 12:39 ` [dpdk-dev] [PATCH 1/8] app/eventdev: add ethernet device producer option Pavan Nikhilesh
2017-10-18 12:39 ` [dpdk-dev] [PATCH 2/8] app/eventdev: modify app setup to support ethdev Pavan Nikhilesh
@ 2017-10-18 12:39 ` Pavan Nikhilesh
2017-12-10 12:01 ` Jerin Jacob
2017-10-18 12:39 ` [dpdk-dev] [PATCH 4/8] app/eventdev: add ethernet device setup helpers Pavan Nikhilesh
` (7 subsequent siblings)
10 siblings, 1 reply; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-10-18 12:39 UTC (permalink / raw)
To: bruce.richardson, harry.van.haaren, gage.eads, hemant.agrawal,
nipun.gupta, nikhil.rao, santosh.shukla, jerin.jacob
Cc: dev, Pavan Nikhilesh
Add pktmbuf pool creation used when configuring ethernet device as event
producer.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
app/test-eventdev/test_perf_common.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index f7961be..b26d694 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -413,13 +413,24 @@ perf_mempool_setup(struct evt_test *test, struct evt_options *opt)
{
struct test_perf *t = evt_test_priv(test);
- t->pool = rte_mempool_create(test->name, /* mempool name */
+ if (opt->prod_type == EVT_PROD_TYPE_SYNT) {
+ t->pool = rte_mempool_create(test->name, /* mempool name */
opt->pool_sz, /* number of elements*/
sizeof(struct perf_elt), /* element size*/
512, /* cache size*/
0, NULL, NULL,
perf_elt_init, /* obj constructor */
NULL, opt->socket_id, 0); /* flags */
+ } else {
+ t->pool = rte_pktmbuf_pool_create(test->name, /* mempool name */
+ opt->pool_sz, /* number of elements*/
+ 0, /* cache size*/
+ 0,
+ RTE_MBUF_DEFAULT_BUF_SIZE,
+ opt->socket_id); /* flags */
+
+ }
+
if (t->pool == NULL) {
evt_err("failed to create mempool");
return -ENOMEM;
--
2.7.4
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH 4/8] app/eventdev: add ethernet device setup helpers
2017-10-18 12:39 [dpdk-dev] [PATCH 0/8] app/eventdev: add event eth Rx adapter support Pavan Nikhilesh
` (2 preceding siblings ...)
2017-10-18 12:39 ` [dpdk-dev] [PATCH 3/8] app/eventdev: add pktmbuf pool for ethdev Pavan Nikhilesh
@ 2017-10-18 12:39 ` Pavan Nikhilesh
2017-12-10 12:09 ` Jerin Jacob
2017-10-18 12:39 ` [dpdk-dev] [PATCH 5/8] app/eventdev: add ethernet device tear down Pavan Nikhilesh
` (6 subsequent siblings)
10 siblings, 1 reply; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-10-18 12:39 UTC (permalink / raw)
To: bruce.richardson, harry.van.haaren, gage.eads, hemant.agrawal,
nipun.gupta, nikhil.rao, santosh.shukla, jerin.jacob
Cc: dev, Pavan Nikhilesh
Add ethernet device setup functions to configure ethdev ports incase
prod_type_ethdev option is enabled.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
app/test-eventdev/test_perf_atq.c | 1 +
app/test-eventdev/test_perf_common.c | 72 ++++++++++++++++++++++++++++++++++++
app/test-eventdev/test_perf_common.h | 1 +
app/test-eventdev/test_perf_queue.c | 1 +
4 files changed, 75 insertions(+)
diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c
index f6fd5d9..aec50a8 100644
--- a/app/test-eventdev/test_perf_atq.c
+++ b/app/test-eventdev/test_perf_atq.c
@@ -281,6 +281,7 @@ static const struct evt_test_ops perf_atq = {
.opt_check = perf_atq_opt_check,
.opt_dump = perf_atq_opt_dump,
.test_setup = perf_test_setup,
+ .ethdev_setup = perf_ethdev_setup,
.mempool_setup = perf_mempool_setup,
.eventdev_setup = perf_atq_eventdev_setup,
.launch_lcores = perf_atq_launch_lcores,
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index b26d694..ebf8900 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -408,6 +408,78 @@ perf_elt_init(struct rte_mempool *mp, void *arg __rte_unused,
memset(obj, 0, mp->elt_size);
}
+#define NB_RX_DESC 128
+#define NB_TX_DESC 512
+int
+perf_ethdev_setup(struct evt_test *test, struct evt_options *opt)
+{
+ uint16_t nb_rx_queues = 1;
+ int i;
+ int j;
+ struct test_perf *t = evt_test_priv(test);
+ struct rte_eth_conf port_conf = {
+ .rxmode = {
+ .mq_mode = ETH_MQ_RX_RSS,
+ .max_rx_pkt_len = ETHER_MAX_LEN,
+ .split_hdr_size = 0,
+ .header_split = 0,
+ .hw_ip_checksum = 0,
+ .hw_vlan_filter = 0,
+ .hw_vlan_strip = 0,
+ .hw_vlan_extend = 0,
+ .jumbo_frame = 0,
+ .hw_strip_crc = 1,
+ },
+ .rx_adv_conf = {
+ .rss_conf = {
+ .rss_key = NULL,
+ .rss_hf = ETH_RSS_IP,
+ },
+ },
+ };
+
+ if (opt->prod_type == EVT_PROD_TYPE_SYNT)
+ return 0;
+
+ if (!rte_eth_dev_count()) {
+ evt_err("No ethernet ports found.\n");
+ return -ENODEV;
+ }
+
+ for (i = 0; i < rte_eth_dev_count(); i++) {
+
+ if (rte_eth_dev_configure(i, nb_rx_queues, nb_rx_queues,
+ &port_conf)
+ < 0) {
+ evt_err("Failed to configure eth port [%d]\n", i);
+ return -EINVAL;
+ }
+
+ for (j = 0; j < nb_rx_queues; j++) {
+ if (rte_eth_rx_queue_setup(i, j, NB_RX_DESC,
+ rte_socket_id(), NULL, t->pool) < 0) {
+ evt_err("Failed to setup eth port [%d]"
+ " rx_queue: %d."
+ " Using synthetic producer\n",
+ i, j);
+ return -EINVAL;
+ }
+ if (rte_eth_tx_queue_setup(i, j, NB_TX_DESC,
+ rte_socket_id(), NULL) < 0) {
+ evt_err("Failed to setup eth port [%d]"
+ " tx_queue: %d."
+ " Using synthetic producer\n",
+ i, j);
+ return -EINVAL;
+ }
+ }
+
+ rte_eth_promiscuous_enable(i);
+ }
+
+ return 0;
+}
+
int
perf_mempool_setup(struct evt_test *test, struct evt_options *opt)
{
diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h
index ab2e599..5c6a615 100644
--- a/app/test-eventdev/test_perf_common.h
+++ b/app/test-eventdev/test_perf_common.h
@@ -157,6 +157,7 @@ perf_nb_event_ports(struct evt_options *opt)
int perf_test_result(struct evt_test *test, struct evt_options *opt);
int perf_opt_check(struct evt_options *opt, uint64_t nb_queues);
int perf_test_setup(struct evt_test *test, struct evt_options *opt);
+int perf_ethdev_setup(struct evt_test *test, struct evt_options *opt);
int perf_mempool_setup(struct evt_test *test, struct evt_options *opt);
int perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
uint8_t stride, uint8_t nb_queues);
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index 3467bb5..4f3e7e7 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -294,6 +294,7 @@ static const struct evt_test_ops perf_queue = {
.opt_dump = perf_queue_opt_dump,
.test_setup = perf_test_setup,
.mempool_setup = perf_mempool_setup,
+ .ethdev_setup = perf_ethdev_setup,
.eventdev_setup = perf_queue_eventdev_setup,
.launch_lcores = perf_queue_launch_lcores,
.eventdev_destroy = perf_eventdev_destroy,
--
2.7.4
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH 5/8] app/eventdev: add ethernet device tear down
2017-10-18 12:39 [dpdk-dev] [PATCH 0/8] app/eventdev: add event eth Rx adapter support Pavan Nikhilesh
` (3 preceding siblings ...)
2017-10-18 12:39 ` [dpdk-dev] [PATCH 4/8] app/eventdev: add ethernet device setup helpers Pavan Nikhilesh
@ 2017-10-18 12:39 ` Pavan Nikhilesh
2017-12-10 12:10 ` Jerin Jacob
2017-10-18 12:39 ` [dpdk-dev] [PATCH 6/8] app/eventdev: add event Rx adapter setup Pavan Nikhilesh
` (5 subsequent siblings)
10 siblings, 1 reply; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-10-18 12:39 UTC (permalink / raw)
To: bruce.richardson, harry.van.haaren, gage.eads, hemant.agrawal,
nipun.gupta, nikhil.rao, santosh.shukla, jerin.jacob
Cc: dev, Pavan Nikhilesh
Add ethernet device destroy functions to stop and close ethdev ports
if they are configured when prod_type_ethdev option is enabled.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
app/test-eventdev/test_perf_atq.c | 1 +
app/test-eventdev/test_perf_common.c | 13 +++++++++++++
app/test-eventdev/test_perf_common.h | 1 +
app/test-eventdev/test_perf_queue.c | 1 +
4 files changed, 16 insertions(+)
diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c
index aec50a8..8bc701b 100644
--- a/app/test-eventdev/test_perf_atq.c
+++ b/app/test-eventdev/test_perf_atq.c
@@ -287,6 +287,7 @@ static const struct evt_test_ops perf_atq = {
.launch_lcores = perf_atq_launch_lcores,
.eventdev_destroy = perf_eventdev_destroy,
.mempool_destroy = perf_mempool_destroy,
+ .ethdev_destroy = perf_ethdev_destroy,
.test_result = perf_test_result,
.test_destroy = perf_test_destroy,
};
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index ebf8900..04c0c65 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -480,6 +480,19 @@ perf_ethdev_setup(struct evt_test *test, struct evt_options *opt)
return 0;
}
+void perf_ethdev_destroy(struct evt_test *test, struct evt_options *opt)
+{
+ int i;
+ RTE_SET_USED(test);
+
+ if (opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR) {
+ for (i = 0; i < rte_eth_dev_count(); i++) {
+ rte_eth_dev_stop(i);
+ rte_eth_dev_close(i);
+ }
+ }
+}
+
int
perf_mempool_setup(struct evt_test *test, struct evt_options *opt)
{
diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h
index 5c6a615..f333656 100644
--- a/app/test-eventdev/test_perf_common.h
+++ b/app/test-eventdev/test_perf_common.h
@@ -167,6 +167,7 @@ int perf_launch_lcores(struct evt_test *test, struct evt_options *opt,
void perf_opt_dump(struct evt_options *opt, uint8_t nb_queues);
void perf_test_destroy(struct evt_test *test, struct evt_options *opt);
void perf_eventdev_destroy(struct evt_test *test, struct evt_options *opt);
+void perf_ethdev_destroy(struct evt_test *test, struct evt_options *opt);
void perf_mempool_destroy(struct evt_test *test, struct evt_options *opt);
#endif /* _TEST_PERF_COMMON_ */
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index 4f3e7e7..16e2c9d 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -299,6 +299,7 @@ static const struct evt_test_ops perf_queue = {
.launch_lcores = perf_queue_launch_lcores,
.eventdev_destroy = perf_eventdev_destroy,
.mempool_destroy = perf_mempool_destroy,
+ .ethdev_destroy = perf_ethdev_destroy,
.test_result = perf_test_result,
.test_destroy = perf_test_destroy,
};
--
2.7.4
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH 6/8] app/eventdev: add event Rx adapter setup
2017-10-18 12:39 [dpdk-dev] [PATCH 0/8] app/eventdev: add event eth Rx adapter support Pavan Nikhilesh
` (4 preceding siblings ...)
2017-10-18 12:39 ` [dpdk-dev] [PATCH 5/8] app/eventdev: add ethernet device tear down Pavan Nikhilesh
@ 2017-10-18 12:39 ` Pavan Nikhilesh
2017-12-10 12:13 ` Jerin Jacob
2017-10-18 12:39 ` [dpdk-dev] [PATCH 7/8] app/eventdev: add service core configuration Pavan Nikhilesh
` (4 subsequent siblings)
10 siblings, 1 reply; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-10-18 12:39 UTC (permalink / raw)
To: bruce.richardson, harry.van.haaren, gage.eads, hemant.agrawal,
nipun.gupta, nikhil.rao, santosh.shukla, jerin.jacob
Cc: dev, Pavan Nikhilesh
Add functions to setup and configure Rx adapter based on the number of
ethdev ports setup.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
app/test-eventdev/test_perf_common.c | 97 ++++++++++++++++++++++++++++++------
app/test-eventdev/test_perf_common.h | 1 +
2 files changed, 84 insertions(+), 14 deletions(-)
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index 04c0c65..0ade1dc 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -232,12 +232,68 @@ perf_launch_lcores(struct evt_test *test, struct evt_options *opt,
return 0;
}
+static int
+perf_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride,
+ struct rte_event_port_conf prod_conf)
+{
+ int ret = 0;
+ uint16_t prod;
+
+ struct rte_event_eth_rx_adapter_queue_conf queue_conf = {
+ .ev.event = 0,
+ .ev.sched_type = opt->sched_type_list[0],
+ };
+
+ for (prod = 0; prod < rte_eth_dev_count(); prod++) {
+ uint32_t cap;
+
+ ret = rte_event_eth_rx_adapter_caps_get(opt->dev_id,
+ prod, &cap);
+ if (ret) {
+ evt_err("failed to get event rx adapter[%d]"
+ " capabilities",
+ opt->dev_id);
+ return ret;
+ }
+ queue_conf.ev.queue_id = prod * stride;
+ ret = rte_event_eth_rx_adapter_create(prod, opt->dev_id,
+ &prod_conf);
+ if (ret) {
+ evt_err("failed to create rx adapter[%d]", prod);
+ return ret;
+ }
+ ret = rte_event_eth_rx_adapter_queue_add(prod, prod, -1,
+ &queue_conf);
+ if (ret) {
+ evt_err("failed to add rx queues to adapter[%d]", prod);
+ return ret;
+ }
+
+ ret = rte_eth_dev_start(prod);
+ if (ret) {
+ evt_err("Ethernet dev [%d] failed to start."
+ " Using synthetic producer", prod);
+ return ret;
+ }
+
+ ret = rte_event_eth_rx_adapter_start(prod);
+ if (ret) {
+ evt_err("Rx adapter[%d] start failed", prod);
+ return ret;
+ }
+ printf("%s: Port[%d] using Rx adapter[%d] started\n", __func__,
+ prod, prod);
+ }
+
+ return ret;
+}
+
int
perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
uint8_t stride, uint8_t nb_queues)
{
struct test_perf *t = evt_test_priv(test);
- uint8_t port, prod;
+ uint16_t port, prod;
int ret = -1;
/* port configuration */
@@ -272,26 +328,38 @@ perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
}
/* port for producers, no links */
- const struct rte_event_port_conf prod_conf = {
+ struct rte_event_port_conf prod_conf = {
.dequeue_depth = 8,
.enqueue_depth = 32,
.new_event_threshold = 1200,
};
- prod = 0;
- for ( ; port < perf_nb_event_ports(opt); port++) {
- struct prod_data *p = &t->prod[port];
-
- p->dev_id = opt->dev_id;
- p->port_id = port;
- p->queue_id = prod * stride;
- p->t = t;
+ if (opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR) {
+ for ( ; port < perf_nb_event_ports(opt); port++) {
+ struct prod_data *p = &t->prod[port];
+ p->t = t;
+ }
- ret = rte_event_port_setup(opt->dev_id, port, &prod_conf);
- if (ret) {
- evt_err("failed to setup port %d", port);
+ ret = perf_event_rx_adapter_setup(opt, stride, prod_conf);
+ if (ret)
return ret;
+ } else {
+ prod = 0;
+ for ( ; port < perf_nb_event_ports(opt); port++) {
+ struct prod_data *p = &t->prod[port];
+
+ p->dev_id = opt->dev_id;
+ p->port_id = port;
+ p->queue_id = prod * stride;
+ p->t = t;
+
+ ret = rte_event_port_setup(opt->dev_id, port,
+ &prod_conf);
+ if (ret) {
+ evt_err("failed to setup port %d", port);
+ return ret;
+ }
+ prod++;
}
- prod++;
}
return ret;
@@ -487,6 +555,7 @@ void perf_ethdev_destroy(struct evt_test *test, struct evt_options *opt)
if (opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR) {
for (i = 0; i < rte_eth_dev_count(); i++) {
+ rte_event_eth_rx_adapter_stop(i);
rte_eth_dev_stop(i);
rte_eth_dev_close(i);
}
diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h
index f333656..95a2174 100644
--- a/app/test-eventdev/test_perf_common.h
+++ b/app/test-eventdev/test_perf_common.h
@@ -40,6 +40,7 @@
#include <rte_cycles.h>
#include <rte_ethdev.h>
#include <rte_eventdev.h>
+#include <rte_event_eth_rx_adapter.h>
#include <rte_lcore.h>
#include <rte_malloc.h>
#include <rte_mempool.h>
--
2.7.4
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH 7/8] app/eventdev: add service core configuration
2017-10-18 12:39 [dpdk-dev] [PATCH 0/8] app/eventdev: add event eth Rx adapter support Pavan Nikhilesh
` (5 preceding siblings ...)
2017-10-18 12:39 ` [dpdk-dev] [PATCH 6/8] app/eventdev: add event Rx adapter setup Pavan Nikhilesh
@ 2017-10-18 12:39 ` Pavan Nikhilesh
2017-10-18 12:39 ` [dpdk-dev] [PATCH 8/8] doc: update app eventdev options Pavan Nikhilesh
` (3 subsequent siblings)
10 siblings, 0 replies; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-10-18 12:39 UTC (permalink / raw)
To: bruce.richardson, harry.van.haaren, gage.eads, hemant.agrawal,
nipun.gupta, nikhil.rao, santosh.shukla, jerin.jacob
Cc: dev, Pavan Nikhilesh
Add service core configuration for Rx adapter. The configuration picks
the least used service core to run the service on.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
app/test-eventdev/evt_common.h | 41 ++++++++++++++++--------------------
app/test-eventdev/test_perf_atq.c | 12 +++++++----
app/test-eventdev/test_perf_common.c | 13 ++++++++++++
app/test-eventdev/test_perf_queue.c | 12 +++++++----
4 files changed, 47 insertions(+), 31 deletions(-)
diff --git a/app/test-eventdev/evt_common.h b/app/test-eventdev/evt_common.h
index 0fadab4..042823a 100644
--- a/app/test-eventdev/evt_common.h
+++ b/app/test-eventdev/evt_common.h
@@ -94,41 +94,36 @@ evt_has_all_types_queue(uint8_t dev_id)
}
static inline int
-evt_service_setup(uint8_t dev_id)
+evt_service_setup(uint32_t service_id)
{
- uint32_t service_id;
int32_t core_cnt;
unsigned int lcore = 0;
uint32_t core_array[RTE_MAX_LCORE];
uint8_t cnt;
uint8_t min_cnt = UINT8_MAX;
- if (evt_has_distributed_sched(dev_id))
- return 0;
-
if (!rte_service_lcore_count())
return -ENOENT;
- if (!rte_event_dev_service_id_get(dev_id, &service_id)) {
- core_cnt = rte_service_lcore_list(core_array,
- RTE_MAX_LCORE);
- if (core_cnt < 0)
- return -ENOENT;
- /* Get the core which has least number of services running. */
- while (core_cnt--) {
- /* Reset default mapping */
- rte_service_map_lcore_set(service_id,
- core_array[core_cnt], 0);
- cnt = rte_service_lcore_count_services(
- core_array[core_cnt]);
- if (cnt < min_cnt) {
- lcore = core_array[core_cnt];
- min_cnt = cnt;
- }
+ core_cnt = rte_service_lcore_list(core_array,
+ RTE_MAX_LCORE);
+ if (core_cnt < 0)
+ return -ENOENT;
+ /* Get the core which has least number of services running. */
+ while (core_cnt--) {
+ /* Reset default mapping */
+ rte_service_map_lcore_set(service_id,
+ core_array[core_cnt], 0);
+ cnt = rte_service_lcore_count_services(
+ core_array[core_cnt]);
+ if (cnt < min_cnt) {
+ lcore = core_array[core_cnt];
+ min_cnt = cnt;
}
- if (rte_service_map_lcore_set(service_id, lcore, 1))
- return -ENOENT;
}
+ if (rte_service_map_lcore_set(service_id, lcore, 1))
+ return -ENOENT;
+
return 0;
}
diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c
index 8bc701b..67cf58a 100644
--- a/app/test-eventdev/test_perf_atq.c
+++ b/app/test-eventdev/test_perf_atq.c
@@ -231,10 +231,14 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
if (ret)
return ret;
- ret = evt_service_setup(opt->dev_id);
- if (ret) {
- evt_err("No service lcore found to run event dev.");
- return ret;
+ if (!evt_has_distributed_sched(opt->dev_id)) {
+ uint32_t service_id;
+ rte_event_dev_service_id_get(opt->dev_id, &service_id);
+ ret = evt_service_setup(service_id);
+ if (ret) {
+ evt_err("No service lcore found to run event dev.");
+ return ret;
+ }
}
ret = rte_event_dev_start(opt->dev_id);
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index 0ade1dc..873eab9 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -269,6 +269,19 @@ perf_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride,
return ret;
}
+ if (!(cap & RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT)) {
+ uint32_t service_id;
+
+ rte_event_eth_rx_adapter_service_id_get(prod,
+ &service_id);
+ ret = evt_service_setup(service_id);
+ if (ret) {
+ evt_err("Failed to setup service core"
+ " for Rx adapter\n");
+ return ret;
+ }
+ }
+
ret = rte_eth_dev_start(prod);
if (ret) {
evt_err("Ethernet dev [%d] failed to start."
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index 16e2c9d..23a8a6b 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -243,10 +243,14 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
if (ret)
return ret;
- ret = evt_service_setup(opt->dev_id);
- if (ret) {
- evt_err("No service lcore found to run event dev.");
- return ret;
+ if (!evt_has_distributed_sched(opt->dev_id)) {
+ uint32_t service_id;
+ rte_event_dev_service_id_get(opt->dev_id, &service_id);
+ ret = evt_service_setup(service_id);
+ if (ret) {
+ evt_err("No service lcore found to run event dev.");
+ return ret;
+ }
}
ret = rte_event_dev_start(opt->dev_id);
--
2.7.4
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH 8/8] doc: update app eventdev options
2017-10-18 12:39 [dpdk-dev] [PATCH 0/8] app/eventdev: add event eth Rx adapter support Pavan Nikhilesh
` (6 preceding siblings ...)
2017-10-18 12:39 ` [dpdk-dev] [PATCH 7/8] app/eventdev: add service core configuration Pavan Nikhilesh
@ 2017-10-18 12:39 ` Pavan Nikhilesh
2017-10-18 18:33 ` Mcnamara, John
2017-12-10 12:16 ` Jerin Jacob
2017-12-10 8:28 ` [dpdk-dev] [PATCH 0/8] app/eventdev: add event eth Rx adapter support Jerin Jacob
` (2 subsequent siblings)
10 siblings, 2 replies; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-10-18 12:39 UTC (permalink / raw)
To: bruce.richardson, harry.van.haaren, gage.eads, hemant.agrawal,
nipun.gupta, nikhil.rao, santosh.shukla, jerin.jacob
Cc: dev, Pavan Nikhilesh
Update documentation about new --prod_type_ethdev option in app/eventdev.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
doc/guides/tools/testeventdev.rst | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/doc/guides/tools/testeventdev.rst b/doc/guides/tools/testeventdev.rst
index 34b1c31..44b71bc 100644
--- a/doc/guides/tools/testeventdev.rst
+++ b/doc/guides/tools/testeventdev.rst
@@ -150,6 +150,9 @@ The following are the application command-line options:
Enable queue priority.
+* ``--prod_type_ethdev``
+
+ Use ethernet device as producer.
Eventdev Tests
--------------
@@ -352,6 +355,10 @@ the timestamp in the event on the first stage and then on termination, it
updates the number of cycles to forward a packet. The application uses this
value to compute the average latency to a forward packet.
+When ``--prod_type_ethdev`` command line option is selected, the application
+uses the probed ethernet devices as producers by configuring them as Rx
+adapters instead of using synthetic producers.
+
Application options
^^^^^^^^^^^^^^^^^^^
@@ -371,6 +378,7 @@ Supported application command line options are following::
--worker_deq_depth
--fwd_latency
--queue_priority
+ --prod_type_ethdev
Example
^^^^^^^
@@ -382,6 +390,12 @@ Example command to run perf queue test:
sudo build/app/dpdk-test-eventdev --vdev=event_sw0 -- \
--test=perf_queue --slcore=1 --plcores=2 --wlcore=3 --stlist=p --nb_pkts=0
+Example command to run perf queue test with ethernet ports:
+
+.. code-block:: console
+
+ sudo build/app/dpdk-test-eventdev --vdev=event_sw0 -- \
+ --test=perf_queue --plcores=2 --wlcore=3 --stlist=p --prod_type_ethdev
PERF_ATQ Test
~~~~~~~~~~~~~~~
@@ -449,6 +463,7 @@ Supported application command line options are following::
--nb_pkts
--worker_deq_depth
--fwd_latency
+ --prod_type_ethdev
Example
^^^^^^^
--
2.7.4
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [dpdk-dev] [PATCH 8/8] doc: update app eventdev options
2017-10-18 12:39 ` [dpdk-dev] [PATCH 8/8] doc: update app eventdev options Pavan Nikhilesh
@ 2017-10-18 18:33 ` Mcnamara, John
2017-12-10 12:16 ` Jerin Jacob
1 sibling, 0 replies; 40+ messages in thread
From: Mcnamara, John @ 2017-10-18 18:33 UTC (permalink / raw)
To: Pavan Nikhilesh, Richardson, Bruce, Van Haaren, Harry, Eads,
Gage, hemant.agrawal, nipun.gupta, Rao, Nikhil, santosh.shukla,
jerin.jacob
Cc: dev
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pavan Nikhilesh
> Sent: Wednesday, October 18, 2017 1:39 PM
> To: Richardson, Bruce <bruce.richardson@intel.com>; Van Haaren, Harry
> <harry.van.haaren@intel.com>; Eads, Gage <gage.eads@intel.com>;
> hemant.agrawal@nxp.com; nipun.gupta@nxp.com; Rao, Nikhil
> <nikhil.rao@intel.com>; santosh.shukla@caviumnetworks.com;
> jerin.jacob@caviumnetworks.com
> Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH 8/8] doc: update app eventdev options
>
> Update documentation about new --prod_type_ethdev option in app/eventdev.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [dpdk-dev] [PATCH 0/8] app/eventdev: add event eth Rx adapter support
2017-10-18 12:39 [dpdk-dev] [PATCH 0/8] app/eventdev: add event eth Rx adapter support Pavan Nikhilesh
` (7 preceding siblings ...)
2017-10-18 12:39 ` [dpdk-dev] [PATCH 8/8] doc: update app eventdev options Pavan Nikhilesh
@ 2017-12-10 8:28 ` Jerin Jacob
2017-12-11 7:37 ` Pavan Nikhilesh Bhagavatula
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 1/8] app/eventdev: add ethernet device producer option Pavan Nikhilesh
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 " Pavan Nikhilesh
10 siblings, 1 reply; 40+ messages in thread
From: Jerin Jacob @ 2017-12-10 8:28 UTC (permalink / raw)
To: Pavan Nikhilesh
Cc: bruce.richardson, harry.van.haaren, gage.eads, hemant.agrawal,
nipun.gupta, nikhil.rao, santosh.shukla, dev
-----Original Message-----
> Date: Wed, 18 Oct 2017 18:09:00 +0530
> From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> To: bruce.richardson@intel.com, harry.van.haaren@intel.com,
> gage.eads@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com,
> nikhil.rao@intel.com, santosh.shukla@caviumnetworks.com,
> jerin.jacob@caviumnetworks.com
> Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Subject: [PATCH 0/8] app/eventdev: add event eth Rx adapter support
> X-Mailer: git-send-email 2.7.4
>
> The eventdev application uses producer lcores to inject packets as events
> into the event device. This approach is suitable for doing synthetic
> performance benchmarks. In most real-world scenarios the packets are
> received by an Ethernet device.
>
> The Event Ethernet Rx Adapter library enables packet transfer between
> ethernet dev and event dev transparently. This patch series adds an option
> '--prod_type_ethdev' to configure the attached Ethernet devices as Rx adapters
> and use them as producers instead of using synthetic producer cores. Also, this
> is an RX only case.
>
> The application has been verified on both sw and hw event devices using the
> command:
>
> ./build/app/dpdk-test-eventdev -c 0xfffff1 -s 0xf0000 --vdev="event_*"
> -- --wlcores 12 --test perf_queue --verbose 20 --stlist=a
> --prod_type_ethdev
Please rebase to latest next-eventdev tree and fix following check patch
warning.
ERROR:SWITCH_CASE_INDENT_LEVEL: switch and case should be at the same
indent
#154: FILE: app/test-eventdev/evt_options.h:284:
+ switch (opt->prod_type) {
+ default:
+ case EVT_PROD_TYPE_SYNT:
[...]
+ case EVT_PROD_TYPE_ETH_RX_ADPTR:
>
> Pavan Nikhilesh (8):
> app/eventdev: add ethernet device producer option
> app/eventdev: modify app setup to support ethdev
> app/eventdev: add pktmbuf pool for ethdev
> app/eventdev: add ethernet device setup helpers
> app/eventdev: add ethernet device tear down
> app/eventdev: add event Rx adapter setup
> app/eventdev: add service core configuration
> doc: update app eventdev options
>
> app/test-eventdev/evt_common.h | 41 +++---
> app/test-eventdev/evt_options.c | 11 ++
> app/test-eventdev/evt_options.h | 29 ++++
> app/test-eventdev/test_perf_atq.c | 32 +++--
> app/test-eventdev/test_perf_common.c | 269 ++++++++++++++++++++++++++++++-----
> app/test-eventdev/test_perf_common.h | 4 +
> app/test-eventdev/test_perf_queue.c | 35 +++--
> doc/guides/tools/testeventdev.rst | 15 ++
> 8 files changed, 361 insertions(+), 75 deletions(-)
>
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [dpdk-dev] [PATCH 1/8] app/eventdev: add ethernet device producer option
2017-10-18 12:39 ` [dpdk-dev] [PATCH 1/8] app/eventdev: add ethernet device producer option Pavan Nikhilesh
@ 2017-12-10 8:34 ` Jerin Jacob
0 siblings, 0 replies; 40+ messages in thread
From: Jerin Jacob @ 2017-12-10 8:34 UTC (permalink / raw)
To: Pavan Nikhilesh
Cc: bruce.richardson, harry.van.haaren, gage.eads, hemant.agrawal,
nipun.gupta, nikhil.rao, santosh.shukla, dev
-----Original Message-----
> Date: Wed, 18 Oct 2017 18:09:01 +0530
> From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> To: bruce.richardson@intel.com, harry.van.haaren@intel.com,
> gage.eads@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com,
> nikhil.rao@intel.com, santosh.shukla@caviumnetworks.com,
> jerin.jacob@caviumnetworks.com
> Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Subject: [PATCH 1/8] app/eventdev: add ethernet device producer option
> X-Mailer: git-send-email 2.7.4
>
> Add command line option --prod_type_ethdev to specify that the events
> are generated by ethernet device.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> ---
> app/test-eventdev/evt_options.c | 11 +++++++++++
> app/test-eventdev/evt_options.h | 29 +++++++++++++++++++++++++++++
> app/test-eventdev/test_perf_common.c | 34 ++++++++++++++++++++--------------
> 3 files changed, 60 insertions(+), 14 deletions(-)
>
> @@ -272,6 +282,7 @@ evt_opts_parse_long(int opt_idx, struct evt_options *opt)
> { EVT_SCHED_TYPE_LIST, evt_parse_sched_type_list},
> { EVT_FWD_LATENCY, evt_parse_fwd_latency},
> { EVT_QUEUE_PRIORITY, evt_parse_queue_priority},
> + { EVT_PROD_ETHDEV, evt_parse_prod_type},
There could be more producer type like timer or crypto in future. So,
IMO, the name can be like "evt_parse_eth_prod_type" or something like
similar.
> };
>
> for (i = 0; i < RTE_DIM(parsermap); i++) {
> diff --git a/app/test-eventdev/evt_options.h b/app/test-eventdev/evt_options.h
> index a9a9125..a6607e1 100644
> --- a/app/test-eventdev/evt_options.h
> +++ b/app/test-eventdev/evt_options.h
> @@ -58,8 +58,16 @@
> #define EVT_SCHED_TYPE_LIST ("stlist")
> #define EVT_FWD_LATENCY ("fwd_latency")
> #define EVT_QUEUE_PRIORITY ("queue_priority")
> +#define EVT_PROD_ETHDEV ("prod_type_ethdev")
> #define EVT_HELP ("help")
>
> +enum evt_prod_type {
> + EVT_PROD_TYPE_NONE,
> + EVT_PROD_TYPE_SYNT, /* Producer type Synthetic i.e. CPU. */
> + EVT_PROD_TYPE_ETH_RX_ADPTR, /* Producer type Eth Rx Adapter. */
> + EVT_PROD_TYPE_MAX,
> +};
> +
> struct evt_options {
> #define EVT_TEST_NAME_MAX_LEN 32
> char test_name[EVT_TEST_NAME_MAX_LEN];
> @@ -76,6 +84,7 @@ struct evt_options {
> uint8_t dev_id;
> uint32_t fwd_latency:1;
> uint32_t q_priority:1;
> + enum evt_prod_type prod_type;
> };
>
> void evt_options_default(struct evt_options *opt);
> @@ -266,4 +275,24 @@ evt_dump_sched_type_list(struct evt_options *opt)
> evt_dump_end;
> }
>
> +#define EVT_PROD_MAX_NAME_LEN 50
> +static inline void
> +evt_dump_producer_type(struct evt_options *opt)
> +{
> + char name[EVT_PROD_MAX_NAME_LEN];
> +
> + switch (opt->prod_type) {
> + default:
> + case EVT_PROD_TYPE_SYNT:
> + snprintf(name, EVT_PROD_MAX_NAME_LEN,
> + "Synthetic producer lcores");
> + break;
> + case EVT_PROD_TYPE_ETH_RX_ADPTR:
> + snprintf(name, EVT_PROD_MAX_NAME_LEN,
> + "Rx Adapter producers");
How about the name as "Ethdev Rx Adapter producers"
> + break;
> + }
> + evt_dump("prod_type", "%s", name);
> +}
> +
Other than that, it looks good to me
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [dpdk-dev] [PATCH 2/8] app/eventdev: modify app setup to support ethdev
2017-10-18 12:39 ` [dpdk-dev] [PATCH 2/8] app/eventdev: modify app setup to support ethdev Pavan Nikhilesh
@ 2017-12-10 11:56 ` Jerin Jacob
0 siblings, 0 replies; 40+ messages in thread
From: Jerin Jacob @ 2017-12-10 11:56 UTC (permalink / raw)
To: Pavan Nikhilesh
Cc: bruce.richardson, harry.van.haaren, gage.eads, hemant.agrawal,
nipun.gupta, nikhil.rao, santosh.shukla, dev
-----Original Message-----
> Date: Wed, 18 Oct 2017 18:09:02 +0530
> From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> To: bruce.richardson@intel.com, harry.van.haaren@intel.com,
> gage.eads@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com,
> nikhil.rao@intel.com, santosh.shukla@caviumnetworks.com,
> jerin.jacob@caviumnetworks.com
> Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Subject: [PATCH 2/8] app/eventdev: modify app setup to support ethdev
> X-Mailer: git-send-email 2.7.4
>
> Modify app setup to accommodate event port and queue setup based on the
> number of ethernet ports.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> ---
> app/test-eventdev/test_perf_atq.c | 18 ++++++++++++++----
> app/test-eventdev/test_perf_common.c | 27 +++++++++++++++++++++------
> app/test-eventdev/test_perf_common.h | 1 +
> app/test-eventdev/test_perf_queue.c | 21 ++++++++++++++++-----
> 4 files changed, 52 insertions(+), 15 deletions(-)
>
> diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c
> index 0e9f2db..f6fd5d9 100644
> --- a/app/test-eventdev/test_perf_atq.c
> +++ b/app/test-eventdev/test_perf_atq.c
> @@ -185,10 +185,20 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
> {
> int ret;
> uint8_t queue;
> + uint8_t nb_queues;
unnecessary space between uint8_t and nb_queues.
> + uint8_t nb_ports;
> + RTE_SET_USED(test);
test being used down. So RTE_SET_USED may not need here.
> +
> + nb_ports = evt_nr_active_lcores(opt->wlcores);
> + nb_ports += opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ? 0 :
> + evt_nr_active_lcores(opt->plcores);
> +
> + nb_queues = opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ?
> + rte_eth_dev_count() : atq_nb_event_queues(opt);
>
> const struct rte_event_dev_config config = {
> - .nb_event_queues = atq_nb_event_queues(opt),
> - .nb_event_ports = perf_nb_event_ports(opt),
> + .nb_event_queues = nb_queues,
> + .nb_event_ports = nb_ports,
> .nb_events_limit = 4096,
> .nb_event_queue_flows = opt->nb_flows,
> .nb_event_port_dequeue_depth = 128,
> @@ -208,7 +218,7 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
> .nb_atomic_order_sequences = opt->nb_flows,
> };
> /* queue configurations */
> - for (queue = 0; queue < atq_nb_event_queues(opt); queue++) {
> + for (queue = 0; queue < nb_queues; queue++) {
> ret = rte_event_queue_setup(opt->dev_id, queue, &q_conf);
> if (ret) {
> evt_err("failed to setup queue=%d", queue);
> @@ -217,7 +227,7 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
> }
>
> ret = perf_event_dev_port_setup(test, opt, 1 /* stride */,
> - atq_nb_event_queues(opt));
> + nb_queues);
> if (ret)
> return ret;
>
> diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
> index 9d2865e..f7961be 100644
> --- a/app/test-eventdev/test_perf_common.c
> +++ b/app/test-eventdev/test_perf_common.c
> @@ -88,6 +88,18 @@ perf_producer(void *arg)
> return 0;
> }
>
> +static int
> +perf_producer_wrapper(void *arg)
> +{
> + RTE_SET_USED(arg);
arg has been used in next line.
> + struct prod_data *p = arg;
> + struct test_perf *t = p->t;
> + /* Launch the producer function only in case of synthetic producer. */
> + if (t->opt->prod_type == EVT_PROD_TYPE_SYNT)
> + return perf_producer(arg);
> + return 0;
> +}
> +
Other than that, it looks good to me
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [dpdk-dev] [PATCH 3/8] app/eventdev: add pktmbuf pool for ethdev
2017-10-18 12:39 ` [dpdk-dev] [PATCH 3/8] app/eventdev: add pktmbuf pool for ethdev Pavan Nikhilesh
@ 2017-12-10 12:01 ` Jerin Jacob
0 siblings, 0 replies; 40+ messages in thread
From: Jerin Jacob @ 2017-12-10 12:01 UTC (permalink / raw)
To: Pavan Nikhilesh
Cc: bruce.richardson, harry.van.haaren, gage.eads, hemant.agrawal,
nipun.gupta, nikhil.rao, santosh.shukla, dev
-----Original Message-----
> Date: Wed, 18 Oct 2017 18:09:03 +0530
> From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> To: bruce.richardson@intel.com, harry.van.haaren@intel.com,
> gage.eads@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com,
> nikhil.rao@intel.com, santosh.shukla@caviumnetworks.com,
> jerin.jacob@caviumnetworks.com
> Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Subject: [PATCH 3/8] app/eventdev: add pktmbuf pool for ethdev
> X-Mailer: git-send-email 2.7.4
>
> Add pktmbuf pool creation used when configuring ethernet device as event
> producer.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> ---
> app/test-eventdev/test_perf_common.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
> index f7961be..b26d694 100644
> --- a/app/test-eventdev/test_perf_common.c
> +++ b/app/test-eventdev/test_perf_common.c
> @@ -413,13 +413,24 @@ perf_mempool_setup(struct evt_test *test, struct evt_options *opt)
> {
> struct test_perf *t = evt_test_priv(test);
>
> - t->pool = rte_mempool_create(test->name, /* mempool name */
> + if (opt->prod_type == EVT_PROD_TYPE_SYNT) {
> + t->pool = rte_mempool_create(test->name, /* mempool name */
> opt->pool_sz, /* number of elements*/
> sizeof(struct perf_elt), /* element size*/
> 512, /* cache size*/
> 0, NULL, NULL,
> perf_elt_init, /* obj constructor */
> NULL, opt->socket_id, 0); /* flags */
> + } else {
> + t->pool = rte_pktmbuf_pool_create(test->name, /* mempool name */
> + opt->pool_sz, /* number of elements*/
> + 0, /* cache size*/
Please change the cache size to 512.
With above change:
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> + 0,
> + RTE_MBUF_DEFAULT_BUF_SIZE,
> + opt->socket_id); /* flags */
> +
> + }
> +
> if (t->pool == NULL) {
> evt_err("failed to create mempool");
> return -ENOMEM;
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [dpdk-dev] [PATCH 4/8] app/eventdev: add ethernet device setup helpers
2017-10-18 12:39 ` [dpdk-dev] [PATCH 4/8] app/eventdev: add ethernet device setup helpers Pavan Nikhilesh
@ 2017-12-10 12:09 ` Jerin Jacob
0 siblings, 0 replies; 40+ messages in thread
From: Jerin Jacob @ 2017-12-10 12:09 UTC (permalink / raw)
To: Pavan Nikhilesh
Cc: bruce.richardson, harry.van.haaren, gage.eads, hemant.agrawal,
nipun.gupta, nikhil.rao, santosh.shukla, dev
-----Original Message-----
> Date: Wed, 18 Oct 2017 18:09:04 +0530
> From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> To: bruce.richardson@intel.com, harry.van.haaren@intel.com,
> gage.eads@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com,
> nikhil.rao@intel.com, santosh.shukla@caviumnetworks.com,
> jerin.jacob@caviumnetworks.com
> Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Subject: [PATCH 4/8] app/eventdev: add ethernet device setup helpers
> X-Mailer: git-send-email 2.7.4
>
> Add ethernet device setup functions to configure ethdev ports incase
> prod_type_ethdev option is enabled.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> ---
>
> +#define NB_RX_DESC 128
> +#define NB_TX_DESC 512
> +int
> +perf_ethdev_setup(struct evt_test *test, struct evt_options *opt)
> +{
> + uint16_t nb_rx_queues = 1;
const ?
> + int i;
> + int j;
> + struct test_perf *t = evt_test_priv(test);
> + struct rte_eth_conf port_conf = {
> + .rxmode = {
> + .mq_mode = ETH_MQ_RX_RSS,
> + .max_rx_pkt_len = ETHER_MAX_LEN,
> + .split_hdr_size = 0,
> + .header_split = 0,
> + .hw_ip_checksum = 0,
> + .hw_vlan_filter = 0,
> + .hw_vlan_strip = 0,
> + .hw_vlan_extend = 0,
> + .jumbo_frame = 0,
> + .hw_strip_crc = 1,
> + },
> + .rx_adv_conf = {
> + .rss_conf = {
> + .rss_key = NULL,
> + .rss_hf = ETH_RSS_IP,
> + },
> + },
> + };
> +
> + if (opt->prod_type == EVT_PROD_TYPE_SYNT)
> + return 0;
> +
> + if (!rte_eth_dev_count()) {
> + evt_err("No ethernet ports found.\n");
> + return -ENODEV;
> + }
> +
> + for (i = 0; i < rte_eth_dev_count(); i++) {
> +
> + if (rte_eth_dev_configure(i, nb_rx_queues, nb_rx_queues,
> + &port_conf)
> + < 0) {
> + evt_err("Failed to configure eth port [%d]\n", i);
> + return -EINVAL;
> + }
> +
> + for (j = 0; j < nb_rx_queues; j++) {
> + if (rte_eth_rx_queue_setup(i, j, NB_RX_DESC,
> + rte_socket_id(), NULL, t->pool) < 0) {
> + evt_err("Failed to setup eth port [%d]"
> + " rx_queue: %d."
> + " Using synthetic producer\n",
- The "\n" is not required as evt_err already has "\n"
- Please change to "Using ethdev Rx adapter producer " instead of "Using synthetic producer"
> + i, j);
> + return -EINVAL;
> + }
> + if (rte_eth_tx_queue_setup(i, j, NB_TX_DESC,
> + rte_socket_id(), NULL) < 0) {
> + evt_err("Failed to setup eth port [%d]"
> + " tx_queue: %d."
> + " Using synthetic producer\n",
> + i, j);
> + return -EINVAL;
> + }
> + }
> +
> + rte_eth_promiscuous_enable(i);
> + }
> +
> + return 0;
> +}
With above changes,
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [dpdk-dev] [PATCH 5/8] app/eventdev: add ethernet device tear down
2017-10-18 12:39 ` [dpdk-dev] [PATCH 5/8] app/eventdev: add ethernet device tear down Pavan Nikhilesh
@ 2017-12-10 12:10 ` Jerin Jacob
0 siblings, 0 replies; 40+ messages in thread
From: Jerin Jacob @ 2017-12-10 12:10 UTC (permalink / raw)
To: Pavan Nikhilesh
Cc: bruce.richardson, harry.van.haaren, gage.eads, hemant.agrawal,
nipun.gupta, nikhil.rao, santosh.shukla, dev
-----Original Message-----
> Date: Wed, 18 Oct 2017 18:09:05 +0530
> From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> To: bruce.richardson@intel.com, harry.van.haaren@intel.com,
> gage.eads@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com,
> nikhil.rao@intel.com, santosh.shukla@caviumnetworks.com,
> jerin.jacob@caviumnetworks.com
> Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Subject: [PATCH 5/8] app/eventdev: add ethernet device tear down
> X-Mailer: git-send-email 2.7.4
>
> Add ethernet device destroy functions to stop and close ethdev ports
> if they are configured when prod_type_ethdev option is enabled.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [dpdk-dev] [PATCH 6/8] app/eventdev: add event Rx adapter setup
2017-10-18 12:39 ` [dpdk-dev] [PATCH 6/8] app/eventdev: add event Rx adapter setup Pavan Nikhilesh
@ 2017-12-10 12:13 ` Jerin Jacob
0 siblings, 0 replies; 40+ messages in thread
From: Jerin Jacob @ 2017-12-10 12:13 UTC (permalink / raw)
To: Pavan Nikhilesh
Cc: bruce.richardson, harry.van.haaren, gage.eads, hemant.agrawal,
nipun.gupta, nikhil.rao, santosh.shukla, dev
-----Original Message-----
> Date: Wed, 18 Oct 2017 18:09:06 +0530
> From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> To: bruce.richardson@intel.com, harry.van.haaren@intel.com,
> gage.eads@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com,
> nikhil.rao@intel.com, santosh.shukla@caviumnetworks.com,
> jerin.jacob@caviumnetworks.com
> Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Subject: [PATCH 6/8] app/eventdev: add event Rx adapter setup
> X-Mailer: git-send-email 2.7.4
>
> Add functions to setup and configure Rx adapter based on the number of
> ethdev ports setup.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> ---
> app/test-eventdev/test_perf_common.c | 97 ++++++++++++++++++++++++++++++------
> app/test-eventdev/test_perf_common.h | 1 +
> 2 files changed, 84 insertions(+), 14 deletions(-)
>
> diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
> index 04c0c65..0ade1dc 100644
> --- a/app/test-eventdev/test_perf_common.c
> +++ b/app/test-eventdev/test_perf_common.c
> @@ -232,12 +232,68 @@ perf_launch_lcores(struct evt_test *test, struct evt_options *opt,
> return 0;
> }
>
> int
> perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
> uint8_t stride, uint8_t nb_queues)
> {
> struct test_perf *t = evt_test_priv(test);
> - uint8_t port, prod;
> + uint16_t port, prod;
> int ret = -1;
>
> /* port configuration */
> @@ -272,26 +328,38 @@ perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
> }
>
> /* port for producers, no links */
> - const struct rte_event_port_conf prod_conf = {
> + struct rte_event_port_conf prod_conf = {
> .dequeue_depth = 8,
> .enqueue_depth = 32,
> .new_event_threshold = 1200,
Use default config get functions to get optimal values instead of hard
coded values.
With above change:
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [dpdk-dev] [PATCH 8/8] doc: update app eventdev options
2017-10-18 12:39 ` [dpdk-dev] [PATCH 8/8] doc: update app eventdev options Pavan Nikhilesh
2017-10-18 18:33 ` Mcnamara, John
@ 2017-12-10 12:16 ` Jerin Jacob
1 sibling, 0 replies; 40+ messages in thread
From: Jerin Jacob @ 2017-12-10 12:16 UTC (permalink / raw)
To: Pavan Nikhilesh
Cc: bruce.richardson, harry.van.haaren, gage.eads, hemant.agrawal,
nipun.gupta, nikhil.rao, santosh.shukla, dev
-----Original Message-----
> Date: Wed, 18 Oct 2017 18:09:08 +0530
> From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> To: bruce.richardson@intel.com, harry.van.haaren@intel.com,
> gage.eads@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com,
> nikhil.rao@intel.com, santosh.shukla@caviumnetworks.com,
> jerin.jacob@caviumnetworks.com
> Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Subject: [PATCH 8/8] doc: update app eventdev options
> X-Mailer: git-send-email 2.7.4
>
> Update documentation about new --prod_type_ethdev option in app/eventdev.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [dpdk-dev] [PATCH 0/8] app/eventdev: add event eth Rx adapter support
2017-12-10 8:28 ` [dpdk-dev] [PATCH 0/8] app/eventdev: add event eth Rx adapter support Jerin Jacob
@ 2017-12-11 7:37 ` Pavan Nikhilesh Bhagavatula
0 siblings, 0 replies; 40+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2017-12-11 7:37 UTC (permalink / raw)
To: Jerin Jacob; +Cc: dev
Hi Jerin,
Thanks for the review, will make the chages required and will send out a v2.
Pavan.
On Sun, Dec 10, 2017 at 01:58:08PM +0530, Jerin Jacob wrote:
> -----Original Message-----
> > Date: Wed, 18 Oct 2017 18:09:00 +0530
> > From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> > To: bruce.richardson@intel.com, harry.van.haaren@intel.com,
> > gage.eads@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com,
> > nikhil.rao@intel.com, santosh.shukla@caviumnetworks.com,
> > jerin.jacob@caviumnetworks.com
> > Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> > Subject: [PATCH 0/8] app/eventdev: add event eth Rx adapter support
> > X-Mailer: git-send-email 2.7.4
> >
> > The eventdev application uses producer lcores to inject packets as events
> > into the event device. This approach is suitable for doing synthetic
> > performance benchmarks. In most real-world scenarios the packets are
> > received by an Ethernet device.
> >
> > The Event Ethernet Rx Adapter library enables packet transfer between
> > ethernet dev and event dev transparently. This patch series adds an option
> > '--prod_type_ethdev' to configure the attached Ethernet devices as Rx adapters
> > and use them as producers instead of using synthetic producer cores. Also, this
> > is an RX only case.
> >
> > The application has been verified on both sw and hw event devices using the
> > command:
> >
> > ./build/app/dpdk-test-eventdev -c 0xfffff1 -s 0xf0000 --vdev="event_*"
> > -- --wlcores 12 --test perf_queue --verbose 20 --stlist=a
> > --prod_type_ethdev
>
> Please rebase to latest next-eventdev tree and fix following check patch
> warning.
>
> ERROR:SWITCH_CASE_INDENT_LEVEL: switch and case should be at the same
> indent
> #154: FILE: app/test-eventdev/evt_options.h:284:
> + switch (opt->prod_type) {
> + default:
> + case EVT_PROD_TYPE_SYNT:
> [...]
> + case EVT_PROD_TYPE_ETH_RX_ADPTR:
>
> >
> > Pavan Nikhilesh (8):
> > app/eventdev: add ethernet device producer option
> > app/eventdev: modify app setup to support ethdev
> > app/eventdev: add pktmbuf pool for ethdev
> > app/eventdev: add ethernet device setup helpers
> > app/eventdev: add ethernet device tear down
> > app/eventdev: add event Rx adapter setup
> > app/eventdev: add service core configuration
> > doc: update app eventdev options
> >
> > app/test-eventdev/evt_common.h | 41 +++---
> > app/test-eventdev/evt_options.c | 11 ++
> > app/test-eventdev/evt_options.h | 29 ++++
> > app/test-eventdev/test_perf_atq.c | 32 +++--
> > app/test-eventdev/test_perf_common.c | 269 ++++++++++++++++++++++++++++++-----
> > app/test-eventdev/test_perf_common.h | 4 +
> > app/test-eventdev/test_perf_queue.c | 35 +++--
> > doc/guides/tools/testeventdev.rst | 15 ++
> > 8 files changed, 361 insertions(+), 75 deletions(-)
> >
> > --
> > 2.7.4
> >
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH v2 1/8] app/eventdev: add ethernet device producer option
2017-10-18 12:39 [dpdk-dev] [PATCH 0/8] app/eventdev: add event eth Rx adapter support Pavan Nikhilesh
` (8 preceding siblings ...)
2017-12-10 8:28 ` [dpdk-dev] [PATCH 0/8] app/eventdev: add event eth Rx adapter support Jerin Jacob
@ 2017-12-11 11:12 ` Pavan Nikhilesh
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 2/8] app/eventdev: modify app setup to support ethdev Pavan Nikhilesh
` (7 more replies)
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 " Pavan Nikhilesh
10 siblings, 8 replies; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-12-11 11:12 UTC (permalink / raw)
To: jerin.jacob, bruce.richardson, harry.van.haaren, gage.eads,
hemant.agrawal, nipun.gupta, nikhil.rao, santosh.shukla
Cc: dev, Pavan Nikhilesh
Add command line option --prod_type_ethdev to specify that the events
are generated by ethernet device.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
v2 Changes:
- Modified 'evt_parse_prod_type' to 'evt_parse_eth_prod_type' to accommodate
other kinds of producers in future.
app/test-eventdev/evt_options.c | 11 +++++++++++
app/test-eventdev/evt_options.h | 29 +++++++++++++++++++++++++++++
app/test-eventdev/test_perf_common.c | 34 ++++++++++++++++++++--------------
3 files changed, 60 insertions(+), 14 deletions(-)
diff --git a/app/test-eventdev/evt_options.c b/app/test-eventdev/evt_options.c
index e2187dfc3..86e428905 100644
--- a/app/test-eventdev/evt_options.c
+++ b/app/test-eventdev/evt_options.c
@@ -55,6 +55,7 @@ evt_options_default(struct evt_options *opt)
opt->pool_sz = 16 * 1024;
opt->wkr_deq_dep = 16;
opt->nb_pkts = (1ULL << 26); /* do ~64M packets */
+ opt->prod_type = EVT_PROD_TYPE_SYNT;
}
typedef int (*option_parser_t)(struct evt_options *opt,
@@ -106,6 +107,13 @@ evt_parse_queue_priority(struct evt_options *opt, const char *arg __rte_unused)
return 0;
}
+static int
+evt_parse_eth_prod_type(struct evt_options *opt, const char *arg __rte_unused)
+{
+ opt->prod_type = EVT_PROD_TYPE_ETH_RX_ADPTR;
+ return 0;
+}
+
static int
evt_parse_test_name(struct evt_options *opt, const char *arg)
{
@@ -189,6 +197,7 @@ usage(char *program)
"\t--worker_deq_depth : dequeue depth of the worker\n"
"\t--fwd_latency : perform fwd_latency measurement\n"
"\t--queue_priority : enable queue priority\n"
+ "\t--prod_type_ethdev : use ethernet device as producer\n."
);
printf("available tests:\n");
evt_test_dump_names();
@@ -249,6 +258,7 @@ static struct option lgopts[] = {
{ EVT_SCHED_TYPE_LIST, 1, 0, 0 },
{ EVT_FWD_LATENCY, 0, 0, 0 },
{ EVT_QUEUE_PRIORITY, 0, 0, 0 },
+ { EVT_PROD_ETHDEV, 0, 0, 0 },
{ EVT_HELP, 0, 0, 0 },
{ NULL, 0, 0, 0 }
};
@@ -272,6 +282,7 @@ evt_opts_parse_long(int opt_idx, struct evt_options *opt)
{ EVT_SCHED_TYPE_LIST, evt_parse_sched_type_list},
{ EVT_FWD_LATENCY, evt_parse_fwd_latency},
{ EVT_QUEUE_PRIORITY, evt_parse_queue_priority},
+ { EVT_PROD_ETHDEV, evt_parse_eth_prod_type},
};
for (i = 0; i < RTE_DIM(parsermap); i++) {
diff --git a/app/test-eventdev/evt_options.h b/app/test-eventdev/evt_options.h
index a9a91252b..da7a6f863 100644
--- a/app/test-eventdev/evt_options.h
+++ b/app/test-eventdev/evt_options.h
@@ -58,8 +58,16 @@
#define EVT_SCHED_TYPE_LIST ("stlist")
#define EVT_FWD_LATENCY ("fwd_latency")
#define EVT_QUEUE_PRIORITY ("queue_priority")
+#define EVT_PROD_ETHDEV ("prod_type_ethdev")
#define EVT_HELP ("help")
+enum evt_prod_type {
+ EVT_PROD_TYPE_NONE,
+ EVT_PROD_TYPE_SYNT, /* Producer type Synthetic i.e. CPU. */
+ EVT_PROD_TYPE_ETH_RX_ADPTR, /* Producer type Eth Rx Adapter. */
+ EVT_PROD_TYPE_MAX,
+};
+
struct evt_options {
#define EVT_TEST_NAME_MAX_LEN 32
char test_name[EVT_TEST_NAME_MAX_LEN];
@@ -76,6 +84,7 @@ struct evt_options {
uint8_t dev_id;
uint32_t fwd_latency:1;
uint32_t q_priority:1;
+ enum evt_prod_type prod_type;
};
void evt_options_default(struct evt_options *opt);
@@ -266,4 +275,24 @@ evt_dump_sched_type_list(struct evt_options *opt)
evt_dump_end;
}
+#define EVT_PROD_MAX_NAME_LEN 50
+static inline void
+evt_dump_producer_type(struct evt_options *opt)
+{
+ char name[EVT_PROD_MAX_NAME_LEN];
+
+ switch (opt->prod_type) {
+ default:
+ case EVT_PROD_TYPE_SYNT:
+ snprintf(name, EVT_PROD_MAX_NAME_LEN,
+ "Synthetic producer lcores");
+ break;
+ case EVT_PROD_TYPE_ETH_RX_ADPTR:
+ snprintf(name, EVT_PROD_MAX_NAME_LEN,
+ "Ethdev Rx Adapter producers");
+ break;
+ }
+ evt_dump("prod_type", "%s", name);
+}
+
#endif /* _EVT_OPTIONS_ */
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index e77b4723e..9d2865ed5 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -287,8 +287,10 @@ perf_opt_check(struct evt_options *opt, uint64_t nb_queues)
{
unsigned int lcores;
- /* N producer + N worker + 1 master */
- lcores = 3;
+ /* N producer + N worker + 1 master when producer cores are used
+ * Else N worker + 1 master when Rx adapter is used
+ */
+ lcores = opt->prod_type == EVT_PROD_TYPE_SYNT ? 3 : 2;
if (rte_lcore_count() < lcores) {
evt_err("test need minimum %d lcores", lcores);
@@ -313,18 +315,21 @@ perf_opt_check(struct evt_options *opt, uint64_t nb_queues)
return -1;
}
- /* Validate producer lcores */
- if (evt_lcores_has_overlap(opt->plcores, rte_get_master_lcore())) {
- evt_err("producer lcores overlaps with master lcore");
- return -1;
- }
- if (evt_has_disabled_lcore(opt->plcores)) {
- evt_err("one or more producer lcores are not enabled");
- return -1;
- }
- if (!evt_has_active_lcore(opt->plcores)) {
- evt_err("minimum one producer is required");
- return -1;
+ if (opt->prod_type == EVT_PROD_TYPE_SYNT) {
+ /* Validate producer lcores */
+ if (evt_lcores_has_overlap(opt->plcores,
+ rte_get_master_lcore())) {
+ evt_err("producer lcores overlaps with master lcore");
+ return -1;
+ }
+ if (evt_has_disabled_lcore(opt->plcores)) {
+ evt_err("one or more producer lcores are not enabled");
+ return -1;
+ }
+ if (!evt_has_active_lcore(opt->plcores)) {
+ evt_err("minimum one producer is required");
+ return -1;
+ }
}
if (evt_has_invalid_stage(opt))
@@ -369,6 +374,7 @@ perf_opt_dump(struct evt_options *opt, uint8_t nb_queues)
evt_dump("nb_evdev_queues", "%d", nb_queues);
evt_dump_queue_priority(opt);
evt_dump_sched_type_list(opt);
+ evt_dump_producer_type(opt);
}
void
--
2.14.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH v2 2/8] app/eventdev: modify app setup to support ethdev
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 1/8] app/eventdev: add ethernet device producer option Pavan Nikhilesh
@ 2017-12-11 11:12 ` Pavan Nikhilesh
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 3/8] app/eventdev: add pktmbuf pool for ethdev Pavan Nikhilesh
` (6 subsequent siblings)
7 siblings, 0 replies; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-12-11 11:12 UTC (permalink / raw)
To: jerin.jacob, bruce.richardson, harry.van.haaren, gage.eads,
hemant.agrawal, nipun.gupta, nikhil.rao, santosh.shukla
Cc: dev, Pavan Nikhilesh
Modify app setup to accommodate event port and queue setup based on the
number of ethernet ports.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
v2 Changes:
- Removed unnecessary RTE_SET_USED() macros.
app/test-eventdev/test_perf_atq.c | 17 +++++++++++++----
app/test-eventdev/test_perf_common.c | 26 ++++++++++++++++++++------
app/test-eventdev/test_perf_common.h | 1 +
app/test-eventdev/test_perf_queue.c | 16 +++++++++++++---
4 files changed, 47 insertions(+), 13 deletions(-)
diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c
index 0e9f2db0e..6082d4ff3 100644
--- a/app/test-eventdev/test_perf_atq.c
+++ b/app/test-eventdev/test_perf_atq.c
@@ -185,10 +185,19 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
{
int ret;
uint8_t queue;
+ uint8_t nb_queues;
+ uint8_t nb_ports;
+
+ nb_ports = evt_nr_active_lcores(opt->wlcores);
+ nb_ports += opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ? 0 :
+ evt_nr_active_lcores(opt->plcores);
+
+ nb_queues = opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ?
+ rte_eth_dev_count() : atq_nb_event_queues(opt);
const struct rte_event_dev_config config = {
- .nb_event_queues = atq_nb_event_queues(opt),
- .nb_event_ports = perf_nb_event_ports(opt),
+ .nb_event_queues = nb_queues,
+ .nb_event_ports = nb_ports,
.nb_events_limit = 4096,
.nb_event_queue_flows = opt->nb_flows,
.nb_event_port_dequeue_depth = 128,
@@ -208,7 +217,7 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
.nb_atomic_order_sequences = opt->nb_flows,
};
/* queue configurations */
- for (queue = 0; queue < atq_nb_event_queues(opt); queue++) {
+ for (queue = 0; queue < nb_queues; queue++) {
ret = rte_event_queue_setup(opt->dev_id, queue, &q_conf);
if (ret) {
evt_err("failed to setup queue=%d", queue);
@@ -217,7 +226,7 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
}
ret = perf_event_dev_port_setup(test, opt, 1 /* stride */,
- atq_nb_event_queues(opt));
+ nb_queues);
if (ret)
return ret;
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index 9d2865ed5..114210ea6 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -88,6 +88,17 @@ perf_producer(void *arg)
return 0;
}
+static int
+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. */
+ if (t->opt->prod_type == EVT_PROD_TYPE_SYNT)
+ return perf_producer(arg);
+ return 0;
+}
+
static inline uint64_t
processed_pkts(struct test_perf *t)
{
@@ -142,8 +153,8 @@ perf_launch_lcores(struct evt_test *test, struct evt_options *opt,
if (!(opt->plcores[lcore_id]))
continue;
- ret = rte_eal_remote_launch(perf_producer, &t->prod[port_idx],
- lcore_id);
+ ret = rte_eal_remote_launch(perf_producer_wrapper,
+ &t->prod[port_idx], lcore_id);
if (ret) {
evt_err("failed to launch perf_producer %d", lcore_id);
return ret;
@@ -193,14 +204,17 @@ perf_launch_lcores(struct evt_test *test, struct evt_options *opt,
fflush(stdout);
if (remaining <= 0) {
- t->done = true;
t->result = EVT_TEST_SUCCESS;
- rte_smp_wmb();
- break;
+ if (opt->prod_type == EVT_PROD_TYPE_SYNT) {
+ t->done = true;
+ rte_smp_wmb();
+ break;
+ }
}
}
- if (new_cycles - dead_lock_cycles > dead_lock_sample) {
+ if (new_cycles - dead_lock_cycles > dead_lock_sample &&
+ opt->prod_type == EVT_PROD_TYPE_SYNT) {
remaining = t->outstand_pkts - processed_pkts(t);
if (dead_lock_remaining == remaining) {
rte_event_dev_dump(opt->dev_id, stdout);
diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h
index c6fc70cd7..ab2e59988 100644
--- a/app/test-eventdev/test_perf_common.h
+++ b/app/test-eventdev/test_perf_common.h
@@ -38,6 +38,7 @@
#include <unistd.h>
#include <rte_cycles.h>
+#include <rte_ethdev.h>
#include <rte_eventdev.h>
#include <rte_lcore.h>
#include <rte_malloc.h>
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index d843eea17..0caf5757c 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -182,10 +182,20 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
uint8_t queue;
int nb_stages = opt->nb_stages;
int ret;
+ int nb_ports;
+ int nb_queues;
+
+ nb_ports = evt_nr_active_lcores(opt->wlcores);
+ nb_ports += opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ? 0 :
+ evt_nr_active_lcores(opt->plcores);
+
+ nb_queues = opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ?
+ rte_eth_dev_count() * nb_stages :
+ perf_queue_nb_event_queues(opt);
const struct rte_event_dev_config config = {
- .nb_event_queues = perf_queue_nb_event_queues(opt),
- .nb_event_ports = perf_nb_event_ports(opt),
+ .nb_event_queues = nb_queues,
+ .nb_event_ports = nb_ports,
.nb_events_limit = 4096,
.nb_event_queue_flows = opt->nb_flows,
.nb_event_port_dequeue_depth = 128,
@@ -228,7 +238,7 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
}
ret = perf_event_dev_port_setup(test, opt, nb_stages /* stride */,
- perf_queue_nb_event_queues(opt));
+ nb_queues);
if (ret)
return ret;
--
2.14.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH v2 3/8] app/eventdev: add pktmbuf pool for ethdev
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 1/8] app/eventdev: add ethernet device producer option Pavan Nikhilesh
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 2/8] app/eventdev: modify app setup to support ethdev Pavan Nikhilesh
@ 2017-12-11 11:12 ` Pavan Nikhilesh
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 4/8] app/eventdev: add ethernet device setup helpers Pavan Nikhilesh
` (5 subsequent siblings)
7 siblings, 0 replies; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-12-11 11:12 UTC (permalink / raw)
To: jerin.jacob, bruce.richardson, harry.van.haaren, gage.eads,
hemant.agrawal, nipun.gupta, nikhil.rao, santosh.shukla
Cc: dev, Pavan Nikhilesh
Add pktmbuf pool creation used when configuring ethernet device as event
producer.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
v2 Changes:
- Set cache size as 512.
app/test-eventdev/test_perf_common.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index 114210ea6..18945c0eb 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -412,13 +412,24 @@ perf_mempool_setup(struct evt_test *test, struct evt_options *opt)
{
struct test_perf *t = evt_test_priv(test);
- t->pool = rte_mempool_create(test->name, /* mempool name */
+ if (opt->prod_type == EVT_PROD_TYPE_SYNT) {
+ t->pool = rte_mempool_create(test->name, /* mempool name */
opt->pool_sz, /* number of elements*/
sizeof(struct perf_elt), /* element size*/
512, /* cache size*/
0, NULL, NULL,
perf_elt_init, /* obj constructor */
NULL, opt->socket_id, 0); /* flags */
+ } else {
+ t->pool = rte_pktmbuf_pool_create(test->name, /* mempool name */
+ opt->pool_sz, /* number of elements*/
+ 512, /* cache size*/
+ 0,
+ RTE_MBUF_DEFAULT_BUF_SIZE,
+ opt->socket_id); /* flags */
+
+ }
+
if (t->pool == NULL) {
evt_err("failed to create mempool");
return -ENOMEM;
--
2.14.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH v2 4/8] app/eventdev: add ethernet device setup helpers
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 1/8] app/eventdev: add ethernet device producer option Pavan Nikhilesh
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 2/8] app/eventdev: modify app setup to support ethdev Pavan Nikhilesh
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 3/8] app/eventdev: add pktmbuf pool for ethdev Pavan Nikhilesh
@ 2017-12-11 11:12 ` Pavan Nikhilesh
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 5/8] app/eventdev: add ethernet device tear down Pavan Nikhilesh
` (4 subsequent siblings)
7 siblings, 0 replies; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-12-11 11:12 UTC (permalink / raw)
To: jerin.jacob, bruce.richardson, harry.van.haaren, gage.eads,
hemant.agrawal, nipun.gupta, nikhil.rao, santosh.shukla
Cc: dev, Pavan Nikhilesh
Add ethernet device setup functions to configure ethdev ports incase
prod_type_ethdev option is enabled.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
v2 Changes:
- Removed unnecessary "\n" from evt_err, reworked ethernet queue setup.
app/test-eventdev/test_perf_atq.c | 1 +
app/test-eventdev/test_perf_common.c | 65 ++++++++++++++++++++++++++++++++++++
app/test-eventdev/test_perf_common.h | 1 +
app/test-eventdev/test_perf_queue.c | 1 +
4 files changed, 68 insertions(+)
diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c
index 6082d4ff3..a2067345d 100644
--- a/app/test-eventdev/test_perf_atq.c
+++ b/app/test-eventdev/test_perf_atq.c
@@ -280,6 +280,7 @@ static const struct evt_test_ops perf_atq = {
.opt_check = perf_atq_opt_check,
.opt_dump = perf_atq_opt_dump,
.test_setup = perf_test_setup,
+ .ethdev_setup = perf_ethdev_setup,
.mempool_setup = perf_mempool_setup,
.eventdev_setup = perf_atq_eventdev_setup,
.launch_lcores = perf_atq_launch_lcores,
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index 18945c0eb..ff5c499f9 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -407,6 +407,71 @@ perf_elt_init(struct rte_mempool *mp, void *arg __rte_unused,
memset(obj, 0, mp->elt_size);
}
+#define NB_RX_DESC 128
+#define NB_TX_DESC 512
+int
+perf_ethdev_setup(struct evt_test *test, struct evt_options *opt)
+{
+ int i;
+ struct test_perf *t = evt_test_priv(test);
+ struct rte_eth_conf port_conf = {
+ .rxmode = {
+ .mq_mode = ETH_MQ_RX_RSS,
+ .max_rx_pkt_len = ETHER_MAX_LEN,
+ .split_hdr_size = 0,
+ .header_split = 0,
+ .hw_ip_checksum = 0,
+ .hw_vlan_filter = 0,
+ .hw_vlan_strip = 0,
+ .hw_vlan_extend = 0,
+ .jumbo_frame = 0,
+ .hw_strip_crc = 1,
+ },
+ .rx_adv_conf = {
+ .rss_conf = {
+ .rss_key = NULL,
+ .rss_hf = ETH_RSS_IP,
+ },
+ },
+ };
+
+ if (opt->prod_type == EVT_PROD_TYPE_SYNT)
+ return 0;
+
+ if (!rte_eth_dev_count()) {
+ evt_err("No ethernet ports found.");
+ return -ENODEV;
+ }
+
+ for (i = 0; i < rte_eth_dev_count(); i++) {
+
+ if (rte_eth_dev_configure(i, 1, 1,
+ &port_conf)
+ < 0) {
+ evt_err("Failed to configure eth port [%d]", i);
+ return -EINVAL;
+ }
+
+ if (rte_eth_rx_queue_setup(i, 0, NB_RX_DESC,
+ rte_socket_id(), NULL, t->pool) < 0) {
+ evt_err("Failed to setup eth port [%d] rx_queue: %d.",
+ i, 0);
+ return -EINVAL;
+ }
+
+ if (rte_eth_tx_queue_setup(i, 0, NB_TX_DESC,
+ rte_socket_id(), NULL) < 0) {
+ evt_err("Failed to setup eth port [%d] tx_queue: %d.",
+ i, 0);
+ return -EINVAL;
+ }
+
+ rte_eth_promiscuous_enable(i);
+ }
+
+ return 0;
+}
+
int
perf_mempool_setup(struct evt_test *test, struct evt_options *opt)
{
diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h
index ab2e59988..5c6a615ef 100644
--- a/app/test-eventdev/test_perf_common.h
+++ b/app/test-eventdev/test_perf_common.h
@@ -157,6 +157,7 @@ perf_nb_event_ports(struct evt_options *opt)
int perf_test_result(struct evt_test *test, struct evt_options *opt);
int perf_opt_check(struct evt_options *opt, uint64_t nb_queues);
int perf_test_setup(struct evt_test *test, struct evt_options *opt);
+int perf_ethdev_setup(struct evt_test *test, struct evt_options *opt);
int perf_mempool_setup(struct evt_test *test, struct evt_options *opt);
int perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
uint8_t stride, uint8_t nb_queues);
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index 0caf5757c..18e1bd59b 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -293,6 +293,7 @@ static const struct evt_test_ops perf_queue = {
.opt_dump = perf_queue_opt_dump,
.test_setup = perf_test_setup,
.mempool_setup = perf_mempool_setup,
+ .ethdev_setup = perf_ethdev_setup,
.eventdev_setup = perf_queue_eventdev_setup,
.launch_lcores = perf_queue_launch_lcores,
.eventdev_destroy = perf_eventdev_destroy,
--
2.14.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH v2 5/8] app/eventdev: add ethernet device tear down
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 1/8] app/eventdev: add ethernet device producer option Pavan Nikhilesh
` (2 preceding siblings ...)
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 4/8] app/eventdev: add ethernet device setup helpers Pavan Nikhilesh
@ 2017-12-11 11:12 ` Pavan Nikhilesh
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 6/8] app/eventdev: add event Rx adapter setup Pavan Nikhilesh
` (3 subsequent siblings)
7 siblings, 0 replies; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-12-11 11:12 UTC (permalink / raw)
To: jerin.jacob, bruce.richardson, harry.van.haaren, gage.eads,
hemant.agrawal, nipun.gupta, nikhil.rao, santosh.shukla
Cc: dev, Pavan Nikhilesh
Add ethernet device destroy functions to stop and close ethdev ports
if they are configured when prod_type_ethdev option is enabled.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
app/test-eventdev/test_perf_atq.c | 1 +
app/test-eventdev/test_perf_common.c | 13 +++++++++++++
app/test-eventdev/test_perf_common.h | 1 +
app/test-eventdev/test_perf_queue.c | 1 +
4 files changed, 16 insertions(+)
diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c
index a2067345d..3aa12f56f 100644
--- a/app/test-eventdev/test_perf_atq.c
+++ b/app/test-eventdev/test_perf_atq.c
@@ -286,6 +286,7 @@ static const struct evt_test_ops perf_atq = {
.launch_lcores = perf_atq_launch_lcores,
.eventdev_destroy = perf_eventdev_destroy,
.mempool_destroy = perf_mempool_destroy,
+ .ethdev_destroy = perf_ethdev_destroy,
.test_result = perf_test_result,
.test_destroy = perf_test_destroy,
};
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index ff5c499f9..03be8171c 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -472,6 +472,19 @@ perf_ethdev_setup(struct evt_test *test, struct evt_options *opt)
return 0;
}
+void perf_ethdev_destroy(struct evt_test *test, struct evt_options *opt)
+{
+ int i;
+ RTE_SET_USED(test);
+
+ if (opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR) {
+ for (i = 0; i < rte_eth_dev_count(); i++) {
+ rte_eth_dev_stop(i);
+ rte_eth_dev_close(i);
+ }
+ }
+}
+
int
perf_mempool_setup(struct evt_test *test, struct evt_options *opt)
{
diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h
index 5c6a615ef..f33365628 100644
--- a/app/test-eventdev/test_perf_common.h
+++ b/app/test-eventdev/test_perf_common.h
@@ -167,6 +167,7 @@ int perf_launch_lcores(struct evt_test *test, struct evt_options *opt,
void perf_opt_dump(struct evt_options *opt, uint8_t nb_queues);
void perf_test_destroy(struct evt_test *test, struct evt_options *opt);
void perf_eventdev_destroy(struct evt_test *test, struct evt_options *opt);
+void perf_ethdev_destroy(struct evt_test *test, struct evt_options *opt);
void perf_mempool_destroy(struct evt_test *test, struct evt_options *opt);
#endif /* _TEST_PERF_COMMON_ */
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index 18e1bd59b..d606878a1 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -298,6 +298,7 @@ static const struct evt_test_ops perf_queue = {
.launch_lcores = perf_queue_launch_lcores,
.eventdev_destroy = perf_eventdev_destroy,
.mempool_destroy = perf_mempool_destroy,
+ .ethdev_destroy = perf_ethdev_destroy,
.test_result = perf_test_result,
.test_destroy = perf_test_destroy,
};
--
2.14.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH v2 6/8] app/eventdev: add event Rx adapter setup
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 1/8] app/eventdev: add ethernet device producer option Pavan Nikhilesh
` (3 preceding siblings ...)
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 5/8] app/eventdev: add ethernet device tear down Pavan Nikhilesh
@ 2017-12-11 11:12 ` Pavan Nikhilesh
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 7/8] app/eventdev: add service core configuration Pavan Nikhilesh
` (2 subsequent siblings)
7 siblings, 0 replies; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-12-11 11:12 UTC (permalink / raw)
To: jerin.jacob, bruce.richardson, harry.van.haaren, gage.eads,
hemant.agrawal, nipun.gupta, nikhil.rao, santosh.shukla
Cc: dev, Pavan Nikhilesh
Add functions to setup and configure Rx adapter based on the number of
ethdev ports setup.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
v2 Changes:
- Used default eventdev config values instead of hardcoded values.
app/test-eventdev/test_perf_atq.c | 19 ++++--
app/test-eventdev/test_perf_common.c | 111 +++++++++++++++++++++++++++++------
app/test-eventdev/test_perf_common.h | 1 +
app/test-eventdev/test_perf_queue.c | 16 ++++-
4 files changed, 120 insertions(+), 27 deletions(-)
diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c
index 3aa12f56f..1fe16ed63 100644
--- a/app/test-eventdev/test_perf_atq.c
+++ b/app/test-eventdev/test_perf_atq.c
@@ -187,6 +187,7 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
uint8_t queue;
uint8_t nb_queues;
uint8_t nb_ports;
+ struct rte_event_dev_info dev_info;
nb_ports = evt_nr_active_lcores(opt->wlcores);
nb_ports += opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ? 0 :
@@ -195,13 +196,22 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
nb_queues = opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ?
rte_eth_dev_count() : atq_nb_event_queues(opt);
+ memset(&dev_info, 0, sizeof(struct rte_event_dev_info));
+ ret = rte_event_dev_info_get(opt->dev_id, &dev_info);
+ if (ret) {
+ evt_err("failed to get eventdev info %d", opt->dev_id);
+ return ret;
+ }
+
const struct rte_event_dev_config config = {
.nb_event_queues = nb_queues,
.nb_event_ports = nb_ports,
- .nb_events_limit = 4096,
+ .nb_events_limit = dev_info.max_num_events,
.nb_event_queue_flows = opt->nb_flows,
- .nb_event_port_dequeue_depth = 128,
- .nb_event_port_enqueue_depth = 128,
+ .nb_event_port_dequeue_depth =
+ dev_info.max_event_port_dequeue_depth,
+ .nb_event_port_enqueue_depth =
+ dev_info.max_event_port_enqueue_depth,
};
ret = rte_event_dev_configure(opt->dev_id, &config);
@@ -225,8 +235,7 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
}
}
- ret = perf_event_dev_port_setup(test, opt, 1 /* stride */,
- nb_queues);
+ ret = perf_event_dev_port_setup(test, opt, 1 /* stride */, nb_queues);
if (ret)
return ret;
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index 03be8171c..483103b11 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -231,19 +231,79 @@ perf_launch_lcores(struct evt_test *test, struct evt_options *opt,
return 0;
}
+static int
+perf_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride,
+ struct rte_event_port_conf prod_conf)
+{
+ int ret = 0;
+ uint16_t prod;
+
+ struct rte_event_eth_rx_adapter_queue_conf queue_conf = {
+ .ev.event = 0,
+ .ev.sched_type = opt->sched_type_list[0],
+ };
+
+ for (prod = 0; prod < rte_eth_dev_count(); prod++) {
+ uint32_t cap;
+
+ ret = rte_event_eth_rx_adapter_caps_get(opt->dev_id,
+ prod, &cap);
+ if (ret) {
+ evt_err("failed to get event rx adapter[%d]"
+ " capabilities",
+ opt->dev_id);
+ return ret;
+ }
+ queue_conf.ev.queue_id = prod * stride;
+ ret = rte_event_eth_rx_adapter_create(prod, opt->dev_id,
+ &prod_conf);
+ if (ret) {
+ evt_err("failed to create rx adapter[%d]", prod);
+ return ret;
+ }
+ ret = rte_event_eth_rx_adapter_queue_add(prod, prod, -1,
+ &queue_conf);
+ if (ret) {
+ evt_err("failed to add rx queues to adapter[%d]", prod);
+ return ret;
+ }
+
+ ret = rte_eth_dev_start(prod);
+ if (ret) {
+ evt_err("Ethernet dev [%d] failed to start."
+ " Using synthetic producer", prod);
+ return ret;
+ }
+
+ ret = rte_event_eth_rx_adapter_start(prod);
+ if (ret) {
+ evt_err("Rx adapter[%d] start failed", prod);
+ return ret;
+ }
+ printf("%s: Port[%d] using Rx adapter[%d] started\n", __func__,
+ prod, prod);
+ }
+
+ return ret;
+}
+
int
perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
uint8_t stride, uint8_t nb_queues)
{
struct test_perf *t = evt_test_priv(test);
- uint8_t port, prod;
+ uint16_t port, prod;
int ret = -1;
+ struct rte_event_port_conf port_conf;
+
+ memset(&port_conf, 0, sizeof(struct rte_event_port_conf));
+ rte_event_port_default_conf_get(opt->dev_id, 0, &port_conf);
/* port configuration */
const struct rte_event_port_conf wkr_p_conf = {
.dequeue_depth = opt->wkr_deq_dep,
- .enqueue_depth = 64,
- .new_event_threshold = 4096,
+ .enqueue_depth = port_conf.enqueue_depth,
+ .new_event_threshold = port_conf.new_event_threshold,
};
/* setup one port per worker, linking to all queues */
@@ -271,26 +331,38 @@ perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
}
/* port for producers, no links */
- const struct rte_event_port_conf prod_conf = {
- .dequeue_depth = 8,
- .enqueue_depth = 32,
- .new_event_threshold = 1200,
+ struct rte_event_port_conf prod_conf = {
+ .dequeue_depth = port_conf.dequeue_depth,
+ .enqueue_depth = port_conf.enqueue_depth,
+ .new_event_threshold = port_conf.new_event_threshold,
};
- prod = 0;
- for ( ; port < perf_nb_event_ports(opt); port++) {
- struct prod_data *p = &t->prod[port];
-
- p->dev_id = opt->dev_id;
- p->port_id = port;
- p->queue_id = prod * stride;
- p->t = t;
+ if (opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR) {
+ for ( ; port < perf_nb_event_ports(opt); port++) {
+ struct prod_data *p = &t->prod[port];
+ p->t = t;
+ }
- ret = rte_event_port_setup(opt->dev_id, port, &prod_conf);
- if (ret) {
- evt_err("failed to setup port %d", port);
+ ret = perf_event_rx_adapter_setup(opt, stride, prod_conf);
+ if (ret)
return ret;
+ } else {
+ prod = 0;
+ for ( ; port < perf_nb_event_ports(opt); port++) {
+ struct prod_data *p = &t->prod[port];
+
+ p->dev_id = opt->dev_id;
+ p->port_id = port;
+ p->queue_id = prod * stride;
+ p->t = t;
+
+ ret = rte_event_port_setup(opt->dev_id, port,
+ &prod_conf);
+ if (ret) {
+ evt_err("failed to setup port %d", port);
+ return ret;
+ }
+ prod++;
}
- prod++;
}
return ret;
@@ -479,6 +551,7 @@ void perf_ethdev_destroy(struct evt_test *test, struct evt_options *opt)
if (opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR) {
for (i = 0; i < rte_eth_dev_count(); i++) {
+ rte_event_eth_rx_adapter_stop(i);
rte_eth_dev_stop(i);
rte_eth_dev_close(i);
}
diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h
index f33365628..95a217495 100644
--- a/app/test-eventdev/test_perf_common.h
+++ b/app/test-eventdev/test_perf_common.h
@@ -40,6 +40,7 @@
#include <rte_cycles.h>
#include <rte_ethdev.h>
#include <rte_eventdev.h>
+#include <rte_event_eth_rx_adapter.h>
#include <rte_lcore.h>
#include <rte_malloc.h>
#include <rte_mempool.h>
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index d606878a1..e446c5437 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -184,6 +184,7 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
int ret;
int nb_ports;
int nb_queues;
+ struct rte_event_dev_info dev_info;
nb_ports = evt_nr_active_lcores(opt->wlcores);
nb_ports += opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ? 0 :
@@ -193,13 +194,22 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
rte_eth_dev_count() * nb_stages :
perf_queue_nb_event_queues(opt);
+ memset(&dev_info, 0, sizeof(struct rte_event_dev_info));
+ ret = rte_event_dev_info_get(opt->dev_id, &dev_info);
+ if (ret) {
+ evt_err("failed to get eventdev info %d", opt->dev_id);
+ return ret;
+ }
+
const struct rte_event_dev_config config = {
.nb_event_queues = nb_queues,
.nb_event_ports = nb_ports,
- .nb_events_limit = 4096,
+ .nb_events_limit = dev_info.max_num_events,
.nb_event_queue_flows = opt->nb_flows,
- .nb_event_port_dequeue_depth = 128,
- .nb_event_port_enqueue_depth = 128,
+ .nb_event_port_dequeue_depth =
+ dev_info.max_event_port_dequeue_depth,
+ .nb_event_port_enqueue_depth =
+ dev_info.max_event_port_enqueue_depth,
};
ret = rte_event_dev_configure(opt->dev_id, &config);
--
2.14.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH v2 7/8] app/eventdev: add service core configuration
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 1/8] app/eventdev: add ethernet device producer option Pavan Nikhilesh
` (4 preceding siblings ...)
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 6/8] app/eventdev: add event Rx adapter setup Pavan Nikhilesh
@ 2017-12-11 11:12 ` Pavan Nikhilesh
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 8/8] doc: update app eventdev options Pavan Nikhilesh
2017-12-16 9:34 ` [dpdk-dev] [PATCH v2 1/8] app/eventdev: add ethernet device producer option Jerin Jacob
7 siblings, 0 replies; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-12-11 11:12 UTC (permalink / raw)
To: jerin.jacob, bruce.richardson, harry.van.haaren, gage.eads,
hemant.agrawal, nipun.gupta, nikhil.rao, santosh.shukla
Cc: dev, Pavan Nikhilesh
Add service core configuration for Rx adapter. The configuration picks
the least used service core to run the service on.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
app/test-eventdev/evt_common.h | 41 ++++++++++++++++--------------------
app/test-eventdev/test_perf_atq.c | 12 +++++++----
app/test-eventdev/test_perf_common.c | 13 ++++++++++++
app/test-eventdev/test_perf_queue.c | 12 +++++++----
4 files changed, 47 insertions(+), 31 deletions(-)
diff --git a/app/test-eventdev/evt_common.h b/app/test-eventdev/evt_common.h
index 0fadab4a0..042823a52 100644
--- a/app/test-eventdev/evt_common.h
+++ b/app/test-eventdev/evt_common.h
@@ -94,41 +94,36 @@ evt_has_all_types_queue(uint8_t dev_id)
}
static inline int
-evt_service_setup(uint8_t dev_id)
+evt_service_setup(uint32_t service_id)
{
- uint32_t service_id;
int32_t core_cnt;
unsigned int lcore = 0;
uint32_t core_array[RTE_MAX_LCORE];
uint8_t cnt;
uint8_t min_cnt = UINT8_MAX;
- if (evt_has_distributed_sched(dev_id))
- return 0;
-
if (!rte_service_lcore_count())
return -ENOENT;
- if (!rte_event_dev_service_id_get(dev_id, &service_id)) {
- core_cnt = rte_service_lcore_list(core_array,
- RTE_MAX_LCORE);
- if (core_cnt < 0)
- return -ENOENT;
- /* Get the core which has least number of services running. */
- while (core_cnt--) {
- /* Reset default mapping */
- rte_service_map_lcore_set(service_id,
- core_array[core_cnt], 0);
- cnt = rte_service_lcore_count_services(
- core_array[core_cnt]);
- if (cnt < min_cnt) {
- lcore = core_array[core_cnt];
- min_cnt = cnt;
- }
+ core_cnt = rte_service_lcore_list(core_array,
+ RTE_MAX_LCORE);
+ if (core_cnt < 0)
+ return -ENOENT;
+ /* Get the core which has least number of services running. */
+ while (core_cnt--) {
+ /* Reset default mapping */
+ rte_service_map_lcore_set(service_id,
+ core_array[core_cnt], 0);
+ cnt = rte_service_lcore_count_services(
+ core_array[core_cnt]);
+ if (cnt < min_cnt) {
+ lcore = core_array[core_cnt];
+ min_cnt = cnt;
}
- if (rte_service_map_lcore_set(service_id, lcore, 1))
- return -ENOENT;
}
+ if (rte_service_map_lcore_set(service_id, lcore, 1))
+ return -ENOENT;
+
return 0;
}
diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c
index 1fe16ed63..8ca07d4f8 100644
--- a/app/test-eventdev/test_perf_atq.c
+++ b/app/test-eventdev/test_perf_atq.c
@@ -239,10 +239,14 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
if (ret)
return ret;
- ret = evt_service_setup(opt->dev_id);
- if (ret) {
- evt_err("No service lcore found to run event dev.");
- return ret;
+ if (!evt_has_distributed_sched(opt->dev_id)) {
+ uint32_t service_id;
+ rte_event_dev_service_id_get(opt->dev_id, &service_id);
+ ret = evt_service_setup(service_id);
+ if (ret) {
+ evt_err("No service lcore found to run event dev.");
+ return ret;
+ }
}
ret = rte_event_dev_start(opt->dev_id);
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index 483103b11..e03a80272 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -268,6 +268,19 @@ perf_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride,
return ret;
}
+ if (!(cap & RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT)) {
+ uint32_t service_id;
+
+ rte_event_eth_rx_adapter_service_id_get(prod,
+ &service_id);
+ ret = evt_service_setup(service_id);
+ if (ret) {
+ evt_err("Failed to setup service core"
+ " for Rx adapter\n");
+ return ret;
+ }
+ }
+
ret = rte_eth_dev_start(prod);
if (ret) {
evt_err("Ethernet dev [%d] failed to start."
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index e446c5437..4583122b3 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -252,10 +252,14 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
if (ret)
return ret;
- ret = evt_service_setup(opt->dev_id);
- if (ret) {
- evt_err("No service lcore found to run event dev.");
- return ret;
+ if (!evt_has_distributed_sched(opt->dev_id)) {
+ uint32_t service_id;
+ rte_event_dev_service_id_get(opt->dev_id, &service_id);
+ ret = evt_service_setup(service_id);
+ if (ret) {
+ evt_err("No service lcore found to run event dev.");
+ return ret;
+ }
}
ret = rte_event_dev_start(opt->dev_id);
--
2.14.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH v2 8/8] doc: update app eventdev options
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 1/8] app/eventdev: add ethernet device producer option Pavan Nikhilesh
` (5 preceding siblings ...)
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 7/8] app/eventdev: add service core configuration Pavan Nikhilesh
@ 2017-12-11 11:12 ` Pavan Nikhilesh
2017-12-16 9:34 ` [dpdk-dev] [PATCH v2 1/8] app/eventdev: add ethernet device producer option Jerin Jacob
7 siblings, 0 replies; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-12-11 11:12 UTC (permalink / raw)
To: jerin.jacob, bruce.richardson, harry.van.haaren, gage.eads,
hemant.agrawal, nipun.gupta, nikhil.rao, santosh.shukla
Cc: dev, Pavan Nikhilesh
Update documentation about new --prod_type_ethdev option in app/eventdev.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
doc/guides/tools/testeventdev.rst | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/doc/guides/tools/testeventdev.rst b/doc/guides/tools/testeventdev.rst
index 5aa2237b5..11e608b74 100644
--- a/doc/guides/tools/testeventdev.rst
+++ b/doc/guides/tools/testeventdev.rst
@@ -146,6 +146,9 @@ The following are the application command-line options:
Enable queue priority.
+* ``--prod_type_ethdev``
+
+ Use ethernet device as producer.
Eventdev Tests
--------------
@@ -348,6 +351,10 @@ the timestamp in the event on the first stage and then on termination, it
updates the number of cycles to forward a packet. The application uses this
value to compute the average latency to a forward packet.
+When ``--prod_type_ethdev`` command line option is selected, the application
+uses the probed ethernet devices as producers by configuring them as Rx
+adapters instead of using synthetic producers.
+
Application options
^^^^^^^^^^^^^^^^^^^
@@ -366,6 +373,7 @@ Supported application command line options are following::
--worker_deq_depth
--fwd_latency
--queue_priority
+ --prod_type_ethdev
Example
^^^^^^^
@@ -377,6 +385,12 @@ Example command to run perf queue test:
sudo build/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 ethernet ports:
+
+.. code-block:: console
+
+ sudo build/app/dpdk-test-eventdev --vdev=event_sw0 -- \
+ --test=perf_queue --plcores=2 --wlcore=3 --stlist=p --prod_type_ethdev
PERF_ATQ Test
~~~~~~~~~~~~~~~
@@ -443,6 +457,7 @@ Supported application command line options are following::
--nb_pkts
--worker_deq_depth
--fwd_latency
+ --prod_type_ethdev
Example
^^^^^^^
--
2.14.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH v3 1/8] app/eventdev: add ethernet device producer option
2017-10-18 12:39 [dpdk-dev] [PATCH 0/8] app/eventdev: add event eth Rx adapter support Pavan Nikhilesh
` (9 preceding siblings ...)
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 1/8] app/eventdev: add ethernet device producer option Pavan Nikhilesh
@ 2017-12-11 15:13 ` Pavan Nikhilesh
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 2/8] app/eventdev: modify app setup to support ethdev Pavan Nikhilesh
` (6 more replies)
10 siblings, 7 replies; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-12-11 15:13 UTC (permalink / raw)
To: jerin.jacob, bruce.richardson, harry.van.haaren, gage.eads,
hemant.agrawal, nipun.gupta, nikhil.rao, santosh.shukla
Cc: dev, Pavan Nikhilesh
Add command line option --prod_type_ethdev to specify that the events
are generated by ethernet device.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
v2 Changes:
- Modified 'evt_parse_prod_type' to 'evt_parse_eth_prod_type' to accommodate
other kinds of producers in future.
app/test-eventdev/evt_options.c | 11 +++++++++++
app/test-eventdev/evt_options.h | 29 +++++++++++++++++++++++++++++
app/test-eventdev/test_perf_common.c | 34 ++++++++++++++++++++--------------
3 files changed, 60 insertions(+), 14 deletions(-)
diff --git a/app/test-eventdev/evt_options.c b/app/test-eventdev/evt_options.c
index e2187dfc3..86e428905 100644
--- a/app/test-eventdev/evt_options.c
+++ b/app/test-eventdev/evt_options.c
@@ -55,6 +55,7 @@ evt_options_default(struct evt_options *opt)
opt->pool_sz = 16 * 1024;
opt->wkr_deq_dep = 16;
opt->nb_pkts = (1ULL << 26); /* do ~64M packets */
+ opt->prod_type = EVT_PROD_TYPE_SYNT;
}
typedef int (*option_parser_t)(struct evt_options *opt,
@@ -106,6 +107,13 @@ evt_parse_queue_priority(struct evt_options *opt, const char *arg __rte_unused)
return 0;
}
+static int
+evt_parse_eth_prod_type(struct evt_options *opt, const char *arg __rte_unused)
+{
+ opt->prod_type = EVT_PROD_TYPE_ETH_RX_ADPTR;
+ return 0;
+}
+
static int
evt_parse_test_name(struct evt_options *opt, const char *arg)
{
@@ -189,6 +197,7 @@ usage(char *program)
"\t--worker_deq_depth : dequeue depth of the worker\n"
"\t--fwd_latency : perform fwd_latency measurement\n"
"\t--queue_priority : enable queue priority\n"
+ "\t--prod_type_ethdev : use ethernet device as producer\n."
);
printf("available tests:\n");
evt_test_dump_names();
@@ -249,6 +258,7 @@ static struct option lgopts[] = {
{ EVT_SCHED_TYPE_LIST, 1, 0, 0 },
{ EVT_FWD_LATENCY, 0, 0, 0 },
{ EVT_QUEUE_PRIORITY, 0, 0, 0 },
+ { EVT_PROD_ETHDEV, 0, 0, 0 },
{ EVT_HELP, 0, 0, 0 },
{ NULL, 0, 0, 0 }
};
@@ -272,6 +282,7 @@ evt_opts_parse_long(int opt_idx, struct evt_options *opt)
{ EVT_SCHED_TYPE_LIST, evt_parse_sched_type_list},
{ EVT_FWD_LATENCY, evt_parse_fwd_latency},
{ EVT_QUEUE_PRIORITY, evt_parse_queue_priority},
+ { EVT_PROD_ETHDEV, evt_parse_eth_prod_type},
};
for (i = 0; i < RTE_DIM(parsermap); i++) {
diff --git a/app/test-eventdev/evt_options.h b/app/test-eventdev/evt_options.h
index a9a91252b..da7a6f863 100644
--- a/app/test-eventdev/evt_options.h
+++ b/app/test-eventdev/evt_options.h
@@ -58,8 +58,16 @@
#define EVT_SCHED_TYPE_LIST ("stlist")
#define EVT_FWD_LATENCY ("fwd_latency")
#define EVT_QUEUE_PRIORITY ("queue_priority")
+#define EVT_PROD_ETHDEV ("prod_type_ethdev")
#define EVT_HELP ("help")
+enum evt_prod_type {
+ EVT_PROD_TYPE_NONE,
+ EVT_PROD_TYPE_SYNT, /* Producer type Synthetic i.e. CPU. */
+ EVT_PROD_TYPE_ETH_RX_ADPTR, /* Producer type Eth Rx Adapter. */
+ EVT_PROD_TYPE_MAX,
+};
+
struct evt_options {
#define EVT_TEST_NAME_MAX_LEN 32
char test_name[EVT_TEST_NAME_MAX_LEN];
@@ -76,6 +84,7 @@ struct evt_options {
uint8_t dev_id;
uint32_t fwd_latency:1;
uint32_t q_priority:1;
+ enum evt_prod_type prod_type;
};
void evt_options_default(struct evt_options *opt);
@@ -266,4 +275,24 @@ evt_dump_sched_type_list(struct evt_options *opt)
evt_dump_end;
}
+#define EVT_PROD_MAX_NAME_LEN 50
+static inline void
+evt_dump_producer_type(struct evt_options *opt)
+{
+ char name[EVT_PROD_MAX_NAME_LEN];
+
+ switch (opt->prod_type) {
+ default:
+ case EVT_PROD_TYPE_SYNT:
+ snprintf(name, EVT_PROD_MAX_NAME_LEN,
+ "Synthetic producer lcores");
+ break;
+ case EVT_PROD_TYPE_ETH_RX_ADPTR:
+ snprintf(name, EVT_PROD_MAX_NAME_LEN,
+ "Ethdev Rx Adapter producers");
+ break;
+ }
+ evt_dump("prod_type", "%s", name);
+}
+
#endif /* _EVT_OPTIONS_ */
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index e77b4723e..9d2865ed5 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -287,8 +287,10 @@ perf_opt_check(struct evt_options *opt, uint64_t nb_queues)
{
unsigned int lcores;
- /* N producer + N worker + 1 master */
- lcores = 3;
+ /* N producer + N worker + 1 master when producer cores are used
+ * Else N worker + 1 master when Rx adapter is used
+ */
+ lcores = opt->prod_type == EVT_PROD_TYPE_SYNT ? 3 : 2;
if (rte_lcore_count() < lcores) {
evt_err("test need minimum %d lcores", lcores);
@@ -313,18 +315,21 @@ perf_opt_check(struct evt_options *opt, uint64_t nb_queues)
return -1;
}
- /* Validate producer lcores */
- if (evt_lcores_has_overlap(opt->plcores, rte_get_master_lcore())) {
- evt_err("producer lcores overlaps with master lcore");
- return -1;
- }
- if (evt_has_disabled_lcore(opt->plcores)) {
- evt_err("one or more producer lcores are not enabled");
- return -1;
- }
- if (!evt_has_active_lcore(opt->plcores)) {
- evt_err("minimum one producer is required");
- return -1;
+ if (opt->prod_type == EVT_PROD_TYPE_SYNT) {
+ /* Validate producer lcores */
+ if (evt_lcores_has_overlap(opt->plcores,
+ rte_get_master_lcore())) {
+ evt_err("producer lcores overlaps with master lcore");
+ return -1;
+ }
+ if (evt_has_disabled_lcore(opt->plcores)) {
+ evt_err("one or more producer lcores are not enabled");
+ return -1;
+ }
+ if (!evt_has_active_lcore(opt->plcores)) {
+ evt_err("minimum one producer is required");
+ return -1;
+ }
}
if (evt_has_invalid_stage(opt))
@@ -369,6 +374,7 @@ perf_opt_dump(struct evt_options *opt, uint8_t nb_queues)
evt_dump("nb_evdev_queues", "%d", nb_queues);
evt_dump_queue_priority(opt);
evt_dump_sched_type_list(opt);
+ evt_dump_producer_type(opt);
}
void
--
2.14.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH v3 2/8] app/eventdev: modify app setup to support ethdev
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 " Pavan Nikhilesh
@ 2017-12-11 15:13 ` Pavan Nikhilesh
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 3/8] app/eventdev: add pktmbuf pool for ethdev Pavan Nikhilesh
` (5 subsequent siblings)
6 siblings, 0 replies; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-12-11 15:13 UTC (permalink / raw)
To: jerin.jacob, bruce.richardson, harry.van.haaren, gage.eads,
hemant.agrawal, nipun.gupta, nikhil.rao, santosh.shukla
Cc: dev, Pavan Nikhilesh
Modify app setup to accommodate event port and queue setup based on the
number of ethernet ports.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
v2 Changes:
- Removed unnecessary RTE_SET_USED() macros.
app/test-eventdev/test_perf_atq.c | 17 +++++++++++++----
app/test-eventdev/test_perf_common.c | 26 ++++++++++++++++++++------
app/test-eventdev/test_perf_common.h | 1 +
app/test-eventdev/test_perf_queue.c | 16 +++++++++++++---
4 files changed, 47 insertions(+), 13 deletions(-)
diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c
index 0e9f2db0e..6082d4ff3 100644
--- a/app/test-eventdev/test_perf_atq.c
+++ b/app/test-eventdev/test_perf_atq.c
@@ -185,10 +185,19 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
{
int ret;
uint8_t queue;
+ uint8_t nb_queues;
+ uint8_t nb_ports;
+
+ nb_ports = evt_nr_active_lcores(opt->wlcores);
+ nb_ports += opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ? 0 :
+ evt_nr_active_lcores(opt->plcores);
+
+ nb_queues = opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ?
+ rte_eth_dev_count() : atq_nb_event_queues(opt);
const struct rte_event_dev_config config = {
- .nb_event_queues = atq_nb_event_queues(opt),
- .nb_event_ports = perf_nb_event_ports(opt),
+ .nb_event_queues = nb_queues,
+ .nb_event_ports = nb_ports,
.nb_events_limit = 4096,
.nb_event_queue_flows = opt->nb_flows,
.nb_event_port_dequeue_depth = 128,
@@ -208,7 +217,7 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
.nb_atomic_order_sequences = opt->nb_flows,
};
/* queue configurations */
- for (queue = 0; queue < atq_nb_event_queues(opt); queue++) {
+ for (queue = 0; queue < nb_queues; queue++) {
ret = rte_event_queue_setup(opt->dev_id, queue, &q_conf);
if (ret) {
evt_err("failed to setup queue=%d", queue);
@@ -217,7 +226,7 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
}
ret = perf_event_dev_port_setup(test, opt, 1 /* stride */,
- atq_nb_event_queues(opt));
+ nb_queues);
if (ret)
return ret;
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index 9d2865ed5..114210ea6 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -88,6 +88,17 @@ perf_producer(void *arg)
return 0;
}
+static int
+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. */
+ if (t->opt->prod_type == EVT_PROD_TYPE_SYNT)
+ return perf_producer(arg);
+ return 0;
+}
+
static inline uint64_t
processed_pkts(struct test_perf *t)
{
@@ -142,8 +153,8 @@ perf_launch_lcores(struct evt_test *test, struct evt_options *opt,
if (!(opt->plcores[lcore_id]))
continue;
- ret = rte_eal_remote_launch(perf_producer, &t->prod[port_idx],
- lcore_id);
+ ret = rte_eal_remote_launch(perf_producer_wrapper,
+ &t->prod[port_idx], lcore_id);
if (ret) {
evt_err("failed to launch perf_producer %d", lcore_id);
return ret;
@@ -193,14 +204,17 @@ perf_launch_lcores(struct evt_test *test, struct evt_options *opt,
fflush(stdout);
if (remaining <= 0) {
- t->done = true;
t->result = EVT_TEST_SUCCESS;
- rte_smp_wmb();
- break;
+ if (opt->prod_type == EVT_PROD_TYPE_SYNT) {
+ t->done = true;
+ rte_smp_wmb();
+ break;
+ }
}
}
- if (new_cycles - dead_lock_cycles > dead_lock_sample) {
+ if (new_cycles - dead_lock_cycles > dead_lock_sample &&
+ opt->prod_type == EVT_PROD_TYPE_SYNT) {
remaining = t->outstand_pkts - processed_pkts(t);
if (dead_lock_remaining == remaining) {
rte_event_dev_dump(opt->dev_id, stdout);
diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h
index c6fc70cd7..ab2e59988 100644
--- a/app/test-eventdev/test_perf_common.h
+++ b/app/test-eventdev/test_perf_common.h
@@ -38,6 +38,7 @@
#include <unistd.h>
#include <rte_cycles.h>
+#include <rte_ethdev.h>
#include <rte_eventdev.h>
#include <rte_lcore.h>
#include <rte_malloc.h>
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index d843eea17..0caf5757c 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -182,10 +182,20 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
uint8_t queue;
int nb_stages = opt->nb_stages;
int ret;
+ int nb_ports;
+ int nb_queues;
+
+ nb_ports = evt_nr_active_lcores(opt->wlcores);
+ nb_ports += opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ? 0 :
+ evt_nr_active_lcores(opt->plcores);
+
+ nb_queues = opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ?
+ rte_eth_dev_count() * nb_stages :
+ perf_queue_nb_event_queues(opt);
const struct rte_event_dev_config config = {
- .nb_event_queues = perf_queue_nb_event_queues(opt),
- .nb_event_ports = perf_nb_event_ports(opt),
+ .nb_event_queues = nb_queues,
+ .nb_event_ports = nb_ports,
.nb_events_limit = 4096,
.nb_event_queue_flows = opt->nb_flows,
.nb_event_port_dequeue_depth = 128,
@@ -228,7 +238,7 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
}
ret = perf_event_dev_port_setup(test, opt, nb_stages /* stride */,
- perf_queue_nb_event_queues(opt));
+ nb_queues);
if (ret)
return ret;
--
2.14.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH v3 3/8] app/eventdev: add pktmbuf pool for ethdev
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 " Pavan Nikhilesh
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 2/8] app/eventdev: modify app setup to support ethdev Pavan Nikhilesh
@ 2017-12-11 15:13 ` Pavan Nikhilesh
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 4/8] app/eventdev: add ethernet device setup helpers Pavan Nikhilesh
` (4 subsequent siblings)
6 siblings, 0 replies; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-12-11 15:13 UTC (permalink / raw)
To: jerin.jacob, bruce.richardson, harry.van.haaren, gage.eads,
hemant.agrawal, nipun.gupta, nikhil.rao, santosh.shukla
Cc: dev, Pavan Nikhilesh
Add pktmbuf pool creation used when configuring ethernet device as event
producer.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
v2 Changes:
- Set cache size as 512.
app/test-eventdev/test_perf_common.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index 114210ea6..18945c0eb 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -412,13 +412,24 @@ perf_mempool_setup(struct evt_test *test, struct evt_options *opt)
{
struct test_perf *t = evt_test_priv(test);
- t->pool = rte_mempool_create(test->name, /* mempool name */
+ if (opt->prod_type == EVT_PROD_TYPE_SYNT) {
+ t->pool = rte_mempool_create(test->name, /* mempool name */
opt->pool_sz, /* number of elements*/
sizeof(struct perf_elt), /* element size*/
512, /* cache size*/
0, NULL, NULL,
perf_elt_init, /* obj constructor */
NULL, opt->socket_id, 0); /* flags */
+ } else {
+ t->pool = rte_pktmbuf_pool_create(test->name, /* mempool name */
+ opt->pool_sz, /* number of elements*/
+ 512, /* cache size*/
+ 0,
+ RTE_MBUF_DEFAULT_BUF_SIZE,
+ opt->socket_id); /* flags */
+
+ }
+
if (t->pool == NULL) {
evt_err("failed to create mempool");
return -ENOMEM;
--
2.14.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH v3 4/8] app/eventdev: add ethernet device setup helpers
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 " Pavan Nikhilesh
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 2/8] app/eventdev: modify app setup to support ethdev Pavan Nikhilesh
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 3/8] app/eventdev: add pktmbuf pool for ethdev Pavan Nikhilesh
@ 2017-12-11 15:13 ` Pavan Nikhilesh
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 5/8] app/eventdev: add ethernet device tear down Pavan Nikhilesh
` (3 subsequent siblings)
6 siblings, 0 replies; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-12-11 15:13 UTC (permalink / raw)
To: jerin.jacob, bruce.richardson, harry.van.haaren, gage.eads,
hemant.agrawal, nipun.gupta, nikhil.rao, santosh.shukla
Cc: dev, Pavan Nikhilesh
Add ethernet device setup functions to configure ethdev ports incase
prod_type_ethdev option is enabled.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
v2 Changes:
- Removed unnecessary "\n" from evt_err, reworked ethernet queue setup.
app/test-eventdev/test_perf_atq.c | 1 +
app/test-eventdev/test_perf_common.c | 65 ++++++++++++++++++++++++++++++++++++
app/test-eventdev/test_perf_common.h | 1 +
app/test-eventdev/test_perf_queue.c | 1 +
4 files changed, 68 insertions(+)
diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c
index 6082d4ff3..a2067345d 100644
--- a/app/test-eventdev/test_perf_atq.c
+++ b/app/test-eventdev/test_perf_atq.c
@@ -280,6 +280,7 @@ static const struct evt_test_ops perf_atq = {
.opt_check = perf_atq_opt_check,
.opt_dump = perf_atq_opt_dump,
.test_setup = perf_test_setup,
+ .ethdev_setup = perf_ethdev_setup,
.mempool_setup = perf_mempool_setup,
.eventdev_setup = perf_atq_eventdev_setup,
.launch_lcores = perf_atq_launch_lcores,
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index 18945c0eb..ff5c499f9 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -407,6 +407,71 @@ perf_elt_init(struct rte_mempool *mp, void *arg __rte_unused,
memset(obj, 0, mp->elt_size);
}
+#define NB_RX_DESC 128
+#define NB_TX_DESC 512
+int
+perf_ethdev_setup(struct evt_test *test, struct evt_options *opt)
+{
+ int i;
+ struct test_perf *t = evt_test_priv(test);
+ struct rte_eth_conf port_conf = {
+ .rxmode = {
+ .mq_mode = ETH_MQ_RX_RSS,
+ .max_rx_pkt_len = ETHER_MAX_LEN,
+ .split_hdr_size = 0,
+ .header_split = 0,
+ .hw_ip_checksum = 0,
+ .hw_vlan_filter = 0,
+ .hw_vlan_strip = 0,
+ .hw_vlan_extend = 0,
+ .jumbo_frame = 0,
+ .hw_strip_crc = 1,
+ },
+ .rx_adv_conf = {
+ .rss_conf = {
+ .rss_key = NULL,
+ .rss_hf = ETH_RSS_IP,
+ },
+ },
+ };
+
+ if (opt->prod_type == EVT_PROD_TYPE_SYNT)
+ return 0;
+
+ if (!rte_eth_dev_count()) {
+ evt_err("No ethernet ports found.");
+ return -ENODEV;
+ }
+
+ for (i = 0; i < rte_eth_dev_count(); i++) {
+
+ if (rte_eth_dev_configure(i, 1, 1,
+ &port_conf)
+ < 0) {
+ evt_err("Failed to configure eth port [%d]", i);
+ return -EINVAL;
+ }
+
+ if (rte_eth_rx_queue_setup(i, 0, NB_RX_DESC,
+ rte_socket_id(), NULL, t->pool) < 0) {
+ evt_err("Failed to setup eth port [%d] rx_queue: %d.",
+ i, 0);
+ return -EINVAL;
+ }
+
+ if (rte_eth_tx_queue_setup(i, 0, NB_TX_DESC,
+ rte_socket_id(), NULL) < 0) {
+ evt_err("Failed to setup eth port [%d] tx_queue: %d.",
+ i, 0);
+ return -EINVAL;
+ }
+
+ rte_eth_promiscuous_enable(i);
+ }
+
+ return 0;
+}
+
int
perf_mempool_setup(struct evt_test *test, struct evt_options *opt)
{
diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h
index ab2e59988..5c6a615ef 100644
--- a/app/test-eventdev/test_perf_common.h
+++ b/app/test-eventdev/test_perf_common.h
@@ -157,6 +157,7 @@ perf_nb_event_ports(struct evt_options *opt)
int perf_test_result(struct evt_test *test, struct evt_options *opt);
int perf_opt_check(struct evt_options *opt, uint64_t nb_queues);
int perf_test_setup(struct evt_test *test, struct evt_options *opt);
+int perf_ethdev_setup(struct evt_test *test, struct evt_options *opt);
int perf_mempool_setup(struct evt_test *test, struct evt_options *opt);
int perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
uint8_t stride, uint8_t nb_queues);
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index 0caf5757c..18e1bd59b 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -293,6 +293,7 @@ static const struct evt_test_ops perf_queue = {
.opt_dump = perf_queue_opt_dump,
.test_setup = perf_test_setup,
.mempool_setup = perf_mempool_setup,
+ .ethdev_setup = perf_ethdev_setup,
.eventdev_setup = perf_queue_eventdev_setup,
.launch_lcores = perf_queue_launch_lcores,
.eventdev_destroy = perf_eventdev_destroy,
--
2.14.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH v3 5/8] app/eventdev: add ethernet device tear down
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 " Pavan Nikhilesh
` (2 preceding siblings ...)
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 4/8] app/eventdev: add ethernet device setup helpers Pavan Nikhilesh
@ 2017-12-11 15:13 ` Pavan Nikhilesh
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 6/8] app/eventdev: add event Rx adapter setup Pavan Nikhilesh
` (2 subsequent siblings)
6 siblings, 0 replies; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-12-11 15:13 UTC (permalink / raw)
To: jerin.jacob, bruce.richardson, harry.van.haaren, gage.eads,
hemant.agrawal, nipun.gupta, nikhil.rao, santosh.shukla
Cc: dev, Pavan Nikhilesh
Add ethernet device destroy functions to stop and close ethdev ports
if they are configured when prod_type_ethdev option is enabled.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
app/test-eventdev/test_perf_atq.c | 1 +
app/test-eventdev/test_perf_common.c | 13 +++++++++++++
app/test-eventdev/test_perf_common.h | 1 +
app/test-eventdev/test_perf_queue.c | 1 +
4 files changed, 16 insertions(+)
diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c
index a2067345d..3aa12f56f 100644
--- a/app/test-eventdev/test_perf_atq.c
+++ b/app/test-eventdev/test_perf_atq.c
@@ -286,6 +286,7 @@ static const struct evt_test_ops perf_atq = {
.launch_lcores = perf_atq_launch_lcores,
.eventdev_destroy = perf_eventdev_destroy,
.mempool_destroy = perf_mempool_destroy,
+ .ethdev_destroy = perf_ethdev_destroy,
.test_result = perf_test_result,
.test_destroy = perf_test_destroy,
};
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index ff5c499f9..03be8171c 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -472,6 +472,19 @@ perf_ethdev_setup(struct evt_test *test, struct evt_options *opt)
return 0;
}
+void perf_ethdev_destroy(struct evt_test *test, struct evt_options *opt)
+{
+ int i;
+ RTE_SET_USED(test);
+
+ if (opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR) {
+ for (i = 0; i < rte_eth_dev_count(); i++) {
+ rte_eth_dev_stop(i);
+ rte_eth_dev_close(i);
+ }
+ }
+}
+
int
perf_mempool_setup(struct evt_test *test, struct evt_options *opt)
{
diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h
index 5c6a615ef..f33365628 100644
--- a/app/test-eventdev/test_perf_common.h
+++ b/app/test-eventdev/test_perf_common.h
@@ -167,6 +167,7 @@ int perf_launch_lcores(struct evt_test *test, struct evt_options *opt,
void perf_opt_dump(struct evt_options *opt, uint8_t nb_queues);
void perf_test_destroy(struct evt_test *test, struct evt_options *opt);
void perf_eventdev_destroy(struct evt_test *test, struct evt_options *opt);
+void perf_ethdev_destroy(struct evt_test *test, struct evt_options *opt);
void perf_mempool_destroy(struct evt_test *test, struct evt_options *opt);
#endif /* _TEST_PERF_COMMON_ */
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index 18e1bd59b..d606878a1 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -298,6 +298,7 @@ static const struct evt_test_ops perf_queue = {
.launch_lcores = perf_queue_launch_lcores,
.eventdev_destroy = perf_eventdev_destroy,
.mempool_destroy = perf_mempool_destroy,
+ .ethdev_destroy = perf_ethdev_destroy,
.test_result = perf_test_result,
.test_destroy = perf_test_destroy,
};
--
2.14.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH v3 6/8] app/eventdev: add event Rx adapter setup
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 " Pavan Nikhilesh
` (3 preceding siblings ...)
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 5/8] app/eventdev: add ethernet device tear down Pavan Nikhilesh
@ 2017-12-11 15:13 ` Pavan Nikhilesh
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 7/8] app/eventdev: add service core configuration Pavan Nikhilesh
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 8/8] doc: update app eventdev options Pavan Nikhilesh
6 siblings, 0 replies; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-12-11 15:13 UTC (permalink / raw)
To: jerin.jacob, bruce.richardson, harry.van.haaren, gage.eads,
hemant.agrawal, nipun.gupta, nikhil.rao, santosh.shukla
Cc: dev, Pavan Nikhilesh
Add functions to setup and configure Rx adapter based on the number of
ethdev ports setup.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
v3 Changes:
- Fix compilation issues for gcc version < 5
v2 Changes:
- Used default eventdev config values instead of hardcoded values.
app/test-eventdev/test_perf_atq.c | 19 ++++--
app/test-eventdev/test_perf_common.c | 110 +++++++++++++++++++++++++++++------
app/test-eventdev/test_perf_common.h | 1 +
app/test-eventdev/test_perf_queue.c | 16 ++++-
4 files changed, 119 insertions(+), 27 deletions(-)
diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c
index 3aa12f56f..1fe16ed63 100644
--- a/app/test-eventdev/test_perf_atq.c
+++ b/app/test-eventdev/test_perf_atq.c
@@ -187,6 +187,7 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
uint8_t queue;
uint8_t nb_queues;
uint8_t nb_ports;
+ struct rte_event_dev_info dev_info;
nb_ports = evt_nr_active_lcores(opt->wlcores);
nb_ports += opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ? 0 :
@@ -195,13 +196,22 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
nb_queues = opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ?
rte_eth_dev_count() : atq_nb_event_queues(opt);
+ memset(&dev_info, 0, sizeof(struct rte_event_dev_info));
+ ret = rte_event_dev_info_get(opt->dev_id, &dev_info);
+ if (ret) {
+ evt_err("failed to get eventdev info %d", opt->dev_id);
+ return ret;
+ }
+
const struct rte_event_dev_config config = {
.nb_event_queues = nb_queues,
.nb_event_ports = nb_ports,
- .nb_events_limit = 4096,
+ .nb_events_limit = dev_info.max_num_events,
.nb_event_queue_flows = opt->nb_flows,
- .nb_event_port_dequeue_depth = 128,
- .nb_event_port_enqueue_depth = 128,
+ .nb_event_port_dequeue_depth =
+ dev_info.max_event_port_dequeue_depth,
+ .nb_event_port_enqueue_depth =
+ dev_info.max_event_port_enqueue_depth,
};
ret = rte_event_dev_configure(opt->dev_id, &config);
@@ -225,8 +235,7 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
}
}
- ret = perf_event_dev_port_setup(test, opt, 1 /* stride */,
- nb_queues);
+ ret = perf_event_dev_port_setup(test, opt, 1 /* stride */, nb_queues);
if (ret)
return ret;
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index 03be8171c..1fd7ef8b1 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -231,19 +231,78 @@ perf_launch_lcores(struct evt_test *test, struct evt_options *opt,
return 0;
}
+static int
+perf_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride,
+ struct rte_event_port_conf prod_conf)
+{
+ int ret = 0;
+ uint16_t prod;
+ struct rte_event_eth_rx_adapter_queue_conf queue_conf;
+
+ memset(&queue_conf, 0,
+ sizeof(struct rte_event_eth_rx_adapter_queue_conf));
+ queue_conf.ev.sched_type = opt->sched_type_list[0];
+ for (prod = 0; prod < rte_eth_dev_count(); prod++) {
+ uint32_t cap;
+
+ ret = rte_event_eth_rx_adapter_caps_get(opt->dev_id,
+ prod, &cap);
+ if (ret) {
+ evt_err("failed to get event rx adapter[%d]"
+ " capabilities",
+ opt->dev_id);
+ return ret;
+ }
+ queue_conf.ev.queue_id = prod * stride;
+ ret = rte_event_eth_rx_adapter_create(prod, opt->dev_id,
+ &prod_conf);
+ if (ret) {
+ evt_err("failed to create rx adapter[%d]", prod);
+ return ret;
+ }
+ ret = rte_event_eth_rx_adapter_queue_add(prod, prod, -1,
+ &queue_conf);
+ if (ret) {
+ evt_err("failed to add rx queues to adapter[%d]", prod);
+ return ret;
+ }
+
+ ret = rte_eth_dev_start(prod);
+ if (ret) {
+ evt_err("Ethernet dev [%d] failed to start."
+ " Using synthetic producer", prod);
+ return ret;
+ }
+
+ ret = rte_event_eth_rx_adapter_start(prod);
+ if (ret) {
+ evt_err("Rx adapter[%d] start failed", prod);
+ return ret;
+ }
+ printf("%s: Port[%d] using Rx adapter[%d] started\n", __func__,
+ prod, prod);
+ }
+
+ return ret;
+}
+
int
perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
uint8_t stride, uint8_t nb_queues)
{
struct test_perf *t = evt_test_priv(test);
- uint8_t port, prod;
+ uint16_t port, prod;
int ret = -1;
+ struct rte_event_port_conf port_conf;
+
+ memset(&port_conf, 0, sizeof(struct rte_event_port_conf));
+ rte_event_port_default_conf_get(opt->dev_id, 0, &port_conf);
/* port configuration */
const struct rte_event_port_conf wkr_p_conf = {
.dequeue_depth = opt->wkr_deq_dep,
- .enqueue_depth = 64,
- .new_event_threshold = 4096,
+ .enqueue_depth = port_conf.enqueue_depth,
+ .new_event_threshold = port_conf.new_event_threshold,
};
/* setup one port per worker, linking to all queues */
@@ -271,26 +330,38 @@ perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
}
/* port for producers, no links */
- const struct rte_event_port_conf prod_conf = {
- .dequeue_depth = 8,
- .enqueue_depth = 32,
- .new_event_threshold = 1200,
+ struct rte_event_port_conf prod_conf = {
+ .dequeue_depth = port_conf.dequeue_depth,
+ .enqueue_depth = port_conf.enqueue_depth,
+ .new_event_threshold = port_conf.new_event_threshold,
};
- prod = 0;
- for ( ; port < perf_nb_event_ports(opt); port++) {
- struct prod_data *p = &t->prod[port];
-
- p->dev_id = opt->dev_id;
- p->port_id = port;
- p->queue_id = prod * stride;
- p->t = t;
+ if (opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR) {
+ for ( ; port < perf_nb_event_ports(opt); port++) {
+ struct prod_data *p = &t->prod[port];
+ p->t = t;
+ }
- ret = rte_event_port_setup(opt->dev_id, port, &prod_conf);
- if (ret) {
- evt_err("failed to setup port %d", port);
+ ret = perf_event_rx_adapter_setup(opt, stride, prod_conf);
+ if (ret)
return ret;
+ } else {
+ prod = 0;
+ for ( ; port < perf_nb_event_ports(opt); port++) {
+ struct prod_data *p = &t->prod[port];
+
+ p->dev_id = opt->dev_id;
+ p->port_id = port;
+ p->queue_id = prod * stride;
+ p->t = t;
+
+ ret = rte_event_port_setup(opt->dev_id, port,
+ &prod_conf);
+ if (ret) {
+ evt_err("failed to setup port %d", port);
+ return ret;
+ }
+ prod++;
}
- prod++;
}
return ret;
@@ -479,6 +550,7 @@ void perf_ethdev_destroy(struct evt_test *test, struct evt_options *opt)
if (opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR) {
for (i = 0; i < rte_eth_dev_count(); i++) {
+ rte_event_eth_rx_adapter_stop(i);
rte_eth_dev_stop(i);
rte_eth_dev_close(i);
}
diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h
index f33365628..95a217495 100644
--- a/app/test-eventdev/test_perf_common.h
+++ b/app/test-eventdev/test_perf_common.h
@@ -40,6 +40,7 @@
#include <rte_cycles.h>
#include <rte_ethdev.h>
#include <rte_eventdev.h>
+#include <rte_event_eth_rx_adapter.h>
#include <rte_lcore.h>
#include <rte_malloc.h>
#include <rte_mempool.h>
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index d606878a1..e446c5437 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -184,6 +184,7 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
int ret;
int nb_ports;
int nb_queues;
+ struct rte_event_dev_info dev_info;
nb_ports = evt_nr_active_lcores(opt->wlcores);
nb_ports += opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ? 0 :
@@ -193,13 +194,22 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
rte_eth_dev_count() * nb_stages :
perf_queue_nb_event_queues(opt);
+ memset(&dev_info, 0, sizeof(struct rte_event_dev_info));
+ ret = rte_event_dev_info_get(opt->dev_id, &dev_info);
+ if (ret) {
+ evt_err("failed to get eventdev info %d", opt->dev_id);
+ return ret;
+ }
+
const struct rte_event_dev_config config = {
.nb_event_queues = nb_queues,
.nb_event_ports = nb_ports,
- .nb_events_limit = 4096,
+ .nb_events_limit = dev_info.max_num_events,
.nb_event_queue_flows = opt->nb_flows,
- .nb_event_port_dequeue_depth = 128,
- .nb_event_port_enqueue_depth = 128,
+ .nb_event_port_dequeue_depth =
+ dev_info.max_event_port_dequeue_depth,
+ .nb_event_port_enqueue_depth =
+ dev_info.max_event_port_enqueue_depth,
};
ret = rte_event_dev_configure(opt->dev_id, &config);
--
2.14.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH v3 7/8] app/eventdev: add service core configuration
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 " Pavan Nikhilesh
` (4 preceding siblings ...)
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 6/8] app/eventdev: add event Rx adapter setup Pavan Nikhilesh
@ 2017-12-11 15:13 ` Pavan Nikhilesh
2017-12-19 10:25 ` Van Haaren, Harry
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 8/8] doc: update app eventdev options Pavan Nikhilesh
6 siblings, 1 reply; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-12-11 15:13 UTC (permalink / raw)
To: jerin.jacob, bruce.richardson, harry.van.haaren, gage.eads,
hemant.agrawal, nipun.gupta, nikhil.rao, santosh.shukla
Cc: dev, Pavan Nikhilesh
Add service core configuration for Rx adapter. The configuration picks
the least used service core to run the service on.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
app/test-eventdev/evt_common.h | 41 ++++++++++++++++--------------------
app/test-eventdev/test_perf_atq.c | 12 +++++++----
app/test-eventdev/test_perf_common.c | 13 ++++++++++++
app/test-eventdev/test_perf_queue.c | 12 +++++++----
4 files changed, 47 insertions(+), 31 deletions(-)
diff --git a/app/test-eventdev/evt_common.h b/app/test-eventdev/evt_common.h
index 0fadab4a0..042823a52 100644
--- a/app/test-eventdev/evt_common.h
+++ b/app/test-eventdev/evt_common.h
@@ -94,41 +94,36 @@ evt_has_all_types_queue(uint8_t dev_id)
}
static inline int
-evt_service_setup(uint8_t dev_id)
+evt_service_setup(uint32_t service_id)
{
- uint32_t service_id;
int32_t core_cnt;
unsigned int lcore = 0;
uint32_t core_array[RTE_MAX_LCORE];
uint8_t cnt;
uint8_t min_cnt = UINT8_MAX;
- if (evt_has_distributed_sched(dev_id))
- return 0;
-
if (!rte_service_lcore_count())
return -ENOENT;
- if (!rte_event_dev_service_id_get(dev_id, &service_id)) {
- core_cnt = rte_service_lcore_list(core_array,
- RTE_MAX_LCORE);
- if (core_cnt < 0)
- return -ENOENT;
- /* Get the core which has least number of services running. */
- while (core_cnt--) {
- /* Reset default mapping */
- rte_service_map_lcore_set(service_id,
- core_array[core_cnt], 0);
- cnt = rte_service_lcore_count_services(
- core_array[core_cnt]);
- if (cnt < min_cnt) {
- lcore = core_array[core_cnt];
- min_cnt = cnt;
- }
+ core_cnt = rte_service_lcore_list(core_array,
+ RTE_MAX_LCORE);
+ if (core_cnt < 0)
+ return -ENOENT;
+ /* Get the core which has least number of services running. */
+ while (core_cnt--) {
+ /* Reset default mapping */
+ rte_service_map_lcore_set(service_id,
+ core_array[core_cnt], 0);
+ cnt = rte_service_lcore_count_services(
+ core_array[core_cnt]);
+ if (cnt < min_cnt) {
+ lcore = core_array[core_cnt];
+ min_cnt = cnt;
}
- if (rte_service_map_lcore_set(service_id, lcore, 1))
- return -ENOENT;
}
+ if (rte_service_map_lcore_set(service_id, lcore, 1))
+ return -ENOENT;
+
return 0;
}
diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c
index 1fe16ed63..8ca07d4f8 100644
--- a/app/test-eventdev/test_perf_atq.c
+++ b/app/test-eventdev/test_perf_atq.c
@@ -239,10 +239,14 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
if (ret)
return ret;
- ret = evt_service_setup(opt->dev_id);
- if (ret) {
- evt_err("No service lcore found to run event dev.");
- return ret;
+ if (!evt_has_distributed_sched(opt->dev_id)) {
+ uint32_t service_id;
+ rte_event_dev_service_id_get(opt->dev_id, &service_id);
+ ret = evt_service_setup(service_id);
+ if (ret) {
+ evt_err("No service lcore found to run event dev.");
+ return ret;
+ }
}
ret = rte_event_dev_start(opt->dev_id);
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index 1fd7ef8b1..9aff31f20 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -267,6 +267,19 @@ perf_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride,
return ret;
}
+ if (!(cap & RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT)) {
+ uint32_t service_id;
+
+ rte_event_eth_rx_adapter_service_id_get(prod,
+ &service_id);
+ ret = evt_service_setup(service_id);
+ if (ret) {
+ evt_err("Failed to setup service core"
+ " for Rx adapter\n");
+ return ret;
+ }
+ }
+
ret = rte_eth_dev_start(prod);
if (ret) {
evt_err("Ethernet dev [%d] failed to start."
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index e446c5437..4583122b3 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -252,10 +252,14 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
if (ret)
return ret;
- ret = evt_service_setup(opt->dev_id);
- if (ret) {
- evt_err("No service lcore found to run event dev.");
- return ret;
+ if (!evt_has_distributed_sched(opt->dev_id)) {
+ uint32_t service_id;
+ rte_event_dev_service_id_get(opt->dev_id, &service_id);
+ ret = evt_service_setup(service_id);
+ if (ret) {
+ evt_err("No service lcore found to run event dev.");
+ return ret;
+ }
}
ret = rte_event_dev_start(opt->dev_id);
--
2.14.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* [dpdk-dev] [PATCH v3 8/8] doc: update app eventdev options
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 " Pavan Nikhilesh
` (5 preceding siblings ...)
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 7/8] app/eventdev: add service core configuration Pavan Nikhilesh
@ 2017-12-11 15:13 ` Pavan Nikhilesh
2017-12-11 17:34 ` Eads, Gage
6 siblings, 1 reply; 40+ messages in thread
From: Pavan Nikhilesh @ 2017-12-11 15:13 UTC (permalink / raw)
To: jerin.jacob, bruce.richardson, harry.van.haaren, gage.eads,
hemant.agrawal, nipun.gupta, nikhil.rao, santosh.shukla
Cc: dev, Pavan Nikhilesh
Update documentation about new --prod_type_ethdev option in app/eventdev.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
doc/guides/tools/testeventdev.rst | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/doc/guides/tools/testeventdev.rst b/doc/guides/tools/testeventdev.rst
index 5aa2237b5..11e608b74 100644
--- a/doc/guides/tools/testeventdev.rst
+++ b/doc/guides/tools/testeventdev.rst
@@ -146,6 +146,9 @@ The following are the application command-line options:
Enable queue priority.
+* ``--prod_type_ethdev``
+
+ Use ethernet device as producer.
Eventdev Tests
--------------
@@ -348,6 +351,10 @@ the timestamp in the event on the first stage and then on termination, it
updates the number of cycles to forward a packet. The application uses this
value to compute the average latency to a forward packet.
+When ``--prod_type_ethdev`` command line option is selected, the application
+uses the probed ethernet devices as producers by configuring them as Rx
+adapters instead of using synthetic producers.
+
Application options
^^^^^^^^^^^^^^^^^^^
@@ -366,6 +373,7 @@ Supported application command line options are following::
--worker_deq_depth
--fwd_latency
--queue_priority
+ --prod_type_ethdev
Example
^^^^^^^
@@ -377,6 +385,12 @@ Example command to run perf queue test:
sudo build/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 ethernet ports:
+
+.. code-block:: console
+
+ sudo build/app/dpdk-test-eventdev --vdev=event_sw0 -- \
+ --test=perf_queue --plcores=2 --wlcore=3 --stlist=p --prod_type_ethdev
PERF_ATQ Test
~~~~~~~~~~~~~~~
@@ -443,6 +457,7 @@ Supported application command line options are following::
--nb_pkts
--worker_deq_depth
--fwd_latency
+ --prod_type_ethdev
Example
^^^^^^^
--
2.14.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [dpdk-dev] [PATCH v3 8/8] doc: update app eventdev options
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 8/8] doc: update app eventdev options Pavan Nikhilesh
@ 2017-12-11 17:34 ` Eads, Gage
2017-12-12 7:19 ` Pavan Nikhilesh Bhagavatula
2017-12-16 9:32 ` Jerin Jacob
0 siblings, 2 replies; 40+ messages in thread
From: Eads, Gage @ 2017-12-11 17:34 UTC (permalink / raw)
To: Pavan Nikhilesh, jerin.jacob, Richardson, Bruce, Van Haaren,
Harry, hemant.agrawal, nipun.gupta, Rao, Nikhil, santosh.shukla
Cc: dev
Once the compilation errors are fixed:
(Series) Acked-by: Gage Eads <gage.eads@intel.com>
> -----Original Message-----
> From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
> Sent: Monday, December 11, 2017 9:14 AM
> To: jerin.jacob@caviumnetworks.com; Richardson, Bruce
> <bruce.richardson@intel.com>; Van Haaren, Harry
> <harry.van.haaren@intel.com>; Eads, Gage <gage.eads@intel.com>;
> hemant.agrawal@nxp.com; nipun.gupta@nxp.com; Rao, Nikhil
> <nikhil.rao@intel.com>; santosh.shukla@caviumnetworks.com
> Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH v3 8/8] doc: update app eventdev options
>
> Update documentation about new --prod_type_ethdev option in app/eventdev.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Acked-by: John McNamara <john.mcnamara@intel.com>
> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> ---
> doc/guides/tools/testeventdev.rst | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/doc/guides/tools/testeventdev.rst
> b/doc/guides/tools/testeventdev.rst
> index 5aa2237b5..11e608b74 100644
> --- a/doc/guides/tools/testeventdev.rst
> +++ b/doc/guides/tools/testeventdev.rst
> @@ -146,6 +146,9 @@ The following are the application command-line
> options:
>
> Enable queue priority.
>
> +* ``--prod_type_ethdev``
> +
> + Use ethernet device as producer.
>
> Eventdev Tests
> --------------
> @@ -348,6 +351,10 @@ the timestamp in the event on the first stage and then
> on termination, it updates the number of cycles to forward a packet. The
> application uses this value to compute the average latency to a forward packet.
>
> +When ``--prod_type_ethdev`` command line option is selected, the
> +application uses the probed ethernet devices as producers by
> +configuring them as Rx adapters instead of using synthetic producers.
> +
> Application options
> ^^^^^^^^^^^^^^^^^^^
>
> @@ -366,6 +373,7 @@ Supported application command line options are
> following::
> --worker_deq_depth
> --fwd_latency
> --queue_priority
> + --prod_type_ethdev
>
> Example
> ^^^^^^^
> @@ -377,6 +385,12 @@ Example command to run perf queue test:
> sudo build/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 ethernet ports:
> +
> +.. code-block:: console
> +
> + sudo build/app/dpdk-test-eventdev --vdev=event_sw0 -- \
> + --test=perf_queue --plcores=2 --wlcore=3 --stlist=p
> + --prod_type_ethdev
>
> PERF_ATQ Test
> ~~~~~~~~~~~~~~~
> @@ -443,6 +457,7 @@ Supported application command line options are
> following::
> --nb_pkts
> --worker_deq_depth
> --fwd_latency
> + --prod_type_ethdev
>
> Example
> ^^^^^^^
> --
> 2.14.1
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [dpdk-dev] [PATCH v3 8/8] doc: update app eventdev options
2017-12-11 17:34 ` Eads, Gage
@ 2017-12-12 7:19 ` Pavan Nikhilesh Bhagavatula
2017-12-16 9:32 ` Jerin Jacob
1 sibling, 0 replies; 40+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2017-12-12 7:19 UTC (permalink / raw)
To: Eads, Gage, jerin.jacob, Richardson, Bruce, harry.van.haaren,
hemant.agrawal, nipun.gupta, Rao, Nikhil, santosh.shukla
Cc: dev
On Mon, Dec 11, 2017 at 05:34:50PM +0000, Eads, Gage wrote:
> Once the compilation errors are fixed:
> (Series) Acked-by: Gage Eads <gage.eads@intel.com>
>
Thanks for the ack,
The compilation issues have been fixed but for some reason patchworks failed to
apply the patset
Pavan.
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [dpdk-dev] [PATCH v3 8/8] doc: update app eventdev options
2017-12-11 17:34 ` Eads, Gage
2017-12-12 7:19 ` Pavan Nikhilesh Bhagavatula
@ 2017-12-16 9:32 ` Jerin Jacob
1 sibling, 0 replies; 40+ messages in thread
From: Jerin Jacob @ 2017-12-16 9:32 UTC (permalink / raw)
To: Eads, Gage
Cc: Pavan Nikhilesh, Richardson, Bruce, Van Haaren, Harry,
hemant.agrawal, nipun.gupta, Rao, Nikhil, santosh.shukla, dev
-----Original Message-----
> Date: Mon, 11 Dec 2017 17:34:50 +0000
> From: "Eads, Gage" <gage.eads@intel.com>
> To: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>,
> "jerin.jacob@caviumnetworks.com" <jerin.jacob@caviumnetworks.com>,
> "Richardson, Bruce" <bruce.richardson@intel.com>, "Van Haaren, Harry"
> <harry.van.haaren@intel.com>, "hemant.agrawal@nxp.com"
> <hemant.agrawal@nxp.com>, "nipun.gupta@nxp.com" <nipun.gupta@nxp.com>,
> "Rao, Nikhil" <nikhil.rao@intel.com>, "santosh.shukla@caviumnetworks.com"
> <santosh.shukla@caviumnetworks.com>
> CC: "dev@dpdk.org" <dev@dpdk.org>
> Subject: RE: [dpdk-dev] [PATCH v3 8/8] doc: update app eventdev options
>
> Once the compilation errors are fixed:
> (Series) Acked-by: Gage Eads <gage.eads@intel.com>
Series Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/8] app/eventdev: add ethernet device producer option
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 1/8] app/eventdev: add ethernet device producer option Pavan Nikhilesh
` (6 preceding siblings ...)
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 8/8] doc: update app eventdev options Pavan Nikhilesh
@ 2017-12-16 9:34 ` Jerin Jacob
7 siblings, 0 replies; 40+ messages in thread
From: Jerin Jacob @ 2017-12-16 9:34 UTC (permalink / raw)
To: Pavan Nikhilesh
Cc: bruce.richardson, harry.van.haaren, gage.eads, hemant.agrawal,
nipun.gupta, nikhil.rao, santosh.shukla, dev
-----Original Message-----
> Date: Mon, 11 Dec 2017 16:42:29 +0530
> From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> To: jerin.jacob@caviumnetworks.com, bruce.richardson@intel.com,
> harry.van.haaren@intel.com, gage.eads@intel.com, hemant.agrawal@nxp.com,
> nipun.gupta@nxp.com, nikhil.rao@intel.com,
> santosh.shukla@caviumnetworks.com
> Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH v2 1/8] app/eventdev: add ethernet device
> producer option
> X-Mailer: git-send-email 2.14.1
>
> Add command line option --prod_type_ethdev to specify that the events
> are generated by ethernet device.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Series applied to dpdk-next-eventdev/master. Thanks.
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [dpdk-dev] [PATCH v3 7/8] app/eventdev: add service core configuration
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 7/8] app/eventdev: add service core configuration Pavan Nikhilesh
@ 2017-12-19 10:25 ` Van Haaren, Harry
0 siblings, 0 replies; 40+ messages in thread
From: Van Haaren, Harry @ 2017-12-19 10:25 UTC (permalink / raw)
To: Pavan Nikhilesh, jerin.jacob, Richardson, Bruce, Eads, Gage,
hemant.agrawal, nipun.gupta, Rao, Nikhil, santosh.shukla
Cc: dev
> From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
<snip>
> Add service core configuration for Rx adapter. The configuration picks
> the least used service core to run the service on.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> ---
> app/test-eventdev/evt_common.h | 41 ++++++++++++++++-----------------
> ---
> app/test-eventdev/test_perf_atq.c | 12 +++++++----
> app/test-eventdev/test_perf_common.c | 13 ++++++++++++
> app/test-eventdev/test_perf_queue.c | 12 +++++++----
> 4 files changed, 47 insertions(+), 31 deletions(-)
>
> diff --git a/app/test-eventdev/evt_common.h b/app/test-eventdev/evt_common.h
> index 0fadab4a0..042823a52 100644
> --- a/app/test-eventdev/evt_common.h
> +++ b/app/test-eventdev/evt_common.h
> @@ -94,41 +94,36 @@ evt_has_all_types_queue(uint8_t dev_id)
> }
>
> static inline int
> -evt_service_setup(uint8_t dev_id)
> +evt_service_setup(uint32_t service_id)
> {
> - uint32_t service_id;
> int32_t core_cnt;
> unsigned int lcore = 0;
> uint32_t core_array[RTE_MAX_LCORE];
> uint8_t cnt;
> uint8_t min_cnt = UINT8_MAX;
>
> - if (evt_has_distributed_sched(dev_id))
> - return 0;
> -
> if (!rte_service_lcore_count())
> return -ENOENT;
See last comment - we can try to get next lcore, and add it as a service core to continue running test?
>
> - if (!rte_event_dev_service_id_get(dev_id, &service_id)) {
> - core_cnt = rte_service_lcore_list(core_array,
> - RTE_MAX_LCORE);
> - if (core_cnt < 0)
> - return -ENOENT;
> - /* Get the core which has least number of services running. */
> - while (core_cnt--) {
> - /* Reset default mapping */
> - rte_service_map_lcore_set(service_id,
> - core_array[core_cnt], 0);
Nit: these two can be on the same line
>
> + if (!(cap & RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT)) {
> + uint32_t service_id;
> +
> + rte_event_eth_rx_adapter_service_id_get(prod,
> + &service_id);
> + ret = evt_service_setup(service_id);
> + if (ret) {
> + evt_err("Failed to setup service core"
> + " for Rx adapter\n");
No need to split strings here.
> + if (!evt_has_distributed_sched(opt->dev_id)) {
> + uint32_t service_id;
> + rte_event_dev_service_id_get(opt->dev_id, &service_id);
> + ret = evt_service_setup(service_id);
> + if (ret) {
> + evt_err("No service lcore found to run event dev.");
> + return ret;
Would it be better to try get next lcore, and add as a service core here? That way we could continue running the test.
With above suggestions;
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
^ permalink raw reply [flat|nested] 40+ messages in thread
end of thread, other threads:[~2017-12-19 10:25 UTC | newest]
Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-18 12:39 [dpdk-dev] [PATCH 0/8] app/eventdev: add event eth Rx adapter support Pavan Nikhilesh
2017-10-18 12:39 ` [dpdk-dev] [PATCH 1/8] app/eventdev: add ethernet device producer option Pavan Nikhilesh
2017-12-10 8:34 ` Jerin Jacob
2017-10-18 12:39 ` [dpdk-dev] [PATCH 2/8] app/eventdev: modify app setup to support ethdev Pavan Nikhilesh
2017-12-10 11:56 ` Jerin Jacob
2017-10-18 12:39 ` [dpdk-dev] [PATCH 3/8] app/eventdev: add pktmbuf pool for ethdev Pavan Nikhilesh
2017-12-10 12:01 ` Jerin Jacob
2017-10-18 12:39 ` [dpdk-dev] [PATCH 4/8] app/eventdev: add ethernet device setup helpers Pavan Nikhilesh
2017-12-10 12:09 ` Jerin Jacob
2017-10-18 12:39 ` [dpdk-dev] [PATCH 5/8] app/eventdev: add ethernet device tear down Pavan Nikhilesh
2017-12-10 12:10 ` Jerin Jacob
2017-10-18 12:39 ` [dpdk-dev] [PATCH 6/8] app/eventdev: add event Rx adapter setup Pavan Nikhilesh
2017-12-10 12:13 ` Jerin Jacob
2017-10-18 12:39 ` [dpdk-dev] [PATCH 7/8] app/eventdev: add service core configuration Pavan Nikhilesh
2017-10-18 12:39 ` [dpdk-dev] [PATCH 8/8] doc: update app eventdev options Pavan Nikhilesh
2017-10-18 18:33 ` Mcnamara, John
2017-12-10 12:16 ` Jerin Jacob
2017-12-10 8:28 ` [dpdk-dev] [PATCH 0/8] app/eventdev: add event eth Rx adapter support Jerin Jacob
2017-12-11 7:37 ` Pavan Nikhilesh Bhagavatula
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 1/8] app/eventdev: add ethernet device producer option Pavan Nikhilesh
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 2/8] app/eventdev: modify app setup to support ethdev Pavan Nikhilesh
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 3/8] app/eventdev: add pktmbuf pool for ethdev Pavan Nikhilesh
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 4/8] app/eventdev: add ethernet device setup helpers Pavan Nikhilesh
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 5/8] app/eventdev: add ethernet device tear down Pavan Nikhilesh
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 6/8] app/eventdev: add event Rx adapter setup Pavan Nikhilesh
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 7/8] app/eventdev: add service core configuration Pavan Nikhilesh
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 8/8] doc: update app eventdev options Pavan Nikhilesh
2017-12-16 9:34 ` [dpdk-dev] [PATCH v2 1/8] app/eventdev: add ethernet device producer option Jerin Jacob
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 " Pavan Nikhilesh
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 2/8] app/eventdev: modify app setup to support ethdev Pavan Nikhilesh
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 3/8] app/eventdev: add pktmbuf pool for ethdev Pavan Nikhilesh
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 4/8] app/eventdev: add ethernet device setup helpers Pavan Nikhilesh
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 5/8] app/eventdev: add ethernet device tear down Pavan Nikhilesh
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 6/8] app/eventdev: add event Rx adapter setup Pavan Nikhilesh
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 7/8] app/eventdev: add service core configuration Pavan Nikhilesh
2017-12-19 10:25 ` Van Haaren, Harry
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 8/8] doc: update app eventdev options Pavan Nikhilesh
2017-12-11 17:34 ` Eads, Gage
2017-12-12 7:19 ` Pavan Nikhilesh Bhagavatula
2017-12-16 9:32 ` Jerin Jacob
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).