DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
To: jerin.jacob@caviumnetworks.com, bruce.richardson@intel.com,
	harry.van.haaren@intel.com, gage.eads@intel.com,
	hemant.agrawal@nxp.com, nipun.gupta@nxp.com,
	liang.j.ma@intel.com
Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Subject: [dpdk-dev]  [PATCH 5/7] event/sw: modify eventdev sw test
Date: Wed, 13 Dec 2017 00:57:11 +0530	[thread overview]
Message-ID: <20171212192713.17620-5-pbhagavatula@caviumnetworks.com> (raw)
In-Reply-To: <20171212192713.17620-1-pbhagavatula@caviumnetworks.com>

Modify test_eventdev_sw to be standalone selftest independent of test
framework.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 drivers/event/sw/selftest_sw.c | 71 +++++++++++++++++++++---------------------
 1 file changed, 36 insertions(+), 35 deletions(-)

diff --git a/drivers/event/sw/selftest_sw.c b/drivers/event/sw/selftest_sw.c
index 96ed920cc..b97175f5b 100644
--- a/drivers/event/sw/selftest_sw.c
+++ b/drivers/event/sw/selftest_sw.c
@@ -52,7 +52,7 @@
 #include <rte_service_component.h>
 #include <rte_bus_vdev.h>
 
-#include "test.h"
+#include "sw_evdev.h"
 
 #define MAX_PORTS 16
 #define MAX_QIDS 16
@@ -3038,7 +3038,7 @@ worker_loopback(struct test *t)
 
 static struct rte_mempool *eventdev_func_mempool;
 
-static int
+void
 test_sw_eventdev(void)
 {
 	struct test *t = malloc(sizeof(struct test));
@@ -3049,25 +3049,25 @@ test_sw_eventdev(void)
 	 */
 	release_ev.op = RTE_EVENT_OP_RELEASE;
 
-	const char *eventdev_name = "event_sw0";
+	const char *eventdev_name = "event_sw";
 	evdev = rte_event_dev_get_dev_id(eventdev_name);
 	if (evdev < 0) {
 		printf("%d: Eventdev %s not found - creating.\n",
 				__LINE__, eventdev_name);
 		if (rte_vdev_init(eventdev_name, NULL) < 0) {
 			printf("Error creating eventdev\n");
-			return -1;
+			goto test_fail;
 		}
 		evdev = rte_event_dev_get_dev_id(eventdev_name);
 		if (evdev < 0) {
 			printf("Error finding newly created eventdev\n");
-			return -1;
+			goto test_fail;
 		}
 	}
 
 	if (rte_event_dev_service_id_get(evdev, &t->service_id) < 0) {
 		printf("Failed to get service ID for software event dev\n");
-		return -1;
+		goto test_fail;
 	}
 
 	rte_service_runstate_set(t->service_id, 1);
@@ -3084,7 +3084,7 @@ test_sw_eventdev(void)
 				rte_socket_id());
 		if (!eventdev_func_mempool) {
 			printf("ERROR creating mempool\n");
-			return -1;
+			goto test_fail;
 		}
 	}
 	t->mbuf_pool = eventdev_func_mempool;
