From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 2E7248E92 for ; Fri, 4 Dec 2015 17:18:40 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 04 Dec 2015 08:18:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,380,1444719600"; d="scan'208";a="834362014" Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99]) by orsmga001.jf.intel.com with ESMTP; 04 Dec 2015 08:18:38 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.23]) by IRSMSX107.ger.corp.intel.com ([169.254.10.132]) with mapi id 14.03.0248.002; Fri, 4 Dec 2015 16:18:37 +0000 From: "Iremonger, Bernard" To: Stephen Hemminger , "Xie, Huawei" , "yuanhan.liu@linux.intel.com" Thread-Topic: [PATCH resend] virtio: fix link state regression Thread-Index: AQHRLqzHsC7xIHsxpkGcBjq5ziiSsJ67AIew Date: Fri, 4 Dec 2015 16:18:36 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C219F8D6B6@IRSMSX108.ger.corp.intel.com> References: <1449244766-29031-1-git-send-email-stephen@networkplumber.org> In-Reply-To: <1449244766-29031-1-git-send-email-stephen@networkplumber.org> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH resend] virtio: fix link state regression 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: Fri, 04 Dec 2015 16:18:40 -0000 Hi Stephen, > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Friday, December 4, 2015 3:59 PM > To: Xie, Huawei ; yuanhan.liu@linux.intel.com; > Iremonger, Bernard > Cc: dev@dpdk.org; Stephen Hemminger > Subject: [PATCH resend] virtio: fix link state regression >=20 > Support for link state interrupt was broken on virtio by >=20 > commit bda66c418c85 ("ethdev: add device fields from PCI layer") >=20 > This is caused because the actual value of drv_flags is not set until aft= er the > resource_init has figured out whether it is using UIO or direct I/O > instructions. >=20 > Signed-off-by: Stephen Hemminger >=20 > --- >=20 > There maybe other drivers with the same problem. It would have been > better to move the structure elements (and break ABI) rather than assume = it > safe to copy them. >=20 > drivers/net/virtio/virtio_ethdev.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/virtio/virtio_ethdev.c > b/drivers/net/virtio/virtio_ethdev.c > index 74c00ee..8e12804 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -1289,11 +1289,11 @@ eth_virtio_dev_init(struct rte_eth_dev > *eth_dev) >=20 > pci_dev =3D eth_dev->pci_dev; >=20 > - rte_eth_copy_pci_info(eth_dev, pci_dev); > - > if (virtio_resource_init(pci_dev) < 0) > return -1; >=20 > + rte_eth_copy_pci_info(eth_dev, pci_dev); > + > hw->use_msix =3D virtio_has_msix(&pci_dev->addr); > hw->io_base =3D (uint32_t)(uintptr_t)pci_dev- > >mem_resource[0].addr; >=20 > -- > 2.1.4 I think the call to rte_eth_copy_pci_info() needs to be a bit later. After the following code: /* 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; I have submitted a patch for this earlier today http://dpdk.org/dev/patchwork/patch/9345/ Regards, Bernard.