From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DD73EA0C54; Fri, 3 Sep 2021 17:14:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C744C410FE; Fri, 3 Sep 2021 17:14:34 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 448B5410EA for ; Fri, 3 Sep 2021 17:14:32 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10096"; a="216303897" X-IronPort-AV: E=Sophos;i="5.85,265,1624345200"; d="scan'208";a="216303897" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2021 08:14:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,265,1624345200"; d="scan'208";a="689790684" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga006.fm.intel.com with ESMTP; 03 Sep 2021 08:14:30 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Fri, 3 Sep 2021 08:14:30 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Fri, 3 Sep 2021 08:14:29 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Fri, 3 Sep 2021 08:14:28 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.173) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Fri, 3 Sep 2021 08:14:28 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fL3J1z3SF0HZMfauoRbn4FuTAaU/zqfp+x/kC+TBvDiwn8MuqRUyKVlTOiRN1C6tObmuB9J153PD6HVUt9WVFbSRp4xkvjWNrrtLl0UDG7YzokkNLe/U7f5bGzNVW2dDGDIsdv1mGGP3B/9yHk3u7j8vg1lskKiqlXmgxQJWaDitxINJlTveFEPyQIAfyGyAgAwkYk6W2WwaIWNmoynma45fEdLqwx1o8PkJlu0XflhoQhSs3Icrs9YJDEJMfVZmKB0YriGYROcuOwQVBW06ZFMv41KrxJCCiO+Zev7JS8s4VYM9lJZQLrax9aF1//DJc94OiPLWqyPu4qRzI60Jnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=BcNoRMl0AWxOTjJkRjkoanErVFJ6+A3mMqplm+pxCtE=; b=R2cIjJPM21TwhAi+jV55oiZHHyG7LG6jw0KmBWaQ9sBmdJkVTQQtF1SCXYqAdaMwUvkR5iytk5oYH6kSmLnTtWSra6qQj954ahgVXX3W/sQG41vtvaRMfbU+9mYucj9qo7hbr+J1/bXMUBo3AckE+KGg/zcnJNa47pjjq4O6XeM5PweNE8qHFp2m0jFE6Zd4+pFvKkfvvLALNLqYKXV2L+aPITZnBy3mxheCneSSflVnbdnLBWGoNmFUPXvKCeMp49nEpVy8FX9IX3kh1xoXYDs/NlPP7U//zPlQb2gcDyrvQOd/MFyzfYpDS223hMtOzmfPF2sveUaRJh4UPrK3fQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BcNoRMl0AWxOTjJkRjkoanErVFJ6+A3mMqplm+pxCtE=; b=Te22s6t1R1FfDmOanthIyDYU8fuN7hsLAZPcYDs+6L3i1gqzlnrjCKCMFkrv9VzGOXzii9UPfpi9sfYommzqjsYQCI1fIhpiXLt9kVbasMXgxk/ix8aQnxpBEO3zcb8V+7iVA20RjIwy550o9wvuemlJiHxJvSqfb8r9IiiN8YQ= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; Received: from SJ0PR11MB5055.namprd11.prod.outlook.com (2603:10b6:a03:2d9::10) by SJ0PR11MB4941.namprd11.prod.outlook.com (2603:10b6:a03:2d2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.17; Fri, 3 Sep 2021 15:14:26 +0000 Received: from SJ0PR11MB5055.namprd11.prod.outlook.com ([fe80::78d4:6f82:aa87:c271]) by SJ0PR11MB5055.namprd11.prod.outlook.com ([fe80::78d4:6f82:aa87:c271%5]) with mapi id 15.20.4478.022; Fri, 3 Sep 2021 15:14:25 +0000 To: Chengwen Feng , , , , , , CC: , , , , , , , , , , References: <1625231891-2963-1-git-send-email-fengchengwen@huawei.com> <1630588395-2804-1-git-send-email-fengchengwen@huawei.com> <1630588395-2804-8-git-send-email-fengchengwen@huawei.com> From: Kevin Laatz Message-ID: Date: Fri, 3 Sep 2021 16:14:17 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 In-Reply-To: <1630588395-2804-8-git-send-email-fengchengwen@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB X-ClientProxiedBy: DBBPR09CA0027.eurprd09.prod.outlook.com (2603:10a6:10:d4::15) To SJ0PR11MB5055.namprd11.prod.outlook.com (2603:10b6:a03:2d9::10) MIME-Version: 1.0 Received: from [192.168.1.15] (109.79.29.175) by DBBPR09CA0027.eurprd09.prod.outlook.com (2603:10a6:10:d4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.17 via Frontend Transport; Fri, 3 Sep 2021 15:14:22 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5be6e47c-6026-4a58-017a-08d96eed845f X-MS-TrafficTypeDiagnostic: SJ0PR11MB4941: X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: csSQqj0SW4NHCToKb2e7KD8jN0QpNybvcGNJRcicHN1KvL1NHjIQPGoP9zavdymVp5e10JnPemQnOctCGP1jBrb4rxgaOeg0uY/zYn/dawTNSWwcOtkVn8ehz3D7+Wk9QibFAaTcMr+HH4DjcGE3fZAraqHypsx0Z1ETI9bQIgcSVvd5a/Oh65Q7mjjyXWdluW2qrbozwZxdzKXaDqK3+czDkkXfw4UdV5BCPFvTNJR266qT0BTaNvu3GEVQpt062fMfn/UziI1c+vW/U1XiJ2nbyC0z7nKGm1Wh7NhUCnlZhae/tsXMXfELYgQi5x0ZVYsxcThpfRqUsL5MIeRd9TViCK+qz0BC+yDuZa5mhhKupsVizhxKFrYW3hmfOojFRCwlQAuy0E0v/J2pzc7vW9m7tL+M7rHpZqqqeTwCgzgJwgD/lATon/dfPi9VriyYlmH07mGtCUkyZ5TeRsRCOG/5mQiMyLzjQ5I5aXOCI8JU9FvXV+onchxA8Z4NUTtBsFHORIllEulDGA3/XbSyZIF54ZmKIpoqh3g3k0whj6oAur1NeeffuzbrerJU0MdVHZ3m9VRKCuOMblFisT8BL22o30YKaLbBesGd370wzrVtFjpMmZCyRfubTxTlKjfDr1pFU8/KvZsW0LmnyARR6ezlHV6RBbq9cwzFDY/Ljlho8RBACvJrQYClDw6IbpXe940GUSiE9dYJYleoRfUGzK2D2R+I9/K1WU98oKgf0vw= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR11MB5055.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(136003)(376002)(396003)(346002)(366004)(5660300002)(316002)(6666004)(478600001)(31696002)(16576012)(4326008)(86362001)(31686004)(107886003)(66476007)(83380400001)(26005)(66556008)(186003)(6486002)(2616005)(36756003)(44832011)(8936002)(956004)(2906002)(8676002)(53546011)(38100700002)(66946007)(7416002)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?S0k1anh3Q0huYmptelFkcG9vOXBiRGZaNzNsandNQTNzNWN1b285eEZMOFJI?= =?utf-8?B?T3FrN3lCYWluenlaMjBKTGtQUHN5akxwaG5kS0diN1FyaGxhc1U4WkliV3hl?= =?utf-8?B?NDR4Z3JLSTE0a2xoc0dTbi9kcC9WanpwaktTOTJHMmhTcnMyVnFDUW5yaExj?= =?utf-8?B?WUhtbmRNclVRU21iMVVaRHl2a09nd0FtU3lTT0VSQ1ZnanBGNjk3R05LZXIv?= =?utf-8?B?d0I2akRLdERJSFJYWEVDSHhlVnJKUzhlTWV0ejRTdmZwT1FDQXN4M3Q2Y1Vi?=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h4QkdjSUpZY2lBOEllK25E?= =?utf-8?B?dklhTkV6M2cvYVV2VWdsZnduWVNCR1FxcjVyTFluRy9LQ24vbUwxQUQrNkZ0?= =?utf-8?B?dmxuM1VFUDVzMkFYNUtCRDQvaWY3d0lFV1Q3VnFCTnZvZzdiaU5yQ001K29n?= =?utf-8?B?aHQ0bTk1R3NjMFFhVnRaMUJPa05scEYrVnYwWGZZQ091Yk9ENjM0LzREd0c4?= =?utf-8?B?V1NTMXVaYUsrZ29kSUtPQ1Jac3lqU01QRWJ5cUdZcm5JWW4weFgvUVVTcjh5?= =?utf-8?B?SnkzZmdtZWx5TUZkTVVjbzJMOEFqWE1pUE00WVc1WkJ2ZVNnMGF6ampURDlK?= =?utf-8?B?SjgzUUNGVE54MTZWdWh0aTZibnF4Vk9sZ3VBZ0F2ckcyeENMQkdtbWNleTVu?= =?utf-8?B?aG4zWSsvNGJtdGFvSWRLRE50a0FPcVkrVERRRVRxR1gySVduQ0d2bGxURG9I?= =?utf-8?B?VDFFdDdsYTFrS3V3ckRROC9pUDN3dE44UForYXFXNW9UNXIvNi9BRkhENmJx?= =?utf-8?B?b3BPQW4wMmtkRVlyak5iRXpFdzZWTHVEbEl2Y29Xdzl0bG0yanA4UUxVellI?= =?utf-8?Q?t9mpRNl+JL8iJ9mrbHikSzdYMcRvB0cVxhiZ1og?= X-MS-Exchange-CrossTenant-Network-Message-Id: 5be6e47c-6026-4a58-017a-08d96eed845f X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB5055.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Sep 2021 15:14:25.8451 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Rug/46RGbvv0qZG+PZqP9dRocmx6GoHXH7hgGc4gsGXcOtzUeJyAhH9I/Y/eFwx08gy9Y4In4pP1Sfks3zIxrQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4941 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v19 7/7] app/test: add dmadev API test X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" On 02/09/2021 14:13, Chengwen Feng wrote: > This patch add dmadev API test which based on 'dma_skeleton' vdev. The > test cases could be executed using 'dmadev_autotest' command in test > framework. > > Signed-off-by: Chengwen Feng > Signed-off-by: Bruce Richardson > --- > MAINTAINERS | 1 + > app/test/meson.build | 4 + > app/test/test_dmadev.c | 45 ++++ > app/test/test_dmadev_api.c | 532 +++++++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 582 insertions(+) > create mode 100644 app/test/test_dmadev.c > create mode 100644 app/test/test_dmadev_api.c > > + > +REGISTER_TEST_COMMAND(dmadev_autotest, test_dmadev); > diff --git a/app/test/test_dmadev_api.c b/app/test/test_dmadev_api.c > new file mode 100644 > index 0000000..a7795eb > --- /dev/null > +++ b/app/test/test_dmadev_api.c > @@ -0,0 +1,532 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(c) 2021 HiSilicon Limited. > + */ > + > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > + > +extern int test_dmadev_api(uint16_t dev_id); > + > +#define SKELDMA_TEST_RUN(test) \ > + testsuite_run_test(test, #test) > + > +#define TEST_MEMCPY_SIZE 1024 > +#define TEST_WAIT_US_VAL 50000 > + > +#define TEST_SUCCESS 0 > +#define TEST_FAILED -1 > + > +static uint16_t test_dev_id; > +static uint16_t invalid_dev_id; > + > +static int total; > +static int passed; > +static int failed; > +static char *src; > +static char *dst; > + > +static int > +testsuite_setup(uint16_t dev_id) > +{ > + test_dev_id = dev_id; > + invalid_dev_id = RTE_DMADEV_MAX_DEVS; > + > + src = rte_malloc("dmadev_test_src", TEST_MEMCPY_SIZE, 0); > + if (src == NULL) > + return -ENOMEM; > + dst = rte_malloc("dmadev_test_dst", TEST_MEMCPY_SIZE, 0); > + if (dst == NULL) > + return -ENOMEM; > + > + total = 0; > + passed = 0; > + failed = 0; > + > + return 0; > +} > + > +static void > +testsuite_teardown(void) > +{ > + rte_free(src); > + rte_free(dst); These should be set to NULL after free. > + /* Ensure the dmadev is stopped. */ > + rte_dmadev_stop(test_dev_id); > +} > + > + > +int > +test_dmadev_api(uint16_t dev_id) > +{ > + int ret = testsuite_setup(dev_id); > + if (ret) { If testsuite setup fails, src/dst potentially need to be free'd, so "testsuite_teardown()" should be called here. > + printf("testsuite setup fail!\n"); > + return -1; > + } > + > + /* If the testcase exit successfully, ensure that the test dmadev exist > + * and the dmadev is in the stopped state. > + */ > + SKELDMA_TEST_RUN(test_dmadev_get_dev_id); > + SKELDMA_TEST_RUN(test_dmadev_is_valid_dev); > + SKELDMA_TEST_RUN(test_dmadev_count); > + SKELDMA_TEST_RUN(test_dmadev_info_get); > + SKELDMA_TEST_RUN(test_dmadev_configure); > + SKELDMA_TEST_RUN(test_dmadev_vchan_setup); > + SKELDMA_TEST_RUN(test_dmadev_start_stop); > + SKELDMA_TEST_RUN(test_dmadev_stats); > + SKELDMA_TEST_RUN(test_dmadev_dump); > + SKELDMA_TEST_RUN(test_dmadev_completed); > + SKELDMA_TEST_RUN(test_dmadev_completed_status); > + > + testsuite_teardown(); > + > + printf("Total tests : %d\n", total); > + printf("Passed : %d\n", passed); > + printf("Failed : %d\n", failed); > + > + if (failed) > + return -1; > + > + return 0; > +}; With the above comments addressed, Reviewed-by: Kevin Laatz