net/sfc: get transmit queue information
authorIvan Malov <ivan.malov@oktetlabs.ru>
Thu, 15 Dec 2016 12:51:12 +0000 (12:51 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 17 Jan 2017 18:40:50 +0000 (19:40 +0100)
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
drivers/net/sfc/sfc_ethdev.c

index d3c2a35..6d5e79d 100644 (file)
@@ -846,6 +846,28 @@ sfc_rx_queue_info_get(struct rte_eth_dev *dev, uint16_t rx_queue_id,
        sfc_adapter_unlock(sa);
 }
 
+static void
+sfc_tx_queue_info_get(struct rte_eth_dev *dev, uint16_t tx_queue_id,
+                     struct rte_eth_txq_info *qinfo)
+{
+       struct sfc_adapter *sa = dev->data->dev_private;
+       struct sfc_txq_info *txq_info;
+
+       sfc_adapter_lock(sa);
+
+       SFC_ASSERT(tx_queue_id < sa->txq_count);
+
+       txq_info = &sa->txq_info[tx_queue_id];
+       SFC_ASSERT(txq_info->txq != NULL);
+
+       memset(qinfo, 0, sizeof(*qinfo));
+
+       qinfo->conf.txq_flags = txq_info->txq->flags;
+       qinfo->nb_desc = txq_info->entries;
+
+       sfc_adapter_unlock(sa);
+}
+
 static uint32_t
 sfc_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 {
@@ -943,6 +965,7 @@ static const struct eth_dev_ops sfc_eth_dev_ops = {
        .mac_addr_set                   = sfc_mac_addr_set,
        .set_mc_addr_list               = sfc_set_mc_addr_list,
        .rxq_info_get                   = sfc_rx_queue_info_get,
+       .txq_info_get                   = sfc_tx_queue_info_get,
 };
 
 static int