From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 3C15F41C9A;
	Wed, 15 Feb 2023 02:26:07 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id E887140EE1;
	Wed, 15 Feb 2023 02:26:06 +0100 (CET)
Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188])
 by mails.dpdk.org (Postfix) with ESMTP id F0B8640ED6
 for <dev@dpdk.org>; Wed, 15 Feb 2023 02:26:05 +0100 (CET)
Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.56])
 by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4PGgMy4MytzJsTN;
 Wed, 15 Feb 2023 09:24:14 +0800 (CST)
Received: from [10.67.100.224] (10.67.100.224) 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.2507.17; Wed, 15 Feb 2023 09:26:01 +0800
Subject: Re: [PATCH v2 4/6] test/dmadev: check result for device stop
To: Bruce Richardson <bruce.richardson@intel.com>, <dev@dpdk.org>
CC: Kevin Laatz <kevin.laatz@intel.com>, David Marchand
 <david.marchand@redhat.com>
References: <20230116153714.554470-1-bruce.richardson@intel.com>
 <20230116173738.562322-1-bruce.richardson@intel.com>
 <20230116173738.562322-5-bruce.richardson@intel.com>
From: fengchengwen <fengchengwen@huawei.com>
Message-ID: <48d0d433-a054-fae7-7b32-e7f4d0cba236@huawei.com>
Date: Wed, 15 Feb 2023 09:26:01 +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: <20230116173738.562322-5-bruce.richardson@intel.com>
Content-Type: text/plain; charset="utf-8"
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Originating-IP: [10.67.100.224]
X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To
 dggpeml500024.china.huawei.com (7.185.36.10)
X-CFilter-Loop: Reflected
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

Sorry late to see.

On 2023/1/17 1:37, Bruce Richardson wrote:
> The DMA device stop API can return an error value so check that return
> value when running dmadev unit tests.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  app/test/test_dmadev.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/app/test/test_dmadev.c b/app/test/test_dmadev.c
> index fe62e98af8..4e1dbcaa19 100644
> --- a/app/test/test_dmadev.c
> +++ b/app/test/test_dmadev.c
> @@ -837,7 +837,11 @@ test_dmadev_instance(int16_t dev_id)
>  		goto err;
>  
>  	rte_mempool_free(pool);
> -	rte_dma_stop(dev_id);
> +
> +	if (rte_dma_stop(dev_id) < 0) {
> +		rte_mempool_free(pool);

The pool already freed in above.
I think just add ERR_RETURN here.

> +		ERR_RETURN("Error stopping device %u\n", dev_id);
> +	}
>  	rte_dma_stats_reset(dev_id, vchan);
>  	return 0;
>  
>