Validate the producer type used for pipeline and order test suites.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
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)
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 */
*/
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;