DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jianfeng Tan <jianfeng.tan@intel.com>
To: dev@dpdk.org
Cc: yuanhan.liu@linux.intel.com, maxime.coquelin@redhat.com,
	thomas@monjalon.net, Jianfeng Tan <jianfeng.tan@intel.com>,
	stable@dpdk.org
Subject: [dpdk-dev] [PATCH v2 4/4] net/virtio: fix link status always being down
Date: Thu, 27 Apr 2017 07:35:39 +0000	[thread overview]
Message-ID: <1493278539-44617-5-git-send-email-jianfeng.tan@intel.com> (raw)
In-Reply-To: <1493278539-44617-1-git-send-email-jianfeng.tan@intel.com>

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>
---
 drivers/net/virtio/virtio_ethdev.c | 7 ++++---
 1 file 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;
 }
 
-- 
2.7.4

  parent reply	other threads:[~2017-04-27  7:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-26  4:52 [dpdk-dev] [PATCH 0/3] Some fixes on virtio LSC Jianfeng Tan
2017-04-26  4:52 ` [dpdk-dev] [PATCH 1/3] net/virtio: fix wrong MSI-X for modern devices Jianfeng Tan
2017-04-26  4:52 ` [dpdk-dev] [PATCH 2/3] net/virtio: clean up LSC setting Jianfeng Tan
2017-04-26  5:32   ` Yuanhan Liu
2017-04-26  5:44     ` Tan, Jianfeng
2017-04-26  5:52       ` Yuanhan Liu
2017-04-26  6:00         ` Tan, Jianfeng
2017-04-26 15:11       ` Michael S. Tsirkin
2017-04-27  7:34         ` Tan, Jianfeng
2017-04-26  4:52 ` [dpdk-dev] [PATCH 3/3] net/virtio: fix link status always being down Jianfeng Tan
2017-04-27  7:35 ` [dpdk-dev] [PATCH v2 0/4] fixes and cleanup on virtio LSC Jianfeng Tan
2017-04-27  7:35   ` [dpdk-dev] [PATCH v2 1/4] net/virtio: fix wrong MSI-X for modern devices Jianfeng Tan
2017-04-27  7:35   ` [dpdk-dev] [PATCH v2 2/4] net/virtio: clean up LSC setting Jianfeng Tan
2017-04-27  7:49     ` Yuanhan Liu
2017-04-28  4:48     ` Yuanhan Liu
2017-04-27  7:35   ` [dpdk-dev] [PATCH v2 3/4] net/virtio: remove redundant MSI-X detection Jianfeng Tan
2017-04-27  7:35   ` Jianfeng Tan [this message]
2017-04-28  4:41   ` [dpdk-dev] [PATCH v2 0/4] fixes and cleanup on virtio LSC Yuanhan Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1493278539-44617-5-git-send-email-jianfeng.tan@intel.com \
    --to=jianfeng.tan@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    --cc=yuanhan.liu@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).