@@ -3092,153 +3092,153 @@ test_sw_eventdev(void)
 	ret = test_single_directed_packet(t);
 	if (ret != 0) {
 		printf("ERROR - Single Directed Packet test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 	printf("*** Running Directed Forward Credit test...\n");
 	ret = test_directed_forward_credits(t);
 	if (ret != 0) {
 		printf("ERROR - Directed Forward Credit test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 	printf("*** Running Single Load Balanced Packet test...\n");
 	ret = single_packet(t);
 	if (ret != 0) {
 		printf("ERROR - Single Packet test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 	printf("*** Running Unordered Basic test...\n");
 	ret = unordered_basic(t);
 	if (ret != 0) {
 		printf("ERROR -  Unordered Basic test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 	printf("*** Running Ordered Basic test...\n");
 	ret = ordered_basic(t);
 	if (ret != 0) {
 		printf("ERROR -  Ordered Basic test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 	printf("*** Running Burst Packets test...\n");
 	ret = burst_packets(t);
 	if (ret != 0) {
 		printf("ERROR - Burst Packets test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 	printf("*** Running Load Balancing test...\n");
 	ret = load_balancing(t);
 	if (ret != 0) {
 		printf("ERROR - Load Balancing test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 	printf("*** Running Prioritized Directed test...\n");
 	ret = test_priority_directed(t);
 	if (ret != 0) {
 		printf("ERROR - Prioritized Directed test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 	printf("*** Running Prioritized Atomic test...\n");
 	ret = test_priority_atomic(t);
 	if (ret != 0) {
 		printf("ERROR - Prioritized Atomic test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 
 	printf("*** Running Prioritized Ordered test...\n");
 	ret = test_priority_ordered(t);
 	if (ret != 0) {
 		printf("ERROR - Prioritized Ordered test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 	printf("*** Running Prioritized Unordered test...\n");
 	ret = test_priority_unordered(t);
 	if (ret != 0) {
 		printf("ERROR - Prioritized Unordered test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 	printf("*** Running Invalid QID test...\n");
 	ret = invalid_qid(t);
 	if (ret != 0) {
 		printf("ERROR - Invalid QID test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 	printf("*** Running Load Balancing History test...\n");
 	ret = load_balancing_history(t);
 	if (ret != 0) {
 		printf("ERROR - Load Balancing History test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 	printf("*** Running Inflight Count test...\n");
 	ret = inflight_counts(t);
 	if (ret != 0) {
 		printf("ERROR - Inflight Count test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 	printf("*** Running Abuse Inflights test...\n");
 	ret = abuse_inflights(t);
 	if (ret != 0) {
 		printf("ERROR - Abuse Inflights test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 	printf("*** Running XStats test...\n");
 	ret = xstats_tests(t);
 	if (ret != 0) {
 		printf("ERROR - XStats test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 	printf("*** Running XStats ID Reset test...\n");
 	ret = xstats_id_reset_tests(t);
 	if (ret != 0) {
 		printf("ERROR - XStats ID Reset test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 	printf("*** Running XStats Brute Force test...\n");
 	ret = xstats_brute_force(t);
 	if (ret != 0) {
 		printf("ERROR - XStats Brute Force test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 	printf("*** Running XStats ID Abuse test...\n");
 	ret = xstats_id_abuse_tests(t);
 	if (ret != 0) {
 		printf("ERROR - XStats ID Abuse test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 	printf("*** Running QID Priority test...\n");
 	ret = qid_priorities(t);
 	if (ret != 0) {
 		printf("ERROR - QID Priority test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 	printf("*** Running Ordered Reconfigure test...\n");
 	ret = ordered_reconfigure(t);
 	if (ret != 0) {
 		printf("ERROR - Ordered Reconfigure test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 	printf("*** Running Port LB Single Reconfig test...\n");
 	ret = port_single_lb_reconfig(t);
 	if (ret != 0) {
 		printf("ERROR - Port LB Single Reconfig test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 	printf("*** Running Port Reconfig Credits test...\n");
 	ret = port_reconfig_credits(t);
 	if (ret != 0) {
 		printf("ERROR - Port Reconfig Credits Reset test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 	printf("*** Running Head-of-line-blocking test...\n");
 	ret = holb(t);
 	if (ret != 0) {
 		printf("ERROR - Head-of-line-blocking test FAILED.\n");
-		return ret;
+		goto test_fail;
 	}
 	if (rte_lcore_count() >= 3) {
 		printf("*** Running Worker loopback test...\n");
 		ret = worker_loopback(t);
 		if (ret != 0) {
 			printf("ERROR - Worker loopback test FAILED.\n");
-			return ret;
+			goto test_fail;
 		}
 	} else {
 		printf("### Not enough cores for worker loopback test.\n");
@@ -3250,7 +3250,8 @@ test_sw_eventdev(void)
 	 */
 	free(t);
 
-	return 0;
+	printf("SW Eventdev Selftest Successful.\n");
+	return;
+test_fail:
+	printf("SW Eventdev Selftest Failed.\n");
 }
-
-REGISTER_TEST_COMMAND(eventdev_sw_autotest, test_sw_eventdev);
-- 
2.14.1

  parent reply	other threads:[~2017-12-12 19:28 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-12 19:27 [dpdk-dev] [PATCH 1/7] event/octeontx: move eventdev octeontx test to driver Pavan Nikhilesh
2017-12-12 19:27 ` [dpdk-dev] [PATCH 2/7] event/octeontx: modify octeontx eventdev test Pavan Nikhilesh
2017-12-12 19:27 ` [dpdk-dev] [PATCH 3/7] event/octeontx: add selftest to device arguments Pavan Nikhilesh
2017-12-12 19:27 ` [dpdk-dev] [PATCH 4/7] event/sw: move eventdev sw test to driver Pavan Nikhilesh
2017-12-13 10:22   ` Van Haaren, Harry
2017-12-12 19:27 ` Pavan Nikhilesh [this message]
2017-12-12 19:27 ` [dpdk-dev] [PATCH 6/7] event/sw: add selftest to device arguments Pavan Nikhilesh
2017-12-12 19:27 ` [dpdk-dev] [PATCH 7/7] doc: update eventdev documentation Pavan Nikhilesh
2017-12-13 13:48   ` Kovacevic, Marko
2017-12-13 10:19 ` [dpdk-dev] [PATCH 1/7] event/octeontx: move eventdev octeontx test to driver Van Haaren, Harry
2017-12-13 10:34   ` Bruce Richardson
2017-12-13 11:24     ` Pavan Nikhilesh Bhagavatula
2017-12-13 11:39       ` Bruce Richardson
2017-12-13 11:19   ` Pavan Nikhilesh Bhagavatula
2017-12-13 11:41     ` Bruce Richardson
2017-12-13 15:50       ` Pavan Nikhilesh Bhagavatula
2017-12-14 15:01 ` [dpdk-dev] [PATCH v2 00/11] eventdev: move eventdev pmd specific tests into the pmd dir Pavan Nikhilesh
2017-12-14 15:01   ` [dpdk-dev] [PATCH v2 01/11] eal: add common test assert macros Pavan Nikhilesh
2017-12-14 18:43     ` Ananyev, Konstantin
2017-12-15  9:04       ` Pavan Nikhilesh Bhagavatula
2017-12-15 10:58         ` Ananyev, Konstantin
2017-12-15 11:32           ` Pavan Nikhilesh Bhagavatula
2018-01-10 19:16             ` Jerin Jacob
2018-01-10 20:18               ` Thomas Monjalon
2017-12-14 15:01   ` [dpdk-dev] [PATCH v2 02/11] eventdev: add API to perform self test Pavan Nikhilesh
2017-12-19 15:45     ` Van Haaren, Harry
2017-12-14 15:01   ` [dpdk-dev] [PATCH v2 03/11] event/octeontx: move eventdev octeontx test to driver Pavan Nikhilesh
2017-12-14 15:01   ` [dpdk-dev] [PATCH v2 04/11] event/octeontx: modify octeontx eventdev test Pavan Nikhilesh
2017-12-14 15:01   ` [dpdk-dev] [PATCH v2 05/11] event/octeontx: update octeontx eventdev selftest ops Pavan Nikhilesh
2017-12-14 15:01   ` [dpdk-dev] [PATCH v2 06/11] event/octeontx: add selftest to device arguments Pavan Nikhilesh
2017-12-14 15:01   ` [dpdk-dev] [PATCH v2 07/11] event/sw: move eventdev software test to driver Pavan Nikhilesh
2017-12-14 15:01   ` [dpdk-dev] [PATCH v2 08/11] event/sw: modify eventdev software test Pavan Nikhilesh
2017-12-19 15:44     ` Van Haaren, Harry
2017-12-14 15:01   ` [dpdk-dev] [PATCH v2 09/11] event/sw: update software eventdev selftest ops Pavan Nikhilesh
2017-12-19 15:46     ` Van Haaren, Harry
2017-12-14 15:01   ` [dpdk-dev] [PATCH v2 10/11] test: register eventdev selftest Pavan Nikhilesh
2017-12-19 15:27     ` Van Haaren, Harry
2017-12-19 18:44       ` Pavan Nikhilesh
2017-12-20 11:07         ` Van Haaren, Harry
2017-12-14 15:01   ` [dpdk-dev] [PATCH v2 11/11] doc: update eventdev documentation Pavan Nikhilesh
2017-12-25 19:17 ` [dpdk-dev] [PATCH v3 01/11] eal: add common test assert macros Pavan Nikhilesh
2017-12-25 19:17   ` [dpdk-dev] [PATCH v3 02/11] eventdev: add API to perform self test Pavan Nikhilesh
2018-01-08  9:56     ` Jerin Jacob
2018-01-08 10:34       ` Pavan Nikhilesh
2017-12-25 19:17   ` [dpdk-dev] [PATCH v3 03/11] event/octeontx: move eventdev octeontx test to driver Pavan Nikhilesh
2018-01-08  9:58     ` Jerin Jacob
2017-12-25 19:17   ` [dpdk-dev] [PATCH v3 04/11] event/octeontx: modify octeontx eventdev test Pavan Nikhilesh
2017-12-26 14:11     ` Neil Horman
2017-12-27  5:18       ` Pavan Nikhilesh
2017-12-25 19:17   ` [dpdk-dev] [PATCH v3 05/11] event/octeontx: update octeontx eventdev selftest ops Pavan Nikhilesh
2018-01-08 10:09     ` Jerin Jacob
2017-12-25 19:17   ` [dpdk-dev] [PATCH v3 06/11] event/octeontx: add selftest to device arguments Pavan Nikhilesh
2018-01-08 10:14     ` Jerin Jacob
2017-12-25 19:17   ` [dpdk-dev] [PATCH v3 07/11] event/sw: move eventdev software test to driver Pavan Nikhilesh
2017-12-25 19:17   ` [dpdk-dev] [PATCH v3 08/11] event/sw: modify eventdev software test Pavan Nikhilesh
2017-12-25 19:17   ` [dpdk-dev] [PATCH v3 09/11] event/sw: update software eventdev selftest ops Pavan Nikhilesh
2017-12-25 19:17   ` [dpdk-dev] [PATCH v3 10/11] test: register eventdev selftest Pavan Nikhilesh
2018-01-08  9:49     ` Jerin Jacob
2017-12-25 19:17   ` [dpdk-dev] [PATCH v3 11/11] doc: update eventdev documentation Pavan Nikhilesh
2018-01-08 11:17   ` [dpdk-dev] [PATCH v3 01/11] eal: add common test assert macros Jerin Jacob
2018-01-08 13:47 ` [dpdk-dev] [PATCH v4 " Pavan Nikhilesh
2018-01-08 13:47   ` [dpdk-dev] [PATCH v4 02/11] eventdev: add API to perform self test Pavan Nikhilesh
2018-01-08 13:47   ` [dpdk-dev] [PATCH v4 03/11] event/octeontx: move eventdev octeontx test to driver Pavan Nikhilesh
2018-01-08 13:47   ` [dpdk-dev] [PATCH v4 04/11] event/octeontx: modify octeontx eventdev test Pavan Nikhilesh
2018-01-08 13:47   ` [dpdk-dev] [PATCH v4 05/11] event/octeontx: update octeontx eventdev selftest ops Pavan Nikhilesh
2018-01-08 13:47   ` [dpdk-dev] [PATCH v4 06/11] event/octeontx: add selftest to device arguments Pavan Nikhilesh
2018-01-08 13:47   ` [dpdk-dev] [PATCH v4 07/11] event/sw: move eventdev software test to driver Pavan Nikhilesh
2018-01-08 13:47   ` [dpdk-dev] [PATCH v4 08/11] event/sw: modify eventdev software test Pavan Nikhilesh
2018-01-08 13:47   ` [dpdk-dev] [PATCH v4 09/11] event/sw: update software eventdev selftest ops Pavan Nikhilesh
2018-01-08 13:47   ` [dpdk-dev] [PATCH v4 10/11] test: register eventdev selftest Pavan Nikhilesh
2018-01-08 13:47   ` [dpdk-dev] [PATCH v4 11/11] doc: update eventdev documentation Pavan Nikhilesh
2018-01-10 20:20   ` [dpdk-dev] [PATCH v4 01/11] eal: add common test assert macros Thomas Monjalon
2018-01-11  7:11     ` Pavan Nikhilesh
2018-01-11 10:21 ` [dpdk-dev] [PATCH v5 " Pavan Nikhilesh
2018-01-11 10:21   ` [dpdk-dev] [PATCH v5 02/11] eventdev: add API to perform self test Pavan Nikhilesh
2018-01-11 10:21   ` [dpdk-dev] [PATCH v5 03/11] event/octeontx: move eventdev octeontx test to driver Pavan Nikhilesh
2018-01-11 10:21   ` [dpdk-dev] [PATCH v5 04/11] event/octeontx: modify octeontx eventdev test Pavan Nikhilesh
2018-01-11 10:21   ` [dpdk-dev] [PATCH v5 05/11] event/octeontx: update octeontx eventdev selftest ops Pavan Nikhilesh
2018-01-11 10:21   ` [dpdk-dev] [PATCH v5 06/11] event/octeontx: add selftest to device arguments Pavan Nikhilesh
2018-01-11 10:21   ` [dpdk-dev] [PATCH v5 07/11] event/sw: move eventdev software test to driver Pavan Nikhilesh
2018-01-11 10:21   ` [dpdk-dev] [PATCH v5 08/11] event/sw: modify eventdev software test Pavan Nikhilesh
2018-01-11 10:21   ` [dpdk-dev] [PATCH v5 09/11] event/sw: update software eventdev selftest ops Pavan Nikhilesh
2018-01-11 10:21   ` [dpdk-dev] [PATCH v5 10/11] test: register eventdev selftest Pavan Nikhilesh
2018-01-11 10:21   ` [dpdk-dev] [PATCH v5 11/11] doc: update eventdev documentation Pavan Nikhilesh
2018-01-11 11:27     ` Jerin Jacob
2018-01-11 10:29   ` [dpdk-dev] [PATCH v5 01/11] eal: add common test assert macros Pavan Nikhilesh
2018-01-11 10:44     ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171212192713.17620-5-pbhagavatula@caviumnetworks.com \
    --to=pbhagavatula@caviumnetworks.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=gage.eads@intel.com \
    --cc=harry.van.haaren@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=liang.j.ma@intel.com \
    --cc=nipun.gupta@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).