From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id AB3BA1B2C7 for ; Tue, 26 Dec 2017 15:12:39 +0100 (CET) Received: from cpe-2606-a000-111b-423c-215-ff-fecc-4872.dyn6.twc.com ([2606:a000:111b:423c:215:ff:fecc:4872] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1eTpy3-0003hH-RH; Tue, 26 Dec 2017 09:12:34 -0500 Date: Tue, 26 Dec 2017 09:11:56 -0500 From: Neil Horman To: Pavan Nikhilesh Cc: jerin.jacob@caviumnetworks.com, harry.van.haaren@intel.com, gage.eads@intel.com, liang.j.ma@intel.com, dev@dpdk.org Message-ID: <20171226141156.GB15284@neilslaptop.think-freely.org> References: <20171212192713.17620-1-pbhagavatula@caviumnetworks.com> <20171225191738.17151-1-pbhagavatula@caviumnetworks.com> <20171225191738.17151-4-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171225191738.17151-4-pbhagavatula@caviumnetworks.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Score: -2.9 (--) X-Spam-Status: No Subject: Re: [dpdk-dev] [PATCH v3 04/11] event/octeontx: modify octeontx eventdev test 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: , X-List-Received-Date: Tue, 26 Dec 2017 14:12:40 -0000 On Tue, Dec 26, 2017 at 12:47:31AM +0530, Pavan Nikhilesh wrote: > Modify test_eventdev_octeontx to be standalone selftest independent of > test framework. > > Signed-off-by: Pavan Nikhilesh > --- > drivers/event/octeontx/octeontx_evdev_selftest.c | 427 +++++++++++++---------- > 1 file changed, 234 insertions(+), 193 deletions(-) > > diff --git a/drivers/event/octeontx/octeontx_evdev_selftest.c b/drivers/event/octeontx/octeontx_evdev_selftest.c > index 8fddb4fd2..3877bca4a 100644 > --- a/drivers/event/octeontx/octeontx_evdev_selftest.c > +++ b/drivers/event/octeontx/octeontx_evdev_selftest.c > @@ -46,12 +46,21 @@ > #include > #include > #include > +#include > > -#include "test.h" > +#include "ssovf_evdev.h" > > #define NUM_PACKETS (1 << 18) > #define MAX_EVENTS (16 * 1024) > > +#define OCTEONTX_TEST_RUN(setup, teardown, test) \ > + octeontx_test_run(setup, teardown, test, #test) > + > +static int total; > +static int passed; > +static int failed; > +static int unsupported; > + > static int evdev; > static struct rte_mempool *eventdev_test_mempool; > > @@ -79,11 +88,11 @@ static inline int > seqn_list_update(int val) > { > if (seqn_list_index >= NUM_PACKETS) > - return TEST_FAILED; > + return -1; > > seqn_list[seqn_list_index++] = val; > rte_smp_wmb(); > - return TEST_SUCCESS; > + return 0; > } > > static inline int > @@ -93,11 +102,11 @@ seqn_list_check(int limit) > > for (i = 0; i < limit; i++) { > if (seqn_list[i] != i) { > - printf("Seqn mismatch %d %d\n", seqn_list[i], i); > - return TEST_FAILED; > + ssovf_log_dbg("Seqn mismatch %d %d", seqn_list[i], i); > + return -1; > } > } > - return TEST_SUCCESS; > + return 0; > } > > struct test_core_param { > @@ -114,20 +123,21 @@ testsuite_setup(void) > > evdev = rte_event_dev_get_dev_id(eventdev_name); > if (evdev < 0) { > - printf("%d: Eventdev %s not found - creating.\n", > + ssovf_log_dbg("%d: Eventdev %s not found - creating.", > __LINE__, eventdev_name); > if (rte_vdev_init(eventdev_name, NULL) < 0) { > - printf("Error creating eventdev %s\n", eventdev_name); > - return TEST_FAILED; > + ssovf_log_dbg("Error creating eventdev %s", > + eventdev_name); > + return -1; > } > evdev = rte_event_dev_get_dev_id(eventdev_name); > if (evdev < 0) { > - printf("Error finding newly created eventdev\n"); > - return TEST_FAILED; > + ssovf_log_dbg("Error finding newly created eventdev"); > + return -1; > } > } > > - return TEST_SUCCESS; > + return 0; > } > > static void > @@ -177,31 +187,34 @@ _eventdev_setup(int mode) > 512, /* Use very small mbufs */ > rte_socket_id()); > if (!eventdev_test_mempool) { > - printf("ERROR creating mempool\n"); > - return TEST_FAILED; > + ssovf_log_dbg("ERROR creating mempool"); > + return -1; > } > > ret = rte_event_dev_info_get(evdev, &info); > - TEST_ASSERT_SUCCESS(ret, "Failed to get event dev info"); > - TEST_ASSERT(info.max_num_events >= (int32_t)MAX_EVENTS, > - "max_num_events=%d < max_events=%d", > - info.max_num_events, MAX_EVENTS); > + RTE_TEST_ASSERT_SUCCESS(ret, "Failed to get event dev info"); > + if (!(info.max_num_events >= (int32_t)MAX_EVENTS)) { > + ssovf_log_dbg("ERROR max_num_events=%d < max_events=%d", > + info.max_num_events, MAX_EVENTS); > + return -1; > + } > I'm not sure how any of this is particularly adventageous. You've replaced two ASSERTION macros with one and an additional conditional. The assert macros are just a flexible as their were previously (which is to say, not overly so). So i'm not sure what the advantage of renaming them is. Neil