net/liquidio: add API to release Tx queue
authorShijith Thotton <shijith.thotton@caviumnetworks.com>
Sat, 25 Mar 2017 06:24:41 +0000 (11:54 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 4 Apr 2017 16:59:49 +0000 (18:59 +0200)
Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Derek Chickles <derek.chickles@caviumnetworks.com>
Signed-off-by: Venkat Koppula <venkat.koppula@caviumnetworks.com>
Signed-off-by: Srisivasubramanian S <ssrinivasan@caviumnetworks.com>
Signed-off-by: Mallesham Jatharakonda <mjatharakonda@oneconvergence.com>
drivers/net/liquidio/lio_ethdev.c
drivers/net/liquidio/lio_rxtx.c
drivers/net/liquidio/lio_rxtx.h

index b8baa4f..97acfcc 100644 (file)
@@ -216,6 +216,36 @@ lio_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t q_no,
        return 0;
 }
 
+/**
+ * Release the transmit queue/ringbuffer. Called by
+ * the upper layers.
+ *
+ * @param txq
+ *    Opaque pointer to the transmit queue to release
+ *
+ * @return
+ *    - nothing
+ */
+static void
+lio_dev_tx_queue_release(void *txq)
+{
+       struct lio_instr_queue *tq = txq;
+       struct lio_device *lio_dev = tq->lio_dev;
+       uint32_t fw_mapped_iq_no;
+
+       /* Run time queue deletion not supported */
+       if (lio_dev->port_configured)
+               return;
+
+       if (tq != NULL) {
+               /* Free sg_list */
+               lio_delete_sglist(tq);
+
+               fw_mapped_iq_no = tq->txpciq.s.q_no;
+               lio_delete_instruction_queue(tq->lio_dev, fw_mapped_iq_no);
+       }
+}
+
 static int lio_dev_configure(struct rte_eth_dev *eth_dev)
 {
        struct lio_device *lio_dev = LIO_DEV(eth_dev);
@@ -387,6 +417,7 @@ static const struct eth_dev_ops liovf_eth_dev_ops = {
        .rx_queue_setup         = lio_dev_rx_queue_setup,
        .rx_queue_release       = lio_dev_rx_queue_release,
        .tx_queue_setup         = lio_dev_tx_queue_setup,
+       .tx_queue_release       = lio_dev_tx_queue_release,
 };
 
 static void
index 64c0385..6a1d265 100644 (file)
@@ -1439,7 +1439,7 @@ list_delete_first_node(struct lio_stailq_head *head)
        return node;
 }
 
-static void
+void
 lio_delete_sglist(struct lio_instr_queue *txq)
 {
        struct lio_device *lio_dev = txq->lio_dev;
index 0a4cc2b..964a884 100644 (file)
@@ -699,6 +699,7 @@ uint16_t lio_dev_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
                           uint16_t budget);
 void lio_delete_droq_queue(struct lio_device *lio_dev, int oq_no);
 
+void lio_delete_sglist(struct lio_instr_queue *txq);
 int lio_setup_sglists(struct lio_device *lio_dev, int iq_no,
                      int fw_mapped_iq, int num_descs, unsigned int socket_id);
 uint16_t lio_dev_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts,