From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A8A33A04DB; Fri, 16 Oct 2020 03:28:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 897911E85F; Fri, 16 Oct 2020 03:28:33 +0200 (CEST) Received: from huawei.com (szxga06-in.huawei.com [45.249.212.32]) by dpdk.org (Postfix) with ESMTP id 3E0BE1E85D for ; Fri, 16 Oct 2020 03:28:31 +0200 (CEST) Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 32F0697BD09B5D601192 for ; Fri, 16 Oct 2020 09:28:29 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Fri, 16 Oct 2020 09:28:25 +0800 To: References: <1602682146-4722-1-git-send-email-arybchenko@solarflare.com> <1602768646-13142-1-git-send-email-arybchenko@solarflare.com> <1602768646-13142-4-git-send-email-arybchenko@solarflare.com> From: "Min Hu (Connor)" Message-ID: <47c4361e-fc88-4547-0290-ad8699f54cb7@huawei.com> Date: Fri, 16 Oct 2020 09:28:26 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <1602768646-13142-4-git-send-email-arybchenko@solarflare.com> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH v2 03/11] app: check eth dev stop status 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" ÔÚ 2020/10/15 21:30, Andrew Rybchenko дµÀ: > From: Ivan Ilchenko > > rte_eth_dev_stop() return value was changed from void to int, > so this patch modify usage of this function across app > according to new return type. > > Signed-off-by: Ivan Ilchenko > Signed-off-by: Andrew Rybchenko > --- > app/test/test_pmd_perf.c | 5 ++++- > app/test/test_pmd_ring.c | 31 ++++++++++++++++++++++++------- > app/test/test_pmd_ring_perf.c | 3 ++- > 3 files changed, 30 insertions(+), 9 deletions(-) > > diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c > index d1240b76f9..49a805c1e0 100644 > --- a/app/test/test_pmd_perf.c > +++ b/app/test/test_pmd_perf.c > @@ -802,7 +802,10 @@ test_pmd_perf(void) > if (socketid != rte_eth_dev_socket_id(portid)) > continue; > > - rte_eth_dev_stop(portid); > + ret = rte_eth_dev_stop(portid); > + if (ret != 0) > + printf("rte_eth_dev_stop: err=%s, port=%u\n", > + rte_strerror(-ret), portid); > } > > return 0; > diff --git a/app/test/test_pmd_ring.c b/app/test/test_pmd_ring.c > index 02873f26a1..86b1db2c1f 100644 > --- a/app/test/test_pmd_ring.c > +++ b/app/test/test_pmd_ring.c > @@ -225,6 +225,7 @@ test_pmd_ring_pair_create_attach(void) > struct rte_eth_stats stats, stats2; > struct rte_mbuf buf, *pbuf = &buf; > struct rte_eth_conf null_conf; > + int ret; > > memset(&null_conf, 0, sizeof(struct rte_eth_conf)); > > @@ -412,8 +413,14 @@ test_pmd_ring_pair_create_attach(void) > return TEST_FAILED; > } > > - rte_eth_dev_stop(rxtx_portd); > - rte_eth_dev_stop(rxtx_porte); > + ret = rte_eth_dev_stop(rxtx_portd); > + if (ret != 0) > + printf("Error: failed to stop port %u: %s\n", > + rxtx_portd, rte_strerror(-ret)); > + ret = rte_eth_dev_stop(rxtx_porte); > + if (ret != 0) > + printf("Error: failed to stop port %u: %s\n", > + rxtx_porte, rte_strerror(-ret)); Could you please show all possible return value of the rte_eth_dev_stop? Here is "if (ret != 0)", but in patch" [PATCH v2] net/failsafe: check eth dev stop status",it write: + ret = rte_eth_dev_stop(PORT_ID(sdev)); + if (ret < 0) + ERROR("Failed to stop sub-device %u", SUB_ID(sdev)); Could the two be consistent? thanks. > return TEST_SUCCESS; > } > @@ -421,13 +428,22 @@ test_pmd_ring_pair_create_attach(void) > static void > test_cleanup_resources(void) > { > - int itr; > + int itr, ret; > for (itr = 0; itr < NUM_RINGS; itr++) > rte_ring_free(rxtx[itr]); > > - rte_eth_dev_stop(tx_porta); > - rte_eth_dev_stop(rx_portb); > - rte_eth_dev_stop(rxtx_portc); > + ret = rte_eth_dev_stop(tx_porta); > + if (ret != 0) > + printf("Error: failed to stop port %u: %s\n", > + tx_porta, rte_strerror(-ret)); > + ret = rte_eth_dev_stop(rx_portb); > + if (ret != 0) > + printf("Error: failed to stop port %u: %s\n", > + rx_portb, rte_strerror(-ret)); > + ret = rte_eth_dev_stop(rxtx_portc); > + if (ret != 0) > + printf("Error: failed to stop port %u: %s\n", > + rxtx_portc, rte_strerror(-ret)); > > rte_mempool_free(mp); > rte_vdev_uninit("net_ring_net_ringa"); > @@ -522,7 +538,8 @@ test_command_line_ring_port(void) > "test stats reset cmdl_port0 is failed"); > TEST_ASSERT((test_get_stats(cmdl_port0) < 0), > "test get stats cmdl_port0 is failed"); > - rte_eth_dev_stop(cmdl_port0); > + TEST_ASSERT((rte_eth_dev_stop(cmdl_port0) == 0), > + "test stop cmdl_port0 is failed"); > } > return TEST_SUCCESS; > } > diff --git a/app/test/test_pmd_ring_perf.c b/app/test/test_pmd_ring_perf.c > index 3b2ff9cb4f..d249b7de5f 100644 > --- a/app/test/test_pmd_ring_perf.c > +++ b/app/test/test_pmd_ring_perf.c > @@ -155,7 +155,8 @@ test_ring_pmd_perf(void) > test_bulk_enqueue_dequeue(); > > /* release port and ring resources */ > - rte_eth_dev_stop(ring_ethdev_port); > + if (rte_eth_dev_stop(ring_ethdev_port) != 0) > + return -1; > rte_eth_dev_get_name_by_port(ring_ethdev_port, name); > rte_vdev_uninit(name); > rte_ring_free(r); >