From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by dpdk.org (Postfix) with ESMTP id 913588E90 for ; Fri, 4 Dec 2015 16:59:18 +0100 (CET) Received: by pacdm15 with SMTP id dm15so88676525pac.3 for ; Fri, 04 Dec 2015 07:59:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=zmIcFu39WXkQ5VjoIu9gLvBk9KfiSBcbdy7HnruiK8c=; b=Y9mMJokig9tHS7A/CouvnwVojWXvGPrUUTjvCthkDb8ayAvT7Yj89PbIl4V6eirczv pxY/S8ONzmsRp7HXG1DI38s16GMB1K914DEhRiqlo1miTYbmy5sm0fRrOaJEAB2A8W0m JFpgOiAaoxiIO5sl0PgxPzzSQvGrkYxujTzCiY0QApSI7pr+c5sC7+JHi/RH9/XGvmf6 gOrhGZS7ObHxwguVLcXRm09IrcUj2WKR7519wCe41J321qqGUvufAMrndBiAIKgAzUK5 oLWexCAaeSey87fw4m87v3JHBXV4hYTmO0sda5Yd/VRMbaHdkA6y86nrkVg/4pshDQ5z gPmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=zmIcFu39WXkQ5VjoIu9gLvBk9KfiSBcbdy7HnruiK8c=; b=gicTsTOPjX4vg4pNOqeTpaQJUEoyUyD7tfAeXr8/DcADnpWbo7yqVCJ6TIB8O7oW3M fInWJ92oDgSP0QuYSZEINbbrVZFN5Hv7G5q+qtkJQU0HslEuda/pvdbV5gP1mWhxozdT MdhcoW844GUwuDTOK0MzZVmFW60XfHGhJcrDyO4gB/m22uG92PCZCXsWOXo9RDpCdqAe IFP0c7omZjJp0sspkpIbJvCThtv91o3rNpB5pQALt267slWkASB2yISV8tyC8KSPVV45 BGxGF5JiPioKmQDjUdjpe72Z9EXp+MA5JBEi1e+W16RdlCZG0qjmjZyQ/dg3LPseTa2J hwyw== X-Gm-Message-State: ALoCoQlKlkG4CXCHqw9jAlGKGjSygC5gGCt4EmlrGg0pPIjzm8akMBqdBLRJDVuPKja4JbdRoSk+ X-Received: by 10.66.139.131 with SMTP id qy3mr22553635pab.71.1449244757936; Fri, 04 Dec 2015 07:59:17 -0800 (PST) Received: from xeon-e3.home.lan (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id kh9sm18073780pad.11.2015.12.04.07.59.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 04 Dec 2015 07:59:17 -0800 (PST) From: Stephen Hemminger To: huawei.xie@intel.com, yuanhan.liu@linux.intel.com, bernard.iremonger@intel.com Date: Fri, 4 Dec 2015 07:59:26 -0800 Message-Id: <1449244766-29031-1-git-send-email-stephen@networkplumber.org> X-Mailer: git-send-email 2.1.4 Cc: dev@dpdk.org Subject: [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 15:59:19 -0000 Support for link state interrupt was broken on virtio by commit bda66c418c85 ("ethdev: add device fields from PCI layer") This is caused because the actual value of drv_flags is not set until after the resource_init has figured out whether it is using UIO or direct I/O instructions. Signed-off-by: Stephen Hemminger --- 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. drivers/net/virtio/virtio_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) pci_dev = eth_dev->pci_dev; - rte_eth_copy_pci_info(eth_dev, pci_dev); - if (virtio_resource_init(pci_dev) < 0) return -1; + rte_eth_copy_pci_info(eth_dev, pci_dev); + hw->use_msix = virtio_has_msix(&pci_dev->addr); hw->io_base = (uint32_t)(uintptr_t)pci_dev->mem_resource[0].addr; -- 2.1.4