From: "Van Haaren, Harry" <harry.van.haaren@intel.com>
To: Jerin Jacob <jerin.jacob@caviumnetworks.com>,
"dev@dpdk.org" <dev@dpdk.org>
Cc: "Richardson, Bruce" <bruce.richardson@intel.com>,
"hemant.agrawal@nxp.com" <hemant.agrawal@nxp.com>,
"Eads, Gage" <gage.eads@intel.com>
Subject: Re: [dpdk-dev] [PATCH 4/4] app/test: unit test case to exercise eventdev vdev uninit
Date: Tue, 7 Feb 2017 15:17:30 +0000 [thread overview]
Message-ID: <E923DB57A917B54B9182A2E928D00FA6129EEDE7@IRSMSX102.ger.corp.intel.com> (raw)
In-Reply-To: <1486358620-4075-5-git-send-email-jerin.jacob@caviumnetworks.com>
> -----Original Message-----
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Monday, February 6, 2017 5:24 AM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; hemant.agrawal@nxp.com; Eads, Gage
> <gage.eads@intel.com>; Van Haaren, Harry <harry.van.haaren@intel.com>; Jerin Jacob
> <jerin.jacob@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH 4/4] app/test: unit test case to exercise eventdev vdev uninit
>
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> ---
Comments inline,
> app/test/test_eventdev.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 59 insertions(+), 1 deletion(-)
>
> diff --git a/app/test/test_eventdev.c b/app/test/test_eventdev.c
> index 042a446..e817838 100644
> --- a/app/test/test_eventdev.c
> +++ b/app/test/test_eventdev.c
> @@ -51,7 +51,7 @@ testsuite_setup(void)
> if (!count) {
> printf("Failed to find a valid event device,"
> " testing with event_skeleton device\n");
> - return rte_eal_vdev_init("event_skeleton", NULL);
> + return rte_eal_vdev_init("event_skeleton0", NULL);
I think these hard-coded eventdev names need to be removed from the testing framework, and we should let the app/test >> propt accept the name of the vdev to use instead. That would allow running tests on each device by:
RTE>> eventdev_common_autotest event_skeleton0
RTE>> eventdev_common_autotest event_sw0
> }
> return TEST_SUCCESS;
> }
> @@ -720,6 +720,62 @@ test_eventdev_close(void)
> return rte_event_dev_close(TEST_DEV_ID);
> }
>
> +#define TEST_EVENTDEV_COUNT 8
> +
> +static int
> +test_eventdev_create_destroy(void)
> +{
> +#ifdef RTE_LIBRTE_PMD_SKELETON_EVENTDEV
Same issue as above, compile-time selection of the tests to be run isn't flexible enough to allow testing multiple eventdevs.
I think using a parameter to eventdev_common_autotest to pass the "name" to use would work again? I am open to other solutions if there's a better way :)
> + int i, ret;
> + uint8_t curr_count;
> + char name[RTE_EVENTDEV_NAME_MAX_LEN];
> +
> + curr_count = rte_event_dev_count();
> +
> + /* Start from one to avoid overlap with active event_skeleton0 dev */
> + for (i = 1; i <= TEST_EVENTDEV_COUNT; i++) {
> + ret = snprintf(name, RTE_EVENTDEV_NAME_MAX_LEN,
> + "%s%u", "event_skeleton", i);
> + TEST_ASSERT(ret >= 0, "Expected >0, %d", ret);
> + ret = rte_eal_vdev_init(name, NULL);
> + TEST_ASSERT_SUCCESS(ret, "Failed to init event_skeleton dev %s",
> + name);
> + }
> + for (i = 1; i <= TEST_EVENTDEV_COUNT; i++) {
> + ret = snprintf(name, RTE_EVENTDEV_NAME_MAX_LEN,
> + "%s%u", "event_skeleton", i);
> + TEST_ASSERT(ret >= 0, "Expected >0, %d", ret);
> + ret = rte_eal_vdev_uninit(name);
> + TEST_ASSERT_SUCCESS(ret, "Failed to uninit skeleton dev %s",
> + name);
> + }
> + TEST_ASSERT(curr_count == rte_event_dev_count(),
> + "init/uninit pairs count mismatch");
> +
> + /* Test in reverse order */
> + for (i = 1; i <= TEST_EVENTDEV_COUNT; i++) {
> + ret = snprintf(name, RTE_EVENTDEV_NAME_MAX_LEN,
> + "%s%u", "event_skeleton", i);
> + TEST_ASSERT(ret >= 0, "Expected >0, %d", ret);
> + ret = rte_eal_vdev_init(name, NULL);
> + TEST_ASSERT_SUCCESS(ret, "Failed to init event_skeleton dev %s",
> + name);
> + }
> + for (i = TEST_EVENTDEV_COUNT; i > 0; i--) {
> + ret = snprintf(name, RTE_EVENTDEV_NAME_MAX_LEN,
> + "%s%u", "event_skeleton", i);
> + TEST_ASSERT(ret >= 0, "Expected >0, %d", ret);
> + ret = rte_eal_vdev_uninit(name);
> + TEST_ASSERT_SUCCESS(ret, "Failed to uninit skeleton dev %s",
> + name);
> + }
> + TEST_ASSERT(curr_count == rte_event_dev_count(),
> + "init/uninit pairs count mismatch");
> +#else
> + printf("Skipping eventdev_create_destroy test due to unavailability of event skeleton
> device\n");
> +#endif
> + return TEST_SUCCESS;
> +}
> static struct unit_test_suite eventdev_common_testsuite = {
> .suite_name = "eventdev common code unit test suite",
> .setup = testsuite_setup,
> @@ -765,6 +821,8 @@ static struct unit_test_suite eventdev_common_testsuite = {
> test_eventdev_link_get),
> TEST_CASE_ST(eventdev_setup_device, NULL,
> test_eventdev_close),
> + TEST_CASE_ST(NULL, NULL,
> + test_eventdev_create_destroy),
> TEST_CASES_END() /**< NULL terminate unit test array */
> }
> };
> --
> 2.5.5
next prev parent reply other threads:[~2017-02-07 15:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-06 5:23 [dpdk-dev] [PATCH 0/4] add eventdev vdev uninit support Jerin Jacob
2017-02-06 5:23 ` [dpdk-dev] [PATCH 1/4] eventdev: fix event driver name to eventdev lookup Jerin Jacob
2017-02-07 15:04 ` Van Haaren, Harry
2017-02-08 14:38 ` Jerin Jacob
2017-02-06 5:23 ` [dpdk-dev] [PATCH 2/4] evendev: add vdev uninit support Jerin Jacob
2017-02-07 15:11 ` Van Haaren, Harry
2017-02-08 14:39 ` Jerin Jacob
2017-02-06 5:23 ` [dpdk-dev] [PATCH 3/4] event/skeleton: " Jerin Jacob
2017-02-07 15:11 ` Van Haaren, Harry
2017-02-08 14:40 ` Jerin Jacob
2017-02-06 5:23 ` [dpdk-dev] [PATCH 4/4] app/test: unit test case to exercise eventdev vdev uninit Jerin Jacob
2017-02-07 15:17 ` Van Haaren, Harry [this message]
2017-02-08 12:30 ` Jerin Jacob
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=E923DB57A917B54B9182A2E928D00FA6129EEDE7@IRSMSX102.ger.corp.intel.com \
--to=harry.van.haaren@intel.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=gage.eads@intel.com \
--cc=hemant.agrawal@nxp.com \
--cc=jerin.jacob@caviumnetworks.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).