* [dpdk-dev] [PATCH] app/eventdev: validate producer type used
@ 2020-04-02 19:38 Pavan Nikhilesh
2020-04-04 15:11 ` Jerin Jacob
0 siblings, 1 reply; 2+ messages in thread
From: Pavan Nikhilesh @ 2020-04-02 19:38 UTC (permalink / raw)
To: jerinj; +Cc: dev, Pavan Nikhilesh
From: Pavan Nikhilesh <pbhagavatula@marvell.com>
Validate the producer type used for pipeline and order test suites.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
app/test-eventdev/evt_options.h | 16 ++++++++++++++++
app/test-eventdev/test_order_common.c | 6 ++++--
app/test-eventdev/test_pipeline_common.c | 7 +++++++
3 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/app/test-eventdev/evt_options.h b/app/test-eventdev/evt_options.h
index cb1d3760d..748e54fae 100644
--- a/app/test-eventdev/evt_options.h
+++ b/app/test-eventdev/evt_options.h
@@ -232,6 +232,22 @@ evt_dump_sched_type_list(struct evt_options *opt)
evt_dump_end;
}
+static inline const char *
+evt_prod_id_to_name(enum evt_prod_type prod_type)
+{
+ switch (prod_type) {
+ default:
+ case EVT_PROD_TYPE_SYNT:
+ return "Synthetic producer lcores";
+ case EVT_PROD_TYPE_ETH_RX_ADPTR:
+ return "Ethdev Rx Adapter";
+ case EVT_PROD_TYPE_EVENT_TIMER_ADPTR:
+ return "Event timer adapter";
+ }
+
+ return "";
+}
+
#define EVT_PROD_MAX_NAME_LEN 50
static inline void
evt_dump_producer_type(struct evt_options *opt)
diff --git a/app/test-eventdev/test_order_common.c b/app/test-eventdev/test_order_common.c
index 252e4a14c..4190f9ade 100644
--- a/app/test-eventdev/test_order_common.c
+++ b/app/test-eventdev/test_order_common.c
@@ -68,8 +68,10 @@ int
order_opt_check(struct evt_options *opt)
{
if (opt->prod_type != EVT_PROD_TYPE_SYNT) {
- evt_err("Invalid producer type");
- return -EINVAL;
+ evt_err("Invalid producer type '%s' valid producer '%s'",
+ evt_prod_id_to_name(opt->prod_type),
+ evt_prod_id_to_name(EVT_PROD_TYPE_SYNT));
+ return -1;
}
/* 1 producer + N workers + 1 master */
diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c
index fa91bf229..84c42b33c 100644
--- a/app/test-eventdev/test_pipeline_common.c
+++ b/app/test-eventdev/test_pipeline_common.c
@@ -111,6 +111,13 @@ pipeline_opt_check(struct evt_options *opt, uint64_t nb_queues)
*/
lcores = 2;
+ if (opt->prod_type != EVT_PROD_TYPE_ETH_RX_ADPTR) {
+ evt_err("Invalid producer type '%s' valid producer '%s'",
+ evt_prod_id_to_name(opt->prod_type),
+ evt_prod_id_to_name(EVT_PROD_TYPE_ETH_RX_ADPTR));
+ return -1;
+ }
+
if (!rte_eth_dev_count_avail()) {
evt_err("test needs minimum 1 ethernet dev");
return -1;
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dpdk-dev] [PATCH] app/eventdev: validate producer type used
2020-04-02 19:38 [dpdk-dev] [PATCH] app/eventdev: validate producer type used Pavan Nikhilesh
@ 2020-04-04 15:11 ` Jerin Jacob
0 siblings, 0 replies; 2+ messages in thread
From: Jerin Jacob @ 2020-04-04 15:11 UTC (permalink / raw)
To: Pavan Nikhilesh; +Cc: Jerin Jacob, dpdk-dev, Pavan Nikhilesh
On Fri, Apr 3, 2020 at 1:08 AM Pavan Nikhilesh <pvnnikhilesh@gmail.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Validate the producer type used for pipeline and order test suites.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Applied to dpdk-next-eventdev/master. Thanks.
> ---
> app/test-eventdev/evt_options.h | 16 ++++++++++++++++
> app/test-eventdev/test_order_common.c | 6 ++++--
> app/test-eventdev/test_pipeline_common.c | 7 +++++++
> 3 files changed, 27 insertions(+), 2 deletions(-)
>
> diff --git a/app/test-eventdev/evt_options.h b/app/test-eventdev/evt_options.h
> index cb1d3760d..748e54fae 100644
> --- a/app/test-eventdev/evt_options.h
> +++ b/app/test-eventdev/evt_options.h
> @@ -232,6 +232,22 @@ evt_dump_sched_type_list(struct evt_options *opt)
> evt_dump_end;
> }
>
> +static inline const char *
> +evt_prod_id_to_name(enum evt_prod_type prod_type)
> +{
> + switch (prod_type) {
> + default:
> + case EVT_PROD_TYPE_SYNT:
> + return "Synthetic producer lcores";
> + case EVT_PROD_TYPE_ETH_RX_ADPTR:
> + return "Ethdev Rx Adapter";
> + case EVT_PROD_TYPE_EVENT_TIMER_ADPTR:
> + return "Event timer adapter";
> + }
> +
> + return "";
> +}
> +
> #define EVT_PROD_MAX_NAME_LEN 50
> static inline void
> evt_dump_producer_type(struct evt_options *opt)
> diff --git a/app/test-eventdev/test_order_common.c b/app/test-eventdev/test_order_common.c
> index 252e4a14c..4190f9ade 100644
> --- a/app/test-eventdev/test_order_common.c
> +++ b/app/test-eventdev/test_order_common.c
> @@ -68,8 +68,10 @@ int
> order_opt_check(struct evt_options *opt)
> {
> if (opt->prod_type != EVT_PROD_TYPE_SYNT) {
> - evt_err("Invalid producer type");
> - return -EINVAL;
> + evt_err("Invalid producer type '%s' valid producer '%s'",
> + evt_prod_id_to_name(opt->prod_type),
> + evt_prod_id_to_name(EVT_PROD_TYPE_SYNT));
> + return -1;
> }
>
> /* 1 producer + N workers + 1 master */
> diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c
> index fa91bf229..84c42b33c 100644
> --- a/app/test-eventdev/test_pipeline_common.c
> +++ b/app/test-eventdev/test_pipeline_common.c
> @@ -111,6 +111,13 @@ pipeline_opt_check(struct evt_options *opt, uint64_t nb_queues)
> */
> lcores = 2;
>
> + if (opt->prod_type != EVT_PROD_TYPE_ETH_RX_ADPTR) {
> + evt_err("Invalid producer type '%s' valid producer '%s'",
> + evt_prod_id_to_name(opt->prod_type),
> + evt_prod_id_to_name(EVT_PROD_TYPE_ETH_RX_ADPTR));
> + return -1;
> + }
> +
> if (!rte_eth_dev_count_avail()) {
> evt_err("test needs minimum 1 ethernet dev");
> return -1;
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-04 15:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-02 19:38 [dpdk-dev] [PATCH] app/eventdev: validate producer type used Pavan Nikhilesh
2020-04-04 15:11 ` 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).