summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJianfeng Tan <jianfeng.tan@intel.com>2017-04-27 07:35:39 +0000
committerYuanhan Liu <yuanhan.liu@linux.intel.com>2017-04-28 07:01:22 +0200
commit58d9fe4000ee918b1d7f0260191349dd2f13ef02 (patch)
tree8470df2ce6cc8d349638379b6ae98797b4a0e603
parentee1843bd89076c59e50cadbef5c935613f543765 (diff)
downloaddpdk-stable-58d9fe4000ee918b1d7f0260191349dd2f13ef02.zip
dpdk-stable-58d9fe4000ee918b1d7f0260191349dd2f13ef02.tar.gz
dpdk-stable-58d9fe4000ee918b1d7f0260191349dd2f13ef02.tar.xz
net/virtio: fix link status always down
The virtio port link status will always be DOWN: The commit aa9f06061765 ("net/virtio: fix link status always being up") introduces a flag to help checking the status. If this flag is not set, status will be always down. However, in dev start, this flag is set after link status update, then we miss the chance to change the status to UP in dev start. To fix this bug, we simply move the link status update after the flag setting so that the status can be correctly updated. Fixes: aa9f06061765 ("net/virtio: fix link status always being up") Cc: stable@dpdk.org Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com> Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
-rw-r--r--drivers/net/virtio/virtio_ethdev.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index e79748e..cd87c0e 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1742,9 +1742,6 @@ virtio_dev_start(struct rte_eth_dev *dev)
}
}
- /* Initialize Link state */
- virtio_dev_link_update(dev, 0);
-
/*Notify the backend
*Otherwise the tap backend might already stop its queue due to fullness.
*vhost backend will have no chance to be waked up
@@ -1773,8 +1770,12 @@ virtio_dev_start(struct rte_eth_dev *dev)
txvq = dev->data->tx_queues[i];
VIRTQUEUE_DUMP(txvq->vq);
}
+
hw->started = 1;
+ /* Initialize Link state */
+ virtio_dev_link_update(dev, 0);
+
return 0;
}