summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorPavan Nikhilesh <pbhagavatula@marvell.com>2019-03-01 07:16:42 +0000
committerJerin Jacob <jerinj@marvell.com>2019-03-15 06:46:50 +0100
commit84f4c73f7d85a50e4ca9c799709953c254983f26 (patch)
tree9b72eb60cfdb50a07475215353f87d8e9a7a778e /examples
parent239912fa798e6e671072ca7ff987afd74c1e506c (diff)
downloaddpdk-next-eventdev-84f4c73f7d85a50e4ca9c799709953c254983f26.zip
dpdk-next-eventdev-84f4c73f7d85a50e4ca9c799709953c254983f26.tar.gz
dpdk-next-eventdev-84f4c73f7d85a50e4ca9c799709953c254983f26.tar.xz
examples/eventdev: probe max events
Some eventdevs support configuring max events to be -1 (open system). Check eventdev and event port configuration with eventdev info before configuring them. Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com> Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/eventdev_pipeline/pipeline_worker_generic.c6
-rw-r--r--examples/eventdev_pipeline/pipeline_worker_tx.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c
index 1690649..766c8e9 100644
--- a/examples/eventdev_pipeline/pipeline_worker_generic.c
+++ b/examples/eventdev_pipeline/pipeline_worker_generic.c
@@ -169,6 +169,8 @@ setup_eventdev_generic(struct worker_data *worker_data)
wkr_p_conf.disable_implicit_release = disable_implicit_release;
+ if (dev_info.max_num_events < config.nb_events_limit)
+ config.nb_events_limit = dev_info.max_num_events;
if (dev_info.max_event_port_dequeue_depth <
config.nb_event_port_dequeue_depth)
config.nb_event_port_dequeue_depth =
@@ -227,6 +229,8 @@ setup_eventdev_generic(struct worker_data *worker_data)
}
cdata.tx_queue_id = i;
+ if (wkr_p_conf.new_event_threshold > config.nb_events_limit)
+ wkr_p_conf.new_event_threshold = config.nb_events_limit;
if (wkr_p_conf.dequeue_depth > config.nb_event_port_dequeue_depth)
wkr_p_conf.dequeue_depth = config.nb_event_port_dequeue_depth;
if (wkr_p_conf.enqueue_depth > config.nb_event_port_enqueue_depth)
@@ -284,6 +288,8 @@ init_adapters(uint16_t nb_ports)
.new_event_threshold = 4096,
};
+ if (adptr_p_conf.new_event_threshold > dev_info.max_num_events)
+ adptr_p_conf.new_event_threshold = dev_info.max_num_events;
if (adptr_p_conf.dequeue_depth > dev_info.max_event_port_dequeue_depth)
adptr_p_conf.dequeue_depth =
dev_info.max_event_port_dequeue_depth;
diff --git a/examples/eventdev_pipeline/pipeline_worker_tx.c b/examples/eventdev_pipeline/pipeline_worker_tx.c
index 85eb075..8961cd6 100644
--- a/examples/eventdev_pipeline/pipeline_worker_tx.c
+++ b/examples/eventdev_pipeline/pipeline_worker_tx.c
@@ -465,6 +465,8 @@ setup_eventdev_worker_tx_enq(struct worker_data *worker_data)
ret = rte_event_dev_info_get(dev_id, &dev_info);
printf("\tEventdev %d: %s\n", dev_id, dev_info.driver_name);
+ if (dev_info.max_num_events < config.nb_events_limit)
+ config.nb_events_limit = dev_info.max_num_events;
if (dev_info.max_event_port_dequeue_depth <
config.nb_event_port_dequeue_depth)
config.nb_event_port_dequeue_depth =
@@ -528,6 +530,8 @@ setup_eventdev_worker_tx_enq(struct worker_data *worker_data)
}
printf("\n");
+ if (wkr_p_conf.new_event_threshold > config.nb_events_limit)
+ wkr_p_conf.new_event_threshold = config.nb_events_limit;
if (wkr_p_conf.dequeue_depth > config.nb_event_port_dequeue_depth)
wkr_p_conf.dequeue_depth = config.nb_event_port_dequeue_depth;
if (wkr_p_conf.enqueue_depth > config.nb_event_port_enqueue_depth)
@@ -617,6 +621,8 @@ init_adapters(uint16_t nb_ports)
.new_event_threshold = 4096,
};
+ if (adptr_p_conf.new_event_threshold > dev_info.max_num_events)
+ adptr_p_conf.new_event_threshold = dev_info.max_num_events;
if (adptr_p_conf.dequeue_depth > dev_info.max_event_port_dequeue_depth)
adptr_p_conf.dequeue_depth =
dev_info.max_event_port_dequeue_depth;