From: Min Hu (Connor) Date: Tue, 3 May 2022 10:02:17 +0000 (+0800) Subject: ethdev: fix port state when stop X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=74b74269978c2790bc49238029e00b7c6e81c450;p=dpdk.git ethdev: fix port state when stop Currently, 'dev_started' is always set to be 0 when dev stop, whether it succeeded or failed. This is unreasonable and this patch fixed it. Fixes: 62024eb82756 ("ethdev: change stop operation callback to return int") Cc: stable@dpdk.org Signed-off-by: Min Hu (Connor) Acked-by: Thomas Monjalon Acked-by: Ferruh Yigit --- diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index a175867651..fe64f8d39d 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -1533,8 +1533,9 @@ rte_eth_dev_stop(uint16_t port_id) /* point fast-path functions to dummy ones */ eth_dev_fp_ops_reset(rte_eth_fp_ops + port_id); - dev->data->dev_started = 0; ret = (*dev->dev_ops->dev_stop)(dev); + if (ret == 0) + dev->data->dev_started = 0; rte_ethdev_trace_stop(port_id, ret); return ret;