net/cnxk: support queue infos query
authorSatha Rao <skoteshwar@marvell.com>
Wed, 23 Jun 2021 04:46:45 +0000 (10:16 +0530)
committerJerin Jacob <jerinj@marvell.com>
Tue, 29 Jun 2021 23:37:35 +0000 (01:37 +0200)
Initial apis to get default queue information.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
drivers/net/cnxk/cnxk_ethdev.c
drivers/net/cnxk/cnxk_ethdev.h
drivers/net/cnxk/cnxk_ethdev_ops.c

index 071c293..81cd04e 100644 (file)
@@ -1204,6 +1204,8 @@ struct eth_dev_ops cnxk_eth_dev_ops = {
        .xstats_reset = cnxk_nix_xstats_reset,
        .xstats_get_by_id = cnxk_nix_xstats_get_by_id,
        .xstats_get_names_by_id = cnxk_nix_xstats_get_names_by_id,
+       .rxq_info_get = cnxk_nix_rxq_info_get,
+       .txq_info_get = cnxk_nix_txq_info_get,
 };
 
 static int
index 5a0dc13..32977eb 100644 (file)
@@ -305,6 +305,10 @@ int cnxk_nix_xstats_get_names_by_id(struct rte_eth_dev *eth_dev,
 int cnxk_nix_xstats_get_by_id(struct rte_eth_dev *eth_dev, const uint64_t *ids,
                              uint64_t *values, unsigned int n);
 int cnxk_nix_xstats_reset(struct rte_eth_dev *eth_dev);
+void cnxk_nix_rxq_info_get(struct rte_eth_dev *eth_dev, uint16_t qid,
+                          struct rte_eth_rxq_info *qinfo);
+void cnxk_nix_txq_info_get(struct rte_eth_dev *eth_dev, uint16_t qid,
+                          struct rte_eth_txq_info *qinfo);
 
 /* Lookup configuration */
 const uint32_t *cnxk_nix_supported_ptypes_get(struct rte_eth_dev *eth_dev);
index 7f46551..782f163 100644 (file)
@@ -628,3 +628,33 @@ cnxk_nix_pool_ops_supported(struct rte_eth_dev *eth_dev, const char *pool)
 
        return -ENOTSUP;
 }
+
+void
+cnxk_nix_rxq_info_get(struct rte_eth_dev *eth_dev, uint16_t qid,
+                     struct rte_eth_rxq_info *qinfo)
+{
+       void *rxq = eth_dev->data->rx_queues[qid];
+       struct cnxk_eth_rxq_sp *rxq_sp = cnxk_eth_rxq_to_sp(rxq);
+
+       memset(qinfo, 0, sizeof(*qinfo));
+
+       qinfo->mp = rxq_sp->qconf.mp;
+       qinfo->scattered_rx = eth_dev->data->scattered_rx;
+       qinfo->nb_desc = rxq_sp->qconf.nb_desc;
+
+       memcpy(&qinfo->conf, &rxq_sp->qconf.conf.rx, sizeof(qinfo->conf));
+}
+
+void
+cnxk_nix_txq_info_get(struct rte_eth_dev *eth_dev, uint16_t qid,
+                     struct rte_eth_txq_info *qinfo)
+{
+       void *txq = eth_dev->data->tx_queues[qid];
+       struct cnxk_eth_txq_sp *txq_sp = cnxk_eth_txq_to_sp(txq);
+
+       memset(qinfo, 0, sizeof(*qinfo));
+
+       qinfo->nb_desc = txq_sp->qconf.nb_desc;
+
+       memcpy(&qinfo->conf, &txq_sp->qconf.conf.tx, sizeof(qinfo->conf));
+}