net/liquidio: add API to flush IQ
[dpdk.git] / drivers / net / liquidio / lio_ethdev.c
index 77106f6..b8baa4f 100644 (file)
@@ -281,6 +281,7 @@ static int lio_dev_configure(struct rte_eth_dev *eth_dev)
         * response arrived or timed-out.
         */
        while ((*sc->status_word == LIO_COMPLETION_WORD_INIT) && --timeout) {
+               lio_flush_iq(lio_dev, lio_dev->instr_queue[sc->iq_no]);
                lio_process_ordered_list(lio_dev);
                rte_delay_ms(1);
        }
@@ -361,6 +362,15 @@ static int lio_dev_configure(struct rte_eth_dev *eth_dev)
 
        lio_free_soft_command(sc);
 
+       /* Disable iq_0 for reconf */
+       lio_dev->fn_list.disable_io_queues(lio_dev);
+
+       /* Reset ioq regs */
+       lio_dev->fn_list.setup_device_regs(lio_dev);
+
+       /* Free iq_0 used during init */
+       lio_free_instr_queue0(lio_dev);
+
        return 0;
 
 nic_config_fail:
@@ -487,6 +497,10 @@ lio_first_time_init(struct lio_device *lio_dev,
        lio_dev->max_tx_queues = dpdk_queues;
        lio_dev->max_rx_queues = dpdk_queues;
 
+       /* Enable input and output queues for this device */
+       if (lio_dev->fn_list.enable_io_queues(lio_dev))
+               goto error;
+
        return 0;
 
 error:
@@ -516,6 +530,7 @@ lio_eth_dev_uninit(struct rte_eth_dev *eth_dev)
        eth_dev->data->mac_addrs = NULL;
 
        eth_dev->rx_pkt_burst = NULL;
+       eth_dev->tx_pkt_burst = NULL;
 
        return 0;
 }
@@ -529,6 +544,7 @@ lio_eth_dev_init(struct rte_eth_dev *eth_dev)
        PMD_INIT_FUNC_TRACE();
 
        eth_dev->rx_pkt_burst = &lio_dev_recv_pkts;
+       eth_dev->tx_pkt_burst = &lio_dev_xmit_pkts;
 
        /* Primary does the initialization. */
        if (rte_eal_process_type() != RTE_PROC_PRIMARY)
@@ -564,6 +580,7 @@ lio_eth_dev_init(struct rte_eth_dev *eth_dev)
                            "MAC addresses memory allocation failed\n");
                eth_dev->dev_ops = NULL;
                eth_dev->rx_pkt_burst = NULL;
+               eth_dev->tx_pkt_burst = NULL;
                return -ENOMEM;
        }