net/netvsc: add queue info
authorStephen Hemminger <sthemmin@microsoft.com>
Tue, 24 Jul 2018 21:08:52 +0000 (14:08 -0700)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 5 Aug 2018 09:03:15 +0000 (11:03 +0200)
This helps when diagnosing ring issues in testpmd.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
drivers/net/netvsc/hn_ethdev.c
drivers/net/netvsc/hn_rxtx.c
drivers/net/netvsc/hn_var.h

index 47ed760..78b842b 100644 (file)
@@ -536,6 +536,8 @@ static const struct eth_dev_ops hn_eth_dev_ops = {
        .dev_stop               = hn_dev_stop,
        .dev_close              = hn_dev_close,
        .dev_infos_get          = hn_dev_info_get,
+       .txq_info_get           = hn_dev_tx_queue_info,
+       .rxq_info_get           = hn_dev_rx_queue_info,
        .promiscuous_enable     = hn_dev_promiscuous_enable,
        .promiscuous_disable    = hn_dev_promiscuous_disable,
        .allmulticast_enable    = hn_dev_allmulticast_enable,
index 3c03dc8..ec133d4 100644 (file)
@@ -268,6 +268,17 @@ hn_dev_tx_queue_release(void *arg)
        rte_free(txq);
 }
 
+void
+hn_dev_tx_queue_info(struct rte_eth_dev *dev, uint16_t queue_idx,
+                    struct rte_eth_txq_info *qinfo)
+{
+       struct hn_data *hv = dev->data->dev_private;
+       struct hn_tx_queue *txq = dev->data->rx_queues[queue_idx];
+
+       qinfo->conf.tx_free_thresh = txq->free_thresh;
+       qinfo->nb_desc = hv->tx_pool->size;
+}
+
 static void
 hn_nvs_send_completed(struct rte_eth_dev *dev, uint16_t queue_id,
                      unsigned long xactid, const struct hn_nvs_rndis_ack *ack)
@@ -790,6 +801,17 @@ hn_dev_rx_queue_release(void *arg)
        }
 }
 
+void
+hn_dev_rx_queue_info(struct rte_eth_dev *dev, uint16_t queue_idx,
+                    struct rte_eth_rxq_info *qinfo)
+{
+       struct hn_rx_queue *rxq = dev->data->rx_queues[queue_idx];
+
+       qinfo->mp = rxq->mb_pool;
+       qinfo->scattered_rx = 1;
+       qinfo->nb_desc = rte_ring_get_capacity(rxq->rx_ring);
+}
+
 static void
 hn_nvs_handle_notify(const struct vmbus_chanpkt_hdr *pkthdr,
                     const void *data)
index f0358c5..3f3b442 100644 (file)
@@ -141,6 +141,8 @@ int hn_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
                              uint16_t nb_desc, unsigned int socket_id,
                              const struct rte_eth_txconf *tx_conf);
 void   hn_dev_tx_queue_release(void *arg);
+void   hn_dev_tx_queue_info(struct rte_eth_dev *dev, uint16_t queue_idx,
+                            struct rte_eth_txq_info *qinfo);
 
 struct hn_rx_queue *hn_rx_queue_alloc(struct hn_data *hv,
                                      uint16_t queue_id,
@@ -151,3 +153,5 @@ int hn_dev_rx_queue_setup(struct rte_eth_dev *dev,
                              const struct rte_eth_rxconf *rx_conf,
                              struct rte_mempool *mp);
 void   hn_dev_rx_queue_release(void *arg);
+void   hn_dev_rx_queue_info(struct rte_eth_dev *dev, uint16_t queue_idx,
+                            struct rte_eth_rxq_info *qinfo);