net/axgbe: support queue query
authorAmaranath Somalapuram <asomalap@amd.com>
Mon, 2 Mar 2020 08:16:53 +0000 (13:46 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 18 Mar 2020 14:29:39 +0000 (15:29 +0100)
Adding API for axgbe_rxq_info_get, axgbe_txq_info_get

Signed-off-by: Amaranath Somalapuram <asomalap@amd.com>
Acked-by: Ravi Kumar <ravi1.kumar@amd.com>
drivers/net/axgbe/axgbe_ethdev.c

index 0c54e6e..dce8e15 100644 (file)
@@ -68,6 +68,10 @@ static int axgbe_flow_ctrl_set(struct rte_eth_dev *dev,
                                struct rte_eth_fc_conf *fc_conf);
 static int axgbe_priority_flow_ctrl_set(struct rte_eth_dev *dev,
                                struct rte_eth_pfc_conf *pfc_conf);
+static void axgbe_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+       struct rte_eth_rxq_info *qinfo);
+static void axgbe_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+       struct rte_eth_txq_info *qinfo);
 
 struct axgbe_xstats {
        char name[RTE_ETH_XSTATS_NAME_SIZE];
@@ -204,6 +208,8 @@ static const struct eth_dev_ops axgbe_eth_dev_ops = {
        .flow_ctrl_get        = axgbe_flow_ctrl_get,
        .flow_ctrl_set        = axgbe_flow_ctrl_set,
        .priority_flow_ctrl_set = axgbe_priority_flow_ctrl_set,
+       .rxq_info_get                 = axgbe_rxq_info_get,
+       .txq_info_get                 = axgbe_txq_info_get,
 };
 
 static int axgbe_phy_reset(struct axgbe_port *pdata)
@@ -1186,6 +1192,30 @@ axgbe_priority_flow_ctrl_set(struct rte_eth_dev *dev,
        return 0;
 }
 
+void
+axgbe_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+       struct rte_eth_rxq_info *qinfo)
+{
+       struct   axgbe_rx_queue *rxq;
+
+       rxq = dev->data->rx_queues[queue_id];
+       qinfo->mp = rxq->mb_pool;
+       qinfo->scattered_rx = dev->data->scattered_rx;
+       qinfo->nb_desc = rxq->nb_desc;
+       qinfo->conf.rx_free_thresh = rxq->free_thresh;
+}
+
+void
+axgbe_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+       struct rte_eth_txq_info *qinfo)
+{
+       struct  axgbe_tx_queue *txq;
+
+       txq = dev->data->tx_queues[queue_id];
+       qinfo->nb_desc = txq->nb_desc;
+       qinfo->conf.tx_free_thresh = txq->free_thresh;
+}
+
 static void axgbe_get_all_hw_features(struct axgbe_port *pdata)
 {
        unsigned int mac_hfr0, mac_hfr1, mac_hfr2;