[dpdk-dev] [PATCH 04/11] examples: check eth dev stop status
Ferruh Yigit
ferruh.yigit at intel.com
Wed Oct 14 19:38:34 CEST 2020
On 10/14/2020 2:28 PM, Andrew Rybchenko wrote:
> From: Ivan Ilchenko <Ivan.Ilchenko at oktetlabs.ru>
>
> rte_eth_dev_stop() return value was changed from void to int,
> so this patch modify usage of this function across examples
> according to new return type.
>
> Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko at oktetlabs.ru>
> Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
<...>
> diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
> index 7e3078788e..8d6c7ec237 100644
> --- a/examples/l2fwd/main.c
> +++ b/examples/l2fwd/main.c
> @@ -896,7 +896,10 @@ main(int argc, char **argv)
> if ((l2fwd_enabled_port_mask & (1 << portid)) == 0)
> continue;
> printf("Closing port %d...", portid);
> - rte_eth_dev_stop(portid);
> + ret = rte_eth_dev_stop(portid);
> + if (ret != 0)
> + rte_exit(EXIT_FAILURE, "rte_eth_dev_stop: err=%d, port=%d\n",
> + ret, portid);
Same comment here, not sure if exiting on stop error and break freeing resources
is better thing to do?
Overall, for the whole set, unless the focus is in the 'stop', like testing it,
what do you think log the error and ignore it?
More information about the dev
mailing list