Signed-off-by: Shijith Thotton <shijith.thot...@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.ja...@caviumnetworks.com>
Signed-off-by: Derek Chickles <derek.chick...@caviumnetworks.com>
Signed-off-by: Venkat Koppula <venkat.kopp...@caviumnetworks.com>
Signed-off-by: Srisivasubramanian S <ssriniva...@caviumnetworks.com>
Signed-off-by: Mallesham Jatharakonda <mjatharako...@oneconvergence.com>
---
 drivers/net/liquidio/lio_ethdev.c | 31 +++++++++++++++++++++++++++++++
 drivers/net/liquidio/lio_rxtx.c   |  2 +-
 drivers/net/liquidio/lio_rxtx.h   |  1 +
 3 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/drivers/net/liquidio/lio_ethdev.c 
b/drivers/net/liquidio/lio_ethdev.c
index b8baa4f..97acfcc 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -216,6 +216,36 @@
        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 int lio_dev_configure(struct rte_eth_dev *eth_dev)
        .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
diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c
index 64c0385..6a1d265 100644
--- a/drivers/net/liquidio/lio_rxtx.c
+++ b/drivers/net/liquidio/lio_rxtx.c
@@ -1439,7 +1439,7 @@ struct lio_soft_command *
        return node;
 }
 
-static void
+void
 lio_delete_sglist(struct lio_instr_queue *txq)
 {
        struct lio_device *lio_dev = txq->lio_dev;
diff --git a/drivers/net/liquidio/lio_rxtx.h b/drivers/net/liquidio/lio_rxtx.h
index 0a4cc2b..964a884 100644
--- a/drivers/net/liquidio/lio_rxtx.h
+++ b/drivers/net/liquidio/lio_rxtx.h
@@ -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,
-- 
1.8.3.1

Reply via email to