[v3,32/32] net/cnxk: dumps device private information

Message ID 20220912131425.1973415-32-ndabilpuram@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series [v3,01/32] net/cnxk: add eth port specific PTP enable |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS

Commit Message

Nithin Dabilpuram Sept. 12, 2022, 1:14 p.m. UTC
  From: Rakesh Kudurumalla <rkudurumalla@marvell.com>

Add support for ethdev private data dump callback for
debugging purposes.

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 drivers/net/cnxk/cnxk_ethdev.c     |  1 +
 drivers/net/cnxk/cnxk_ethdev.h     |  1 +
 drivers/net/cnxk/cnxk_ethdev_ops.c | 29 +++++++++++++++++++++++++++++
 3 files changed, 31 insertions(+)
  

Comments

Jerin Jacob Sept. 16, 2022, 11:36 a.m. UTC | #1
On Mon, Sep 12, 2022 at 6:48 PM Nithin Dabilpuram
<ndabilpuram@marvell.com> wrote:
>
> From: Rakesh Kudurumalla <rkudurumalla@marvell.com>
>
> Add support for ethdev private data dump callback for
> debugging purposes.
>
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>

Updated the git commits in the series as needed and applied series to
dpdk-next-net-mrvl/for-next-net. Thanks



> ---
>  drivers/net/cnxk/cnxk_ethdev.c     |  1 +
>  drivers/net/cnxk/cnxk_ethdev.h     |  1 +
>  drivers/net/cnxk/cnxk_ethdev_ops.c | 29 +++++++++++++++++++++++++++++
>  3 files changed, 31 insertions(+)
>
> diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c
> index 89f8cc107d..48d6bedb89 100644
> --- a/drivers/net/cnxk/cnxk_ethdev.c
> +++ b/drivers/net/cnxk/cnxk_ethdev.c
> @@ -1682,6 +1682,7 @@ struct eth_dev_ops cnxk_eth_dev_ops = {
>         .set_queue_rate_limit = cnxk_nix_tm_set_queue_rate_limit,
>         .tm_ops_get = cnxk_nix_tm_ops_get,
>         .mtr_ops_get = cnxk_nix_mtr_ops_get,
> +       .eth_dev_priv_dump  = cnxk_nix_eth_dev_priv_dump,
>  };
>
>  static int
> diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h
> index bed0e0eada..c09e9bff8e 100644
> --- a/drivers/net/cnxk/cnxk_ethdev.h
> +++ b/drivers/net/cnxk/cnxk_ethdev.h
> @@ -585,6 +585,7 @@ int cnxk_nix_rss_hash_update(struct rte_eth_dev *eth_dev,
>                              struct rte_eth_rss_conf *rss_conf);
>  int cnxk_nix_rss_hash_conf_get(struct rte_eth_dev *eth_dev,
>                                struct rte_eth_rss_conf *rss_conf);
> +int cnxk_nix_eth_dev_priv_dump(struct rte_eth_dev *eth_dev, FILE *file);
>
>  /* Link */
>  void cnxk_nix_toggle_flag_link_cfg(struct cnxk_eth_dev *dev, bool set);
> diff --git a/drivers/net/cnxk/cnxk_ethdev_ops.c b/drivers/net/cnxk/cnxk_ethdev_ops.c
> index 64beabdd12..0a8b36342a 100644
> --- a/drivers/net/cnxk/cnxk_ethdev_ops.c
> +++ b/drivers/net/cnxk/cnxk_ethdev_ops.c
> @@ -931,6 +931,35 @@ cnxk_nix_reta_query(struct rte_eth_dev *eth_dev,
>         return rc;
>  }
>
> +int
> +cnxk_nix_eth_dev_priv_dump(struct rte_eth_dev *eth_dev, FILE *file)
> +{
> +       struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);
> +       struct roc_nix *roc_nix = &dev->nix;
> +       int i;
> +
> +       roc_nix_dump(roc_nix, file);
> +
> +       for (i = 0; i < eth_dev->data->nb_rx_queues; i++)
> +               roc_nix_rq_dump(&dev->rqs[i], file);
> +
> +       for (i = 0; i < eth_dev->data->nb_rx_queues; i++)
> +               roc_nix_cq_dump(&dev->cqs[i], file);
> +
> +       for (i = 0; i < eth_dev->data->nb_tx_queues; i++)
> +               roc_nix_sq_dump(&dev->sqs[i], file);
> +
> +       roc_nix_queues_ctx_dump(roc_nix, file);
> +
> +       roc_nix_tm_dump(roc_nix, file);
> +
> +       roc_nix_inl_dev_dump(NULL, file);
> +
> +       roc_nix_inl_outb_cpt_lfs_dump(roc_nix, file);
> +
> +       return 0;
> +}
> +
>  int
>  cnxk_nix_rss_hash_update(struct rte_eth_dev *eth_dev,
>                          struct rte_eth_rss_conf *rss_conf)
> --
> 2.25.1
>
  

