From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id DA144106A; Tue, 17 Jan 2017 08:09:50 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP; 16 Jan 2017 23:09:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,243,1477983600"; d="scan'208";a="1113750088" Received: from dpdk06.sh.intel.com ([10.239.129.195]) by fmsmga002.fm.intel.com with ESMTP; 16 Jan 2017 23:09:48 -0800 From: Jianfeng Tan To: dev@dpdk.org Cc: yuanhan.liu@linux.intel.com, stephen@networkplumber.org, lei.a.yao@intel.com, Jianfeng Tan , stable@dpdk.org Date: Tue, 17 Jan 2017 07:10:21 +0000 Message-Id: <1484637030-106261-2-git-send-email-jianfeng.tan@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484637030-106261-1-git-send-email-jianfeng.tan@intel.com> References: <1480810702-114815-1-git-send-email-jianfeng.tan@intel.com> <1484637030-106261-1-git-send-email-jianfeng.tan@intel.com> Subject: [dpdk-dev] [PATCH v4 01/10] net/virtio: fix rewriting LSC flag 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: , X-List-Received-Date: Tue, 17 Jan 2017 07:09:51 -0000 The LSC flag is decided according to if VIRTIO_NET_F_STATUS feature is negotiated. Copy the PCI info after the judgement will rewrite the correct result. Fixes: 198ab33677c9 ("net/virtio: move device initialization in a function") CC: stable@dpdk.org Signed-off-by: Jianfeng Tan Tested-by: Lei Yao --- drivers/net/virtio/virtio_ethdev.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index f596f4d..837d3df 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1208,17 +1208,17 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features) if (virtio_negotiate_features(hw, req_features) < 0) return -1; + if (eth_dev->device) { + pci_dev = RTE_DEV_TO_PCI(eth_dev->device); + rte_eth_copy_pci_info(eth_dev, pci_dev); + } + /* If host does not support status then disable LSC */ if (!vtpci_with_feature(hw, VIRTIO_NET_F_STATUS)) eth_dev->data->dev_flags &= ~RTE_ETH_DEV_INTR_LSC; else eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC; - if (eth_dev->device) { - pci_dev = RTE_DEV_TO_PCI(eth_dev->device); - rte_eth_copy_pci_info(eth_dev, pci_dev); - } - rx_func_get(eth_dev); /* Setting up rx_header size for the device */ -- 2.7.4