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 6B2D3A0562; Thu, 2 Apr 2020 21:38:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4B65B1BED8; Thu, 2 Apr 2020 21:38:28 +0200 (CEST) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by dpdk.org (Postfix) with ESMTP id BD2121BEA8 for ; Thu, 2 Apr 2020 21:38:26 +0200 (CEST) Received: by mail-pl1-f193.google.com with SMTP id a23so1742595plm.1 for ; Thu, 02 Apr 2020 12:38:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FoaHu21WXVWbNN06/gQN8Qli7xBzgoyWC6CU3+x4Pko=; b=k1zHUMjZdF2heWaOJZJELBvrejCCTYl1K/xrgNKGA3QD1qNjYwMbfct4kLxjewHyoA 7ud6mNGQDjMrfJnGYzDbcUhNHKEBXThvQIeVhf4fJbPsGKEVdXZSQ8+yQaJXavwOMn8I fFnlPfkcNS56wM6+iezS6fYJjpoLCiZBbc+ar+e3mP+dta/2ompSROAAciuH2LoVhzxN kIoqGWJrB0QGlpIlnSnuNNLh1ISFj9lSCuqQxgjIKdmrqHeXam+peZLZMekZPCIiZE66 BC9NuJJ589scResSkl6EHII5dxg9kE2G27CbQvcBhAGWi8l/JL8agB4iupDO6OnaBHcD 29uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FoaHu21WXVWbNN06/gQN8Qli7xBzgoyWC6CU3+x4Pko=; b=Wd3Rz0HvgupkNIyNlDLwNmCxgQjmyziPx8OqZUcFA7PBpt3PjQAmkV5oLYFCR2rpCY kg4sE81KWnHjk85OJpcgYc0c4h/v9O0lvdLhnKI9vQDPhfGGE+46pP2dJIhSbR9pc4si iPL/jQawq7mFqZBlL3FPwqHunKxW//OGB/YOZDRtHNuHwdTqjNbggWZl4/V/YWRYtKIp WAAF67xjNOSBfqHuXXVIcNA8U4VUeBNqbVewGdQ/kqdg06xbws9+XIg6fBPmqtsP7vFd z0bBjmjLpFcxBKfM2LznOdeIj2LZ3LQntOWmR8KmbE7r89UdOl1WwCFLcOM66yjdRBgT cxWQ== X-Gm-Message-State: AGi0PuafQmfZrMvnjHwiAtnqDiZNMBNr0NIupG1mrg18ImleF11xciHR GVzH2829zN0X0dg6KDUt9INj4N3ubAg= X-Google-Smtp-Source: APiQypJt1/UoN5mr6v3zlfZU2FHMjqVIGcBFvNllDIqzym4GgsBcRv0UzZ1nkk4FN4cqRqnww4zmXQ== X-Received: by 2002:a17:902:a517:: with SMTP id s23mr4545203plq.125.1585856305935; Thu, 02 Apr 2020 12:38:25 -0700 (PDT) Received: from BG-LT7430.marvell.com ([14.140.231.68]) by smtp.gmail.com with ESMTPSA id 15sm4291939pfu.186.2020.04.02.12.38.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2020 12:38:25 -0700 (PDT) From: Pavan Nikhilesh To: jerinj@marvell.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Fri, 3 Apr 2020 01:08:07 +0530 Message-Id: <20200402193808.6978-1-pvnnikhilesh@gmail.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [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" From: Pavan Nikhilesh Validate the producer type used for pipeline and order test suites. Signed-off-by: Pavan Nikhilesh --- 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