From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 11BBC10D77 for ; Fri, 23 Dec 2016 08:13:51 +0100 (CET) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP; 22 Dec 2016 23:13:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,392,1477983600"; d="scan'208";a="45730673" Received: from dpdk06.sh.intel.com ([10.239.129.195]) by orsmga005.jf.intel.com with ESMTP; 22 Dec 2016 23:13:49 -0800 From: Jianfeng Tan To: dev@dpdk.org Cc: yuanhan.liu@linux.intel.com, ferruh.yigit@intel.com, cunming.liang@intel.com, Jianfeng Tan Date: Fri, 23 Dec 2016 07:14:21 +0000 Message-Id: <1482477266-39199-3-git-send-email-jianfeng.tan@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482477266-39199-1-git-send-email-jianfeng.tan@intel.com> References: <1480689075-66977-1-git-send-email-jianfeng.tan@intel.com> <1482477266-39199-1-git-send-email-jianfeng.tan@intel.com> Subject: [dpdk-dev] [PATCH v2 2/7] net/virtio_user: postpone DRIVER OK notification 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: Fri, 23 Dec 2016 07:13:52 -0000 In driver probe phase, we obtain device information; and then virtio driver will initialize device and stores info, like negotiated features, in vhost_user layer; finally, vhost_user gets DRIVER_OK notification from virtio driver, and then sync with backend device. Previously, DRIVER_OK could be sent twice: 1. when ether layer invokes eth_device_init to initialize device; 2. when user configures it with different configuration from that of previous. Since we can only depend on DRIVER_OK notification to sync with backend device, we postpone it to virtio_dev_start when everything is settled. Signed-off-by: Jianfeng Tan --- drivers/net/virtio/virtio_ethdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 079fd6c..d54b1bb 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1276,7 +1276,6 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features) ret = virtio_alloc_queues(eth_dev); if (ret < 0) return ret; - vtpci_reinit_complete(hw); if (pci_dev) PMD_INIT_LOG(DEBUG, "port %d vendorID=0x%x deviceID=0x%x", @@ -1474,6 +1473,8 @@ virtio_dev_start(struct rte_eth_dev *dev) struct virtnet_tx *txvq __rte_unused; struct virtio_hw *hw = dev->data->dev_private; + vtpci_reinit_complete(hw); + /* check if lsc interrupt feature is enabled */ if (dev->data->dev_conf.intr_conf.lsc) { if (!(dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)) { -- 2.7.4