[dpdk-dev,14/33] app/testeventdev: order: add eventdev port setup
Checks
Commit Message
Setup one port per worker and link to all queues and setup
one producer port to inject the events.
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
app/test-eventdev/test_order_common.c | 55 +++++++++++++++++++++++++++++++++++
app/test-eventdev/test_order_common.h | 2 ++
2 files changed, 57 insertions(+)
Comments
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Sunday, May 28, 2017 8:59 PM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; Van Haaren, Harry
> <harry.van.haaren@intel.com>; hemant.agrawal@nxp.com; Eads, Gage <gage.eads@intel.com>;
> nipun.gupta@nxp.com; Vangati, Narender <narender.vangati@intel.com>; Rao, Nikhil
> <nikhil.rao@intel.com>; gprathyusha@caviumnetworks.com; Jerin Jacob
> <jerin.jacob@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH 14/33] app/testeventdev: order: add eventdev port setup
>
> Setup one port per worker and link to all queues and setup
> one producer port to inject the events.
>
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
One suggestion below to increase the enqueue depth, or was there a reason set it to 8?
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
<snip some code>
> + /* setup one port per worker, linking to all queues */
> + for (port = 0; port < nb_workers; port++) {
> + struct worker_data *w = &t->worker[port];
> +
> + w->dev_id = opt->dev_id;
> + w->port_id = port;
> + w->t = t;
> +
> + ret = rte_event_port_setup(opt->dev_id, port, &wkr_p_conf);
> + if (ret) {
> + evt_err("failed to setup port %d", port);
> + return ret;
> + }
> +
> + ret = rte_event_port_link(opt->dev_id, port, NULL, NULL, 0);
> + if (ret != nb_queues) {
> + evt_err("failed to link all queues to port %d", port);
> + return -EINVAL;
> + }
> + }
> + /* port for producer, no links */
> + const struct rte_event_port_conf prod_conf = {
> + .dequeue_depth = 8,
> + .enqueue_depth = 8,
.enqueue_depth = 32 or so?
-----Original Message-----
> Date: Fri, 23 Jun 2017 12:36:47 +0000
> From: "Van Haaren, Harry" <harry.van.haaren@intel.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, "dev@dpdk.org"
> <dev@dpdk.org>
> CC: "Richardson, Bruce" <bruce.richardson@intel.com>,
> "hemant.agrawal@nxp.com" <hemant.agrawal@nxp.com>, "Eads, Gage"
> <gage.eads@intel.com>, "nipun.gupta@nxp.com" <nipun.gupta@nxp.com>,
> "Vangati, Narender" <narender.vangati@intel.com>, "Rao, Nikhil"
> <nikhil.rao@intel.com>, "gprathyusha@caviumnetworks.com"
> <gprathyusha@caviumnetworks.com>
> Subject: RE: [dpdk-dev] [PATCH 14/33] app/testeventdev: order: add eventdev
> port setup
>
> > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> > Sent: Sunday, May 28, 2017 8:59 PM
> > To: dev@dpdk.org
> > Cc: Richardson, Bruce <bruce.richardson@intel.com>; Van Haaren, Harry
> > <harry.van.haaren@intel.com>; hemant.agrawal@nxp.com; Eads, Gage <gage.eads@intel.com>;
> > nipun.gupta@nxp.com; Vangati, Narender <narender.vangati@intel.com>; Rao, Nikhil
> > <nikhil.rao@intel.com>; gprathyusha@caviumnetworks.com; Jerin Jacob
> > <jerin.jacob@caviumnetworks.com>
> > Subject: [dpdk-dev] [PATCH 14/33] app/testeventdev: order: add eventdev port setup
> >
> > Setup one port per worker and link to all queues and setup
> > one producer port to inject the events.
> >
> > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
>
> One suggestion below to increase the enqueue depth, or was there a reason set it to 8?
No specific reason. I think, In some example, SW driver was configuring to 8.
So I choose to select 8. I will change to 32 as you suggested.
>
> Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
>
>
> <snip some code>
>
> > + /* setup one port per worker, linking to all queues */
> > + for (port = 0; port < nb_workers; port++) {
> > + struct worker_data *w = &t->worker[port];
> > +
> > + w->dev_id = opt->dev_id;
> > + w->port_id = port;
> > + w->t = t;
> > +
> > + ret = rte_event_port_setup(opt->dev_id, port, &wkr_p_conf);
> > + if (ret) {
> > + evt_err("failed to setup port %d", port);
> > + return ret;
> > + }
> > +
> > + ret = rte_event_port_link(opt->dev_id, port, NULL, NULL, 0);
> > + if (ret != nb_queues) {
> > + evt_err("failed to link all queues to port %d", port);
> > + return -EINVAL;
> > + }
> > + }
> > + /* port for producer, no links */
> > + const struct rte_event_port_conf prod_conf = {
> > + .dequeue_depth = 8,
> > + .enqueue_depth = 8,
>
> .enqueue_depth = 32 or so?
>
@@ -184,4 +184,59 @@ order_opt_dump(struct evt_options *opt)
evt_dump("nb_evdev_ports", "%d", order_nb_event_ports(opt));
}
+int
+order_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
+ uint8_t nb_workers, uint8_t nb_queues)
+{
+ int ret;
+ uint8_t port;
+ struct test_order *t = evt_test_priv(test);
+ /* port configuration */
+ const struct rte_event_port_conf wkr_p_conf = {
+ .dequeue_depth = opt->wkr_deq_dep,
+ .enqueue_depth = 64,
+ .new_event_threshold = 4096,
+ };
+
+ /* setup one port per worker, linking to all queues */
+ for (port = 0; port < nb_workers; port++) {
+ struct worker_data *w = &t->worker[port];
+
+ w->dev_id = opt->dev_id;
+ w->port_id = port;
+ w->t = t;
+
+ ret = rte_event_port_setup(opt->dev_id, port, &wkr_p_conf);
+ if (ret) {
+ evt_err("failed to setup port %d", port);
+ return ret;
+ }
+
+ ret = rte_event_port_link(opt->dev_id, port, NULL, NULL, 0);
+ if (ret != nb_queues) {
+ evt_err("failed to link all queues to port %d", port);
+ return -EINVAL;
+ }
+ }
+ /* port for producer, no links */
+ const struct rte_event_port_conf prod_conf = {
+ .dequeue_depth = 8,
+ .enqueue_depth = 8,
+ .new_event_threshold = 1200,
+ };
+ struct prod_data *p = &t->prod;
+
+ p->dev_id = opt->dev_id;
+ p->port_id = port; /* last port */
+ p->queue_id = 0;
+ p->t = t;
+
+ ret = rte_event_port_setup(opt->dev_id, port, &prod_conf);
+ if (ret) {
+ evt_err("failed to setup producer port %d", port);
+ return ret;
+ }
+
+ return ret;
+}
@@ -94,6 +94,8 @@ int order_test_result(struct evt_test *test, struct evt_options *opt);
int order_opt_check(struct evt_options *opt);
int order_test_setup(struct evt_test *test, struct evt_options *opt);
int order_mempool_setup(struct evt_test *test, struct evt_options *opt);
+int order_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
+ uint8_t nb_workers, uint8_t nb_queues);
void order_test_destroy(struct evt_test *test, struct evt_options *opt);
void order_opt_dump(struct evt_options *opt);
void order_mempool_destroy(struct evt_test *test, struct evt_options *opt);