From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jianfeng Tan Subject: [PATCH v2 2/7] net/virtio_user: postpone DRIVER OK notification Date: Fri, 23 Dec 2016 07:14:21 +0000 Message-ID: <1482477266-39199-3-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> Cc: yuanhan.liu@linux.intel.com, ferruh.yigit@intel.com, cunming.liang@intel.com, Jianfeng Tan To: dev@dpdk.org 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) In-Reply-To: <1482477266-39199-1-git-send-email-jianfeng.tan@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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