net/virtio: complete init stage at the right place
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Sat, 5 Nov 2016 09:41:02 +0000 (17:41 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 7 Nov 2016 14:40:24 +0000 (15:40 +0100)
Invoking vtpci_reinit_complete() at port start stage doesn't make any
sense, instead, it should be done at the end of dev init stage.

So move it here.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/net/virtio/virtio_ethdev.c

index adfc69d..cdfeac7 100644 (file)
@@ -1277,6 +1277,7 @@ 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",
@@ -1497,8 +1498,6 @@ virtio_dev_start(struct rte_eth_dev *dev)
        if (hw->started)
                return 0;
 
-       vtpci_reinit_complete(hw);
-
        hw->started = 1;
 
        /*Notify the backend