From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 96C62A0562; Sat, 4 Apr 2020 17:11:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 943085F13; Sat, 4 Apr 2020 17:11:56 +0200 (CEST) Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) by dpdk.org (Postfix) with ESMTP id BB7A42BEA for ; Sat, 4 Apr 2020 17:11:54 +0200 (CEST) Received: by mail-io1-f65.google.com with SMTP id n10so10909525iom.3 for ; Sat, 04 Apr 2020 08:11:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tfV8bbjGvYm7W6pRgf+nAh3tK9t08y5lzv8aNTQLapE=; b=EDMG9UjtpxJLywXPRSrPvAvXKvTKc5H/+2ceZH9lTWBIENEUqCBWPfJOEjOUGhGZms tnC432LfDyYOmYXpF09YjAhLbmTzrFB384+k6a/W5L6b9wX7+1e6+7tu5XaVEgQ/Vfue P9Z0eRa6uH9CGyItyl5rtA3nAsiHXlqudE00WjPvEkWxCTtur0RXFuTwzw4Ni5j4ne9z /QKtUw9tCvRw2Dn1RPvQxCtIEHS3tKomW081stI7OcJssGTl2U5EvTHHvXXnycSQXXEV CO/5OOeYMKxoaVqvMBS0xG8dvpmxLqAMhxvP3I5KGWGSmPR7h5pjIFP/mGYAMI24S6au Th9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tfV8bbjGvYm7W6pRgf+nAh3tK9t08y5lzv8aNTQLapE=; b=HjADt9E8chiafW/FCqx2YLYX6wKHHfnEpaFMRAFFnEUT4WmKdYKwIkqDrqzcx5eNgn FMVPXqHd3UQsduPkAF4uv/5WJc9FN1+Haja3Oaik+9aKZJ7LiPHKgZxQio/+GfRTu5N4 yDMsxZZ8G0gs8hVA1+5YPhXAykTmoYDrAE3DRJo/uLQCra7x1x6fg621wDx7THz7XPDD liOySwWA0NyDom4+9ihdpwJfuYgzDud12VbC6mQ4qBpuS9Q+okK9qUd9xELKqXNDTpHR Vmp6e2nX8d28v7YSyrF9vki+FoYZDzfAdso5T66PLcBEwqumHGz1K6pIZFL2tNkILuZW abQQ== X-Gm-Message-State: AGi0PuYwOcPmRGpqg24S5X/nkpjtCnMjtxrLCI66VL79oOidGTPgFiH3 7QeF3au7OiaL3AzZDQG3W3h+6SI0cgZWs2eSDrw= X-Google-Smtp-Source: APiQypK42pM0qjqpywnDwjVbSbCXWm7d6XxYzOKBBilHCz7SjflFNTBijYOQmBYkVbITFtHajKp0ds5WA7kexl77nyU= X-Received: by 2002:a02:ac94:: with SMTP id x20mr2523465jan.133.1586013113868; Sat, 04 Apr 2020 08:11:53 -0700 (PDT) MIME-Version: 1.0 References: <20200402193808.6978-1-pvnnikhilesh@gmail.com> In-Reply-To: <20200402193808.6978-1-pvnnikhilesh@gmail.com> From: Jerin Jacob Date: Sat, 4 Apr 2020 20:41:37 +0530 Message-ID: To: Pavan Nikhilesh Cc: Jerin Jacob , dpdk-dev , Pavan Nikhilesh Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] app/eventdev: validate producer type used X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Apr 3, 2020 at 1:08 AM Pavan Nikhilesh wrote: > > From: Pavan Nikhilesh > > Validate the producer type used for pipeline and order test suites. > > Signed-off-by: Pavan Nikhilesh 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 >