From: "Min Hu (Connor)" <humin29@huawei.com>
To: <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2 03/11] app: check eth dev stop status
Date: Fri, 16 Oct 2020 09:28:26 +0800 [thread overview]
Message-ID: <47c4361e-fc88-4547-0290-ad8699f54cb7@huawei.com> (raw)
In-Reply-To: <1602768646-13142-4-git-send-email-arybchenko@solarflare.com>
在 2020/10/15 21:30, Andrew Rybchenko 写道:
> From: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
>
> 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 <ivan.ilchenko@oktetlabs.ru>
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> ---
> 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);
>
next prev parent reply other threads:[~2020-10-16 1:28 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-14 13:28 [dpdk-dev] [PATCH 00/11] ethdev: change device stop to return status Andrew Rybchenko
2020-10-14 13:28 ` [dpdk-dev] [PATCH 01/11] ethdev: change eth dev stop function to return int Andrew Rybchenko
2020-10-14 13:33 ` Thomas Monjalon
2020-10-14 13:40 ` Andrew Rybchenko
2020-10-14 17:29 ` Ferruh Yigit
2020-10-14 13:28 ` [dpdk-dev] [PATCH 02/11] test/event: check eth dev stop status Andrew Rybchenko
2020-10-14 13:28 ` [dpdk-dev] [PATCH 03/11] app: " Andrew Rybchenko
2020-10-14 17:34 ` Ferruh Yigit
2020-10-14 13:28 ` [dpdk-dev] [PATCH 04/11] examples: " Andrew Rybchenko
2020-10-14 17:38 ` Ferruh Yigit
2020-10-14 13:29 ` [dpdk-dev] [PATCH 05/11] net/bonding: " Andrew Rybchenko
2020-10-14 17:45 ` Ferruh Yigit
2020-10-14 13:29 ` [dpdk-dev] [PATCH 06/11] kni: " Andrew Rybchenko
2020-10-14 13:29 ` [dpdk-dev] [PATCH 07/11] test/bonding: " Andrew Rybchenko
2020-10-14 13:29 ` [dpdk-dev] [PATCH 08/11] app/flow-perf: " Andrew Rybchenko
2020-10-15 8:04 ` Wisam Monther
2020-10-14 13:29 ` [dpdk-dev] [PATCH 09/11] app/testpmd: " Andrew Rybchenko
2020-10-14 13:29 ` [dpdk-dev] [PATCH 10/11] net/failsafe: " Andrew Rybchenko
2020-10-15 10:37 ` [dpdk-dev] [PATCH v2] " Gaetan Rivet
2020-10-14 13:29 ` [dpdk-dev] [PATCH 11/11] ethdev: change stop device callback to return int Andrew Rybchenko
2020-10-14 18:08 ` Ferruh Yigit
2020-10-15 10:40 ` Gaëtan Rivet
2020-10-15 13:30 ` [dpdk-dev] [PATCH v2 00/11] ethdev: change device stop to return status Andrew Rybchenko
2020-10-15 13:30 ` [dpdk-dev] [PATCH v2 01/11] ethdev: change eth dev stop function to return int Andrew Rybchenko
2020-10-16 9:22 ` Ferruh Yigit
2020-10-16 11:20 ` Kinsella, Ray
2020-10-16 17:13 ` Andrew Rybchenko
2020-10-19 9:37 ` Kinsella, Ray
2020-10-16 16:20 ` Ferruh Yigit
2020-10-15 13:30 ` [dpdk-dev] [PATCH v2 02/11] test/event: check eth dev stop status Andrew Rybchenko
2020-10-15 13:30 ` [dpdk-dev] [PATCH v2 03/11] app: " Andrew Rybchenko
2020-10-16 1:28 ` Min Hu (Connor) [this message]
2020-10-15 13:30 ` [dpdk-dev] [PATCH v2 04/11] examples: " Andrew Rybchenko
2020-10-15 13:30 ` [dpdk-dev] [PATCH v2 05/11] net/bonding: " Andrew Rybchenko
2020-10-15 13:30 ` [dpdk-dev] [PATCH v2 06/11] kni: " Andrew Rybchenko
2020-10-15 13:30 ` [dpdk-dev] [PATCH v2 07/11] test/bonding: " Andrew Rybchenko
2020-10-15 13:30 ` [dpdk-dev] [PATCH v2 08/11] app/flow-perf: " Andrew Rybchenko
2020-10-15 13:30 ` [dpdk-dev] [PATCH v2 09/11] app/testpmd: " Andrew Rybchenko
2020-10-15 13:30 ` [dpdk-dev] [PATCH v2 10/11] net/failsafe: " Andrew Rybchenko
2020-10-15 13:30 ` [dpdk-dev] [PATCH v2 11/11] ethdev: change stop device callback to return int Andrew Rybchenko
2020-10-16 18:37 ` Ferruh Yigit
2020-10-18 8:55 ` Xu, Rosen
2020-10-16 18:54 ` [dpdk-dev] [PATCH v2 00/11] ethdev: change device stop to return status Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47c4361e-fc88-4547-0290-ad8699f54cb7@huawei.com \
--to=humin29@huawei.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).