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 26115A04DB; Wed, 14 Oct 2020 19:34:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EE7721D938; Wed, 14 Oct 2020 19:34:50 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 9A94D1E34 for ; Wed, 14 Oct 2020 19:34:48 +0200 (CEST) IronPort-SDR: yl+M4OzBqYhnnGUPXNv8gD21+inpb2ucsPDXnerFA+7x3dxiAHRoqlzhkuedoIDAN2ZYJELBeX FmUvL8X/GEVg== X-IronPort-AV: E=McAfee;i="6000,8403,9774"; a="227794075" X-IronPort-AV: E=Sophos;i="5.77,375,1596524400"; d="scan'208";a="227794075" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2020 10:34:47 -0700 IronPort-SDR: nvw21H2T6BWrlAcwwmierX28DzgLqZCNEmdS3yZACxPICsac3FLEqGUEjb4o8A9WV4I8mGbRl+ bXWO57iz40+g== X-IronPort-AV: E=Sophos;i="5.77,375,1596524400"; d="scan'208";a="463963819" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.212.224]) ([10.213.212.224]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2020 10:34:46 -0700 To: Andrew Rybchenko , Bruce Richardson Cc: dev@dpdk.org, Ivan Ilchenko References: <1602682146-4722-1-git-send-email-arybchenko@solarflare.com> <1602682146-4722-4-git-send-email-arybchenko@solarflare.com> From: Ferruh Yigit Message-ID: Date: Wed, 14 Oct 2020 18:34:42 +0100 MIME-Version: 1.0 In-Reply-To: <1602682146-4722-4-git-send-email-arybchenko@solarflare.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 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" On 10/14/2020 2:28 PM, Andrew Rybchenko wrote: > 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 | 6 +++++- > app/test/test_pmd_ring.c | 13 ++++++++++--- > app/test/test_pmd_ring_perf.c | 3 ++- > 3 files changed, 17 insertions(+), 5 deletions(-) > > diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c > index d1240b76f9..85c932c6dc 100644 > --- a/app/test/test_pmd_perf.c > +++ b/app/test/test_pmd_perf.c > @@ -802,7 +802,11 @@ 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) > + rte_exit(EXIT_FAILURE, > + "rte_eth_dev_stop: err=%s, port=%d\n", > + rte_strerror(-ret), portid); This is in tear down, not sure if the app should exit on the stopping port error, what do you think just log the error and continue? > } > > return 0; > diff --git a/app/test/test_pmd_ring.c b/app/test/test_pmd_ring.c > index 02873f26a1..b7af8f4b70 100644 > --- a/app/test/test_pmd_ring.c > +++ b/app/test/test_pmd_ring.c > @@ -412,8 +412,14 @@ test_pmd_ring_pair_create_attach(void) > return TEST_FAILED; > } > > - rte_eth_dev_stop(rxtx_portd); > - rte_eth_dev_stop(rxtx_porte); > + if (rte_eth_dev_stop(rxtx_portd) != 0) { > + printf("Error: failed to stop port %u\n", rxtx_portd); > + return TEST_FAILED; > + } > + if (rte_eth_dev_stop(rxtx_porte) != 0) { > + printf("Error: failed to stop port %u\n", rxtx_porte); > + return TEST_FAILED; > + } > > return TEST_SUCCESS; > } > @@ -522,7 +528,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; Same here.