From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH] net/virtio: fix link status always being up Date: Wed, 19 Apr 2017 10:08:00 +0800 Message-ID: <20170419020800.GR7333@yliu-dev.sh.intel.com> References: <1492151805-14086-1-git-send-email-yuanhan.liu@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Maxime Coquelin , stable@dpdk.org To: dev@dpdk.org Return-path: Content-Disposition: inline In-Reply-To: <1492151805-14086-1-git-send-email-yuanhan.liu@linux.intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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: stable@dpdk.org > Signed-off-by: Yuanhan Liu Applied to dpdk-next-virtio. --yliu