DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>,
	"harry.van.haaren@intel.com" <harry.van.haaren@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
Subject: [dpdk-dev] [PATCH 1/3] examples/eventdev_pipeline: configure max events based on dev info
Date: Fri, 1 Mar 2019 07:16:42 +0000	[thread overview]
Message-ID: <20190301071617.6570-1-pbhagavatula@marvell.com> (raw)

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

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>
---
 examples/eventdev_pipeline/pipeline_worker_generic.c | 6 ++++++
 examples/eventdev_pipeline/pipeline_worker_tx.c      | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c
index 169064949..766c8e958 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 85eb075fc..8961cd656 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;
-- 
2.21.0

             reply	other threads:[~2019-03-01  7:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-01  7:16 Pavan Nikhilesh Bhagavatula [this message]
2019-03-01  7:16 ` [dpdk-dev] [PATCH 2/3] examples/eventdev_pipeline: follow proper teardown sequence Pavan Nikhilesh Bhagavatula
2019-03-11  9:57   ` Van Haaren, Harry
2019-03-01  7:16 ` [dpdk-dev] [PATCH 3/3] app/eventdev: " Pavan Nikhilesh Bhagavatula
2019-03-11  9:58   ` Van Haaren, Harry
2019-03-11 15:12     ` Jerin Jacob Kollanukkaran
2019-03-08 18:25 ` [dpdk-dev] [PATCH 1/3] examples/eventdev_pipeline: configure max events based on dev info Jerin Jacob Kollanukkaran
2019-03-11  9:57 ` Van Haaren, Harry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190301071617.6570-1-pbhagavatula@marvell.com \
    --to=pbhagavatula@marvell.com \
    --cc=dev@dpdk.org \
    --cc=harry.van.haaren@intel.com \
    --cc=jerinj@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).