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 3FF68A04DB; Thu, 15 Oct 2020 15:31:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 338911E93A; Thu, 15 Oct 2020 15:31:19 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 50ABD1DB95 for ; Thu, 15 Oct 2020 15:31:15 +0200 (CEST) Received: from mx1-us1.ppe-hosted.com (unknown [10.7.65.61]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id D26E66010C; Thu, 15 Oct 2020 13:31:13 +0000 (UTC) Received: from us4-mdac16-25.ut7.mdlocal (unknown [10.7.65.251]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id D02F48009E; Thu, 15 Oct 2020 13:31:13 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.7.65.174]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 4CA4780056; Thu, 15 Oct 2020 13:31:13 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 035721C0075; Thu, 15 Oct 2020 13:31:13 +0000 (UTC) Received: from ukex01.SolarFlarecom.com (10.17.10.4) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 15 Oct 2020 14:31:10 +0100 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 15 Oct 2020 14:31:10 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id 09FDVAST025329; Thu, 15 Oct 2020 14:31:10 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 254D61613AB; Thu, 15 Oct 2020 14:31:10 +0100 (BST) From: Andrew Rybchenko To: Bruce Richardson CC: , Ivan Ilchenko Date: Thu, 15 Oct 2020 14:30:37 +0100 Message-ID: <1602768646-13142-4-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602768646-13142-1-git-send-email-arybchenko@solarflare.com> References: <1602682146-4722-1-git-send-email-arybchenko@solarflare.com> <1602768646-13142-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.6.1012-25726.003 X-TM-AS-Result: No-0.220400-8.000000-10 X-TMASE-MatchedRID: cxaTYRzWUivRlxaUc/KTYX4neC0h7SAD3V4UShoTXac7FE26mju9OwZe An7ANE0ajjj7xmhW6vgQlFkmdk3VOiHhSBQfglfsA9lly13c/gH4uJ1REX4MHZGPHiE2kiT4j78 +1uscT5Ju/A0s2g7iweXlACu2VS9IT12Hc9FhVjXN+qWlu2ZxaEqAhuLHn5fEHdFjikZMLIfyRo rK+6u50HZBhkSPpjEIfjWeJX0rKbMfE8yM4pjsDwtuKBGekqUpnH7sbImOEBSbzHW1GVx//IuK2 CVAsIH2NTgkL6fh/UKvHUw64Uve/hbOH23VY+TKKtotNzrv3DJRs3O4K6IxktaQLCvu0vIcn0u7 ZyYPExrkA8OrYHdwDGfYlY/yoV/0Up6EHOb2+c7kHZDO53QSwmA7bUFBqh2V X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--0.220400-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25726.003 X-MDID: 1602768673-bAIS30Pvc8PO X-PPE-DISP: 1602768673;bAIS30Pvc8PO Subject: [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" 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)); 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); -- 2.17.1