From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 58546A0542; Fri, 7 Feb 2020 14:22:32 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9C50D1C0D2; Fri, 7 Feb 2020 14:22:31 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id C3B051C0D1 for ; Fri, 7 Feb 2020 14:22:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581081750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jl9eUJ0KcJtj+/rPfXHfQyybniS423VSQUkGpNHnFLs=; b=Vm2aWJ8aGWAx8lQ0aoJrA8r/IV0BSkHWaaalxtMbUlqlCNfpxa5AFe9bsDEf2SmJdJqlmm FRsEzBxPMLgYA9duETEIH/qZh3qQbZVwdKTgD6EXyK7b70LSH/J9QiHChWXiw+pWLlLU/4 zqdfJHSePhdDYbP/y87YC6sEuFfQnwI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-409-np0LiK_yM-SKqayZrgoU7A-1; Fri, 07 Feb 2020 08:22:28 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4AC90107BA97; Fri, 7 Feb 2020 13:22:27 +0000 (UTC) Received: from ovpn-118-75.ams2.redhat.com (unknown [10.36.118.75]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 173821001B28; Fri, 7 Feb 2020 13:22:25 +0000 (UTC) Message-ID: <3e5e62ec4a9436920ba9ab59185b49d2957a02a2.camel@redhat.com> From: Mohammed Gamal To: Stephen Hemminger , dev@dpdk.org Cc: Stephen Hemminger Date: Fri, 07 Feb 2020 15:22:23 +0200 In-Reply-To: <20200207001038.7254-1-sthemmin@microsoft.com> References: <20200206105541.1186-1-mgamal@redhat.com> <20200207001038.7254-1-sthemmin@microsoft.com> User-Agent: Evolution 3.32.4 (3.32.4-1.fc30) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: np0LiK_yM-SKqayZrgoU7A-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [RFT] net/netvsc: initialize link state X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list 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 Thu, 2020-02-06 at 16:10 -0800, Stephen Hemminger wrote: > If application is using link state interrupt, the correct link state > needs to be filled in when device is started. This is similar to > how virtio updates link information. > > Reported-by: Mohammed Gamal > Signed-off-by: Stephen Hemminger > --- > This version marked RFT because am in airport without access to a > machine to test it. > > drivers/net/netvsc/hn_ethdev.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/net/netvsc/hn_ethdev.c > b/drivers/net/netvsc/hn_ethdev.c > index c79f924379fe..564620748daf 100644 > --- a/drivers/net/netvsc/hn_ethdev.c > +++ b/drivers/net/netvsc/hn_ethdev.c > @@ -823,6 +823,10 @@ hn_dev_start(struct rte_eth_dev *dev) > if (error) > hn_rndis_set_rxfilter(hv, 0); > > + /* Initialize Link state */ > + if (error == 0) > + hn_dev_link_update(dev, 0); > + > return error; > } > I tested this and I always get the link status as UP, regardless of whether I start the interface on the guest in UP or DOWN state. Looking at hn_dev_link_update() code, I see that the link status depends on the NDIS status that the driver gets from the host if my understanding is correct. The question is whether if I use 'ip li set dev $IF_NAME down' on the guest affects the status the host sees, or would the host set the state to NDIS_MEDIA_STATE_CONNECTED of the device is physcially connected regardless of what the guest tries to do?