From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0085.outbound.protection.outlook.com [104.47.38.85]) by dpdk.org (Postfix) with ESMTP id ED340952 for ; Wed, 8 Feb 2017 13:30:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=suvcqPJXGpZZJvprE6tIW5wRFI/h9GlDqjQgXK6pjcs=; b=In6gIMgwDWaMdERltBdAngzBSyilzX0mww7ajuWiy/JD5Mv3pfO+6CR+Evyg0uW8k2Gr6M+N728G8BhCk2TpzUHbwbLJD6i/3/zsqlY4OZc3L999k3/iqdEeQqFf02rBNpALhsmxnHyaKDeSv86lOtYZMglYZj3qaoZ0c6eRqIU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain (122.167.145.188) by BY1PR0701MB1723.namprd07.prod.outlook.com (10.162.111.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Wed, 8 Feb 2017 12:30:43 +0000 Date: Wed, 8 Feb 2017 18:00:28 +0530 From: Jerin Jacob To: "Van Haaren, Harry" CC: "dev@dpdk.org" , "Richardson, Bruce" , "hemant.agrawal@nxp.com" , "Eads, Gage" Message-ID: <20170208123027.GA31813@localhost.localdomain> References: <1486358620-4075-1-git-send-email-jerin.jacob@caviumnetworks.com> <1486358620-4075-5-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-Originating-IP: [122.167.145.188] X-ClientProxiedBy: MAXPR01CA0027.INDPRD01.PROD.OUTLOOK.COM (10.164.147.34) To BY1PR0701MB1723.namprd07.prod.outlook.com (10.162.111.142) X-MS-Office365-Filtering-Correlation-Id: 40398b9f-c645-4a16-ff40-08d4501e4e4a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 3:wuuqYexaEvrJF53LzPUkzpIBBYVBY2ZhlW17pev2qLCSYfpO2+Gbe5c+ByF+ttqegUntRvwKcOb/LSPy3VRGswbr57JViF6s3RyInGoaK7+lgDUu89Xrs+ezm+hgvbIiFPIfuV2sM9L8gJOi+WwKhA3aiDVu/5CKNrHGnJXFxVHf8SbX3QIfVV4eqe1MYJMX4nhyH+kXQEwkCyMwCjBsCYSFMrmcpL7aDspp03qFL0xuRmjY8FIDMuURVVE7aAkqI/ZLhzQagYc4CRtaTxiVTw==; 25:V8LsGMisQ8VynGJMsJ6KfFXjDo7cPyBci2sXHgXdhISqNZgZh9M7eg4O12tABN4GzR1vLQQECn1INkQqe5rBQ38ad01tGFdxT2Se7HU/bVf/YCg1hdCYbBLS7lEKJ3SmyoINZFrsmEtZOhalZ/XelYnTVQaGwbKDuNyW58FDnN+FXSfFUnmqnW2yXxk2JCGjQOC4KAUpWZE6MPCZ3kh3TSum5ADnFvjPMZQAIjz5t4/8C9F5XS7D5s2e8i5NoTiSsbx4GFOWtTDkJJpm6zTgt+xzg5x9b7XGjo9VzBKtj/xUdJgChCnY+rUCdd64wpQ5Q0w63zFM3Nd1kzaZe4CWdD62wC3Nu9qogGf5w71bQ+F+9TZ55V/b267SD3ylVBohUwJfKFP1cV64wQb+/tR8lhBQRqTOVNoo2nZl6ute0U7KFj6p7y8Ji2lFJVIz4avZZU8Z6EnUpSZKNwK7+3/K0A== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 31:gznUpnw1z8p8F0QicTKhpgqfPb8KXIo+uHqgK1PHsNcp1XuU342VTOqx5HFf9v+XDdOzyOjibbU/ypL6GBmRN3tgBuiK6epryPFqE1X25OF8rgyhQPU08CvMF/uCAMQkd5B96ecQb3EUV6mbWuD8ISVGi/M0kW6NESfoP4qbWT+MzwX/XespNIGgZbgH63nbZdSlzLOZ1JlyhDJwJn706xUJ14xFyVvlFbQ+5RLZpSynygJKx7L8kZZUZFv5iM6VH7RHXEnNvm4wXPkf0wYKAw==; 20:VNpYqOBJLewZaXTa0N8wo6Y/qwwvkQK8g9RYMVgBAKPcuSXrNdk7Ni/y3FGpdcvdNbSOfAw5TtEByT5/jEjbkmqAiFsEtO57gXOhQFgTeN26e9jWH/k+PS5L5MMDkxb0xYxOoE7bl5QxPxxYCvZwY0uNgK487wOnFV4Tgkg1kgSuZT341GHwcEJCSj1JZw9qOYhAhUYnYaXTpBFfaq8WI2c19q+dZI1KyGQivXla/2ksKPOEqNE9xqKDezydsgDcqzTAStU9jjO6TlfMd4cvrmmu+euw161cyv0lEbpmZRQWpuMx9rEJST+hToGkd2dbcPyroIgsu1UTEI4uGJOKuH30/egRfdjdnPNjnpeCnV+n2Kyci/TEvAd9zuFUN3+6Mwc/t7i7bual+PMcF3ol90Cw3FmSXTCVZiPmRiEo/F4980zvyhUKVugP8bPYaL/O8ZZQ768q3XKqtau6k1A/nco/pXbqbzrZw72gu6Of5QQk6Ka6Sl4tYvWI3dW22jeUXiawCD52fsRkTAv8GER3ACYSxp2uIUPumWpJkly3cVKVj0X/bAo6C+l9xgyLnvbYcCJkiIVeRil5QkvtOCz0d6OU1jhjPHGPvUva27qUpgA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(211563237711210)(185117386973197)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(20170203043)(8121501046)(2017020702029)(3002001)(10201501046)(6041248)(20161123562025)(20161123560025)(20161123558025)(20161123564025)(20161123555025)(6072148); SRVR:BY1PR0701MB1723; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 4:Zn6kYofJmd+IFvAQp/REWkzGk4GnntvGRnElXuYpLJrSjCu+PQvuUwTAJ8aioXKKwDjQLQ3/OCPzYW/QXU6nXRw65fgVZRcX+72zAE4YDe6D0G7SX/+TWHUJ20ot2FvgHbovRW9jO5z7F1OUD4iEdSwhZcVcZN6gCeGdnpimr4/LWnLVVE7JcoEIJuoeQvIINKyK9szaqFI2bjLT+7xjqx7Szy1Im3F0+j2BkQnbXEUfTXdTjWgvXJ0TCgxDfkU4IJK7ijk261X5CTFmbk8AUzsAYU3gejvZSkjkeq7uViMVkS010ak5c/xJlP7IvqNLqsiAM0SS2IA/p30HP9pbeL/eCmqS2Z41IWgKLdI7KQjCyxlJXfiBOg6fZo+Aud7u7AqpGSV70zxIEwU1FGjp0l4lR5ZePFU7cDEcSVyt5ZhpdrOfwQwRloYJhDXe8MCnuCN3BClN1oonXwE3daWQDKzwq/1QWqwk/87w+QG838O/VuXNeU1HpCVPfKNC3VzF3af3ytbQtYMyuyh5X0f4Loi2Lzlw5adKrDxd3h/oKbPPpteF4Tn8EctKU/QLqsNhf2lrCE+arhK9CHA8A/hhdclkk29Jll0Nf8RWY2SS6TRM8u+Fxa46ZwGTZCCLP0iiI8ibw0qIywbYd0IagRd0N+MHwwoxJUe2ZZ8QoV/Ccj+6cE/MZ3rcp6+65tDlmM6sxq3n0HMWBf85h8HUUvYLyEiyQYlW6CObevPFC50ruo8CQ7r3VTKyY+sJIqYU53Am/69z664GOrzSoXRSooy3xA== X-Forefront-PRVS: 0212BDE3BE X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(377454003)(13464003)(24454002)(199003)(189002)(6666003)(2950100002)(68736007)(61506002)(305945005)(81166006)(81156014)(25786008)(8676002)(6506006)(42882006)(6916009)(50466002)(97736004)(23726003)(9686003)(2906002)(54906002)(4001350100001)(4326007)(8656002)(229853002)(46406003)(38730400002)(55016002)(110136004)(189998001)(3846002)(6116002)(1076002)(97756001)(6246003)(54356999)(76176999)(105586002)(83506001)(53936002)(42186005)(5660300001)(33656002)(92566002)(101416001)(7736002)(47776003)(106356001)(50986999)(66066001)(7099028)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1723; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0701MB1723; 23:1YQ8PrQd2CSuGR9MtwrjkCOXxXM3tX54lP+GzpQ?= =?us-ascii?Q?q4zPisYExZYYyHPl2jzeJriXvlztfpb8UmqNzVgaRtm8mSPN52CoKMSfjJnv?= =?us-ascii?Q?CUzxj+/PkaHjoPRaZdbOnKXWdqFh4j1KFKQqA+chWa+mfAiRdfCqFOCB/bV2?= =?us-ascii?Q?5m064K/uUPe+R8oUCF5xaMFg9CENKiGKs0EpT4Fvcw7MGB6/TYi9c9a47Xap?= =?us-ascii?Q?8QIIsdgQMo7AiaBYrH2IAfZtdQM3qOinRTCBJXDsB1Rd4QOgOY6v1leuguRh?= =?us-ascii?Q?6LZ4v6THbYzMqxxlxjq2gwYGZy0jyi78QOIjiSpfjzrirGE6AtGSrxsIxpoB?= =?us-ascii?Q?pBlmaxkW3HJ9ocHseTQ1JCE5w3lEoqBSfVsC71SYlgAHdcsB3c2m5nmFa4A2?= =?us-ascii?Q?L25kAmfP1NGxMxACBBUfBO6XtCMUlqJAi3wbv+L8RhVrNEof24M8ieOc+pkt?= =?us-ascii?Q?r0ZR7WowZaaH6kJr0w68yL43/CIqBLBz/8NyQqTMSO0XpyINagEwfVol+Dkg?= =?us-ascii?Q?XYLRU1w11akhPsl30OzPtZwOq7HohGjgyndY//h0DN1cYFAMQuyGcW6wQi+h?= =?us-ascii?Q?iTWd+ymtn+TudZzyMPDXBImVNO0HirvhmhqbDQRdT/kGmG60WLvMwEVoW1K5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mBKOgDUZ+fm3+u6laIILp/tHdI/b5l9K+XIQzkqYKgZiGyaiKSI8dPboltD8OLmTuKZ0kKS9RtrpfloTeT4TKMTv2t5yBjgEeoL3FvvK4irrGP4VYMf3lLWWWB8d9Ztg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2017 12:30:43.7592 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Subject: Re: [dpdk-dev] [PATCH 4/4] app/test: unit test case to exercise eventdev vdev uninit 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: Wed, 08 Feb 2017 12:30:48 -0000 On Tue, Feb 07, 2017 at 03:17:30PM +0000, Van Haaren, Harry wrote: > > -----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 ; hemant.agrawal@nxp.com; Eads, Gage > > ; Van Haaren, Harry ; Jerin Jacob > > > > Subject: [dpdk-dev] [PATCH 4/4] app/test: unit test case to exercise eventdev vdev uninit > > > > Signed-off-by: Jerin Jacob > > --- > > 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 It checks for "count = rte_event_dev_count()" before the calling rte_eal_vdev_init. That's would translate to use any eventdev driver if it is available in the EAL command line argument.So I think, we are good here and in case none of the drivers provided in EAL argument it choose the skeleton driver as default. sudo ./build/app/test -c 2 --vdev='event_sw0' sudo ./build/app/test -c 2 --vdev='event_skeleton0' > > > > } > > 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 :) In general I agree with your comment. But in this specific case, 1) Device can be PCI device too. But,This test case will be applicable only to vdev device. So does it make sense to generalize. 2) Currently app/test won't accepts the command line arguments for a specific test case.Is there any other alternatives? If none, I will check for possibility of adding that change to app/test first. Another options could be, 1) environment variable 2) new eventdev APIs to get driver name from dev_id.But does not makes much sense in case PCIe device. Thoughts? > > > > + 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 >