Patch

diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c
index 89f8cc107d..48d6bedb89 100644
--- a/drivers/net/cnxk/cnxk_ethdev.c
+++ b/drivers/net/cnxk/cnxk_ethdev.c
@@ -1682,6 +1682,7 @@  struct eth_dev_ops cnxk_eth_dev_ops = {
 	.set_queue_rate_limit = cnxk_nix_tm_set_queue_rate_limit,
 	.tm_ops_get = cnxk_nix_tm_ops_get,
 	.mtr_ops_get = cnxk_nix_mtr_ops_get,
+	.eth_dev_priv_dump  = cnxk_nix_eth_dev_priv_dump,
 };
 
 static int
diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h
index bed0e0eada..c09e9bff8e 100644
--- a/drivers/net/cnxk/cnxk_ethdev.h
+++ b/drivers/net/cnxk/cnxk_ethdev.h
@@ -585,6 +585,7 @@  int cnxk_nix_rss_hash_update(struct rte_eth_dev *eth_dev,
 			     struct rte_eth_rss_conf *rss_conf);
 int cnxk_nix_rss_hash_conf_get(struct rte_eth_dev *eth_dev,
 			       struct rte_eth_rss_conf *rss_conf);
+int cnxk_nix_eth_dev_priv_dump(struct rte_eth_dev *eth_dev, FILE *file);
 
 /* Link */
 void cnxk_nix_toggle_flag_link_cfg(struct cnxk_eth_dev *dev, bool set);
diff --git a/drivers/net/cnxk/cnxk_ethdev_ops.c b/drivers/net/cnxk/cnxk_ethdev_ops.c
index 64beabdd12..0a8b36342a 100644
--- a/drivers/net/cnxk/cnxk_ethdev_ops.c
+++ b/drivers/net/cnxk/cnxk_ethdev_ops.c
@@ -931,6 +931,35 @@  cnxk_nix_reta_query(struct rte_eth_dev *eth_dev,
 	return rc;
 }
 
+int
+cnxk_nix_eth_dev_priv_dump(struct rte_eth_dev *eth_dev, FILE *file)
+{
+	struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);
+	struct roc_nix *roc_nix = &dev->nix;
+	int i;
+
+	roc_nix_dump(roc_nix, file);
+
+	for (i = 0; i < eth_dev->data->nb_rx_queues; i++)
+		roc_nix_rq_dump(&dev->rqs[i], file);
+
+	for (i = 0; i < eth_dev->data->nb_rx_queues; i++)
+		roc_nix_cq_dump(&dev->cqs[i], file);
+
+	for (i = 0; i < eth_dev->data->nb_tx_queues; i++)
+		roc_nix_sq_dump(&dev->sqs[i], file);
+
+	roc_nix_queues_ctx_dump(roc_nix, file);
+
+	roc_nix_tm_dump(roc_nix, file);
+
+	roc_nix_inl_dev_dump(NULL, file);
+
+	roc_nix_inl_outb_cpt_lfs_dump(roc_nix, file);
+
+	return 0;
+}
+
 int
 cnxk_nix_rss_hash_update(struct rte_eth_dev *eth_dev,
 			 struct rte_eth_rss_conf *rss_conf)