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 6B243A0C4D; Fri, 3 Sep 2021 02:39:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D90E240041; Fri, 3 Sep 2021 02:39:44 +0200 (CEST) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by mails.dpdk.org (Postfix) with ESMTP id 0A2444003E for ; Fri, 3 Sep 2021 02:39:42 +0200 (CEST) Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4H0zSH5rtpz1DGKv; Fri, 3 Sep 2021 08:38:55 +0800 (CST) Received: from dggpeml500024.china.huawei.com (7.185.36.10) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 3 Sep 2021 08:39:39 +0800 Received: from [10.40.190.165] (10.40.190.165) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 3 Sep 2021 08:39:38 +0800 To: "Walsh, Conor" , "thomas@monjalon.net" , "Yigit, Ferruh" , "Richardson, Bruce" , "jerinj@marvell.com" , "jerinjacobk@gmail.com" , "andrew.rybchenko@oktetlabs.ru" CC: "dev@dpdk.org" , "mb@smartsharesystems.com" , "nipun.gupta@nxp.com" , "hemant.agrawal@nxp.com" , "maxime.coquelin@redhat.com" , "honnappa.nagarahalli@arm.com" , "david.marchand@redhat.com" , "sburla@marvell.com" , "pkapoor@marvell.com" , "Ananyev, Konstantin" , "Laatz, Kevin" 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: fengchengwen Message-ID: <21ebd68c-894b-5537-dbb8-06ecf550c563@huawei.com> Date: Fri, 3 Sep 2021 08:39:38 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.40.190.165] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected 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" This is a tradeoff point. If we changed the log level of dmadev, it is difficult to know where the test case fails. So I prefer add more meaningful information, at least print out the function name. And V19 add format function name in log default, so the rte_dmadev's log will show like: rte_dmadev_configure(): Invalid dev_id=64 rte_dmadev_configure(): Device 4 configure zero vchans rte_dmadev_configure(): Device 4 configure too many vchans rte_dmadev_configure(): Device 4 don't support silent test_dmadev_configure Passed rte_dmadev_vchan_setup(): Invalid dev_id=64 rte_dmadev_vchan_setup(): Device 4 number of descriptors invalid rte_dmadev_vchan_setup(): Device 4 vchan out range! rte_dmadev_vchan_setup(): Device 4 direction invalid! rte_dmadev_vchan_setup(): Device 4 direction invalid! rte_dmadev_vchan_setup(): Device 4 don't support mem2dev transfer rte_dmadev_vchan_setup(): Device 4 don't support dev2mem transfer rte_dmadev_vchan_setup(): Device 4 don't support dev2dev transfer rte_dmadev_vchan_setup(): Device 4 number of descriptors invalid rte_dmadev_vchan_setup(): Device 4 number of descriptors invalid rte_dmadev_vchan_setup(): Device 4 source port type invalid rte_dmadev_vchan_setup(): Device 4 destination port type invalid On 2021/9/2 22:11, Walsh, Conor wrote: > Hi Chengwen, > > The output from the API tests is not very straightforward to interpret if you are not familiar with these tests. > Could we change the log level of the dmadev library before and after the API tests using something similar to > The code I have included inline below? > >> +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; > > /* Set dmadev log level to critical to suppress unnecessary output during API tests. */ > rte_log_set_level_pattern("lib.dmadev", RTE_LOG_CRIT); >> + >> + total = 0; >> + passed = 0; >> + failed = 0; >> + >> + return 0; >> +} >> + >> +static void >> +testsuite_teardown(void) >> +{ >> + rte_free(src); >> + rte_free(dst); >> + /* Ensure the dmadev is stopped. */ >> + rte_dmadev_stop(test_dev_id); > rte_log_set_level_pattern("lib.dmadev", RTE_LOG_INFO); >> +} > > This change would bring your output down from: > > ### Test dmadev infrastructure using skeleton driver > test_dmadev_get_dev_id Passed > test_dmadev_is_valid_dev Passed > test_dmadev_count Passed > Invalid dev_id=64 > test_dmadev_info_get Passed > Invalid dev_id=64 > Device 1 configure zero vchans > Device 1 configure too many vchans > Device 1 don't support silent > test_dmadev_configure Passed > Invalid dev_id=64 > Device 1 number of descriptors invalid > Device 1 vchan out range! > Device 1 direction invalid! > Device 1 direction invalid! > Device 1 don't support mem2dev transfer > Device 1 don't support dev2mem transfer > Device 1 don't support dev2dev transfer > Device 1 number of descriptors invalid > Device 1 number of descriptors invalid > Device 1 source port type invalid > Device 1 destination port type invalid > test_dmadev_vchan_setup Passed > Invalid dev_id=64 > Invalid dev_id=64 > Device 1 must be stopped to allow configuration > Device 1 must be stopped to allow configuration > test_dmadev_start_stop Passed > Invalid dev_id=64 > Invalid dev_id=64 > Invalid dev_id=64 > Device 1 vchan 1 out of range > Device 1 vchan 1 out of range > test_dmadev_stats Passed > test_dmadev_completed Passed > test_dmadev_completed_status Passed > Device 1 already stopped > Total tests : 10 > Passed : 10 > Failed : 0 > skeldma_remove(): Remove dma_skeleton dmadev > > To: > > ### Test dmadev infrastructure using skeleton driver > test_dmadev_get_dev_id Passed > test_dmadev_is_valid_dev Passed > test_dmadev_count Passed > test_dmadev_info_get Passed > test_dmadev_configure Passed > test_dmadev_vchan_setup Passed > test_dmadev_start_stop Passed > test_dmadev_stats Passed > test_dmadev_completed Passed > test_dmadev_completed_status Passed > Total tests : 10 > Passed : 10 > Failed : 0 > skeldma_remove(): Remove dma_skeleton dmadev > > Thanks, > Conor. > . >