From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id C628F8E93 for ; Mon, 31 Aug 2015 04:54:11 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 30 Aug 2015 19:54:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,437,1437462000"; d="scan'208";a="794164780" Received: from pgsmsx102.gar.corp.intel.com ([10.221.44.80]) by orsmga002.jf.intel.com with ESMTP; 30 Aug 2015 19:54:06 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.110.15) by PGSMSX102.gar.corp.intel.com (10.221.44.80) with Microsoft SMTP Server (TLS) id 14.3.224.2; Mon, 31 Aug 2015 10:54:04 +0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.206]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.210]) with mapi id 14.03.0224.002; Mon, 31 Aug 2015 10:54:03 +0800 From: "Ouyang, Changchun" To: Stephen Hemminger , "Xie, Huawei" Thread-Topic: [PATCH 1/3] virtio: don't report link state feature unless available Thread-Index: AQHQ4a3kNGMwldSdW0CBluY2D0qisJ4lbO2A Date: Mon, 31 Aug 2015 02:54:02 +0000 Message-ID: References: <1440779019-10793-1-git-send-email-stephen@networkplumber.org> <1440779019-10793-2-git-send-email-stephen@networkplumber.org> In-Reply-To: <1440779019-10793-2-git-send-email-stephen@networkplumber.org> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" , Stephen Hemminger Subject: Re: [dpdk-dev] [PATCH 1/3] virtio: don't report link state feature unless available X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Aug 2015 02:54:12 -0000 > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Saturday, August 29, 2015 12:24 AM > To: Xie, Huawei; Ouyang, Changchun > Cc: dev@dpdk.org; Stephen Hemminger; Stephen Hemminger > Subject: [PATCH 1/3] virtio: don't report link state feature unless avail= able >=20 > From: Stephen Hemminger >=20 > If host does not support virtio link state (like current DPDK vhost) then= don't > set the flag. This keeps applications from incorrectly assuming that link= state > is available when it is not. It also avoids useless "guess what works in = the > config". >=20 > Signed-off-by: Stephen Hemminger Acked-by: Changchun Ouyang > --- > drivers/net/virtio/virtio_ethdev.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/net/virtio/virtio_ethdev.c > b/drivers/net/virtio/virtio_ethdev.c > index 465d3cd..8c3e924 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -1201,6 +1201,10 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev) > vtpci_set_status(hw, VIRTIO_CONFIG_STATUS_DRIVER); > virtio_negotiate_features(hw); >=20 > + /* If host does not support status then disable LSC */ > + if (!vtpci_with_feature(hw, VIRTIO_NET_F_STATUS)) > + pci_dev->driver->drv_flags &=3D ~RTE_PCI_DRV_INTR_LSC; > + > rx_func_get(eth_dev); >=20 > /* Setting up rx_header size for the device */ @@ -1394,9 +1398,8 > @@ virtio_dev_start(struct rte_eth_dev *dev) > struct rte_pci_device *pci_dev =3D dev->pci_dev; >=20 > /* check if lsc interrupt feature is enabled */ > - if ((dev->data->dev_conf.intr_conf.lsc) && > - (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC)) { > - if (!vtpci_with_feature(hw, VIRTIO_NET_F_STATUS)) { > + if (dev->data->dev_conf.intr_conf.lsc) { > + if (!(pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC)) > { > PMD_DRV_LOG(ERR, "link status not supported by > host"); > return -ENOTSUP; > } > -- > 2.1.4