From: Intel Date: Wed, 18 Sep 2013 10:00:00 +0000 (+0200) Subject: igb: fix VF init without setup X-Git-Tag: spdx-start~11145 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=5caeb1b143da211d545bd9e59e9a93c830fc778f;p=dpdk.git igb: fix VF init without setup 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_igb_dev_init(). Signed-off-by: Intel --- diff --git a/lib/librte_pmd_e1000/igb_ethdev.c b/lib/librte_pmd_e1000/igb_ethdev.c index a2727adcc2..f13da40412 100644 --- a/lib/librte_pmd_e1000/igb_ethdev.c +++ b/lib/librte_pmd_e1000/igb_ethdev.c @@ -471,6 +471,18 @@ eth_igbvf_dev_init(__attribute__((unused)) struct eth_driver *eth_drv, PMD_INIT_LOG(DEBUG, "eth_igbvf_dev_init"); eth_dev->dev_ops = &igbvf_eth_dev_ops; + eth_dev->rx_pkt_burst = ð_igb_recv_pkts; + eth_dev->tx_pkt_burst = ð_igb_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 = ð_igb_recv_scattered_pkts; + return 0; + } + pci_dev = eth_dev->pci_dev; hw->device_id = pci_dev->id.device_id;