On Fri, Apr 14, 2017 at 02:36:45PM +0800, Yuanhan Liu wrote:
> The virtio port link status will always be UP, even the port is stopped:
>
> testpmd> port stop 0
> Stopping ports...
> Checking link statuses...
> Port 0 Link Up - speed 10000 Mbps - full-duplex
> Done
>
> The link status is queried by link_update callback when LSC is disabled.
> Which in turn queries the "status" field. However, the "status" is
> read-only. I couldn't think of some proper ways to change the status
> without doing device reset.
>
> Instead of doing (the heavy) reset at stop, this patch introduced a flag,
> which is set to 1 and 0 on start and stop, respectively. When it's set to
> 0, the link status is set to DOWN unconditionally.
>
> Fixes: a85786dc816f ("virtio: fix states handling during initialization")
>
> Cc: [email protected]
> Signed-off-by: Yuanhan Liu <[email protected]>
Applied to dpdk-next-virtio.
--yliu