Skip to content

Commit

Permalink
ethdev: fix port state when stop
Browse files Browse the repository at this point in the history
[ upstream commit 74b7426 ]

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: 62024eb ("ethdev: change stop operation callback to return int")

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
  • Loading branch information
hushenggitcount authored and steevenlee committed Jun 20, 2022
1 parent 89f5496 commit d096c59
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/librte_ethdev/rte_ethdev.c
Expand Up @@ -1785,8 +1785,9 @@ rte_eth_dev_stop(uint16_t port_id)
return 0;
}

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;
Expand Down

0 comments on commit d096c59

Please sign in to comment.