ixgbe: fix VF init without setup
authorIntel <intel.com>
Wed, 18 Sep 2013 10:00:00 +0000 (12:00 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 9 Oct 2013 14:16:14 +0000 (16:16 +0200)
In case of multi-process application, the secondary process can initialize
the driver without configuring queues. In this case the Rx/Tx functions
were not initialized because it was only done in queue setup.

Fix by reproducing the same behaviour as in eth_ixgbe_dev_init().

Signed-off-by: Intel
lib/librte_pmd_ixgbe/ixgbe_ethdev.c

index e0350d6..bc24187 100644 (file)
@@ -732,6 +732,18 @@ eth_ixgbevf_dev_init(__attribute__((unused)) struct eth_driver *eth_drv,
        PMD_INIT_LOG(DEBUG, "eth_ixgbevf_dev_init");
 
        eth_dev->dev_ops = &ixgbevf_eth_dev_ops;
+       eth_dev->rx_pkt_burst = &ixgbe_recv_pkts;
+       eth_dev->tx_pkt_burst = &ixgbe_xmit_pkts;
+
+       /* for secondary processes, we don't initialise any further as primary
+        * has already done this work. Only check we don't need a different
+        * RX function */
+       if (rte_eal_process_type() != RTE_PROC_PRIMARY){
+               if (eth_dev->data->scattered_rx)
+                       eth_dev->rx_pkt_burst = ixgbe_recv_scattered_pkts;
+               return 0;
+       }
+
        pci_dev = eth_dev->pci_dev;
 
        hw->device_id = pci_dev->id.device_id;