From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 03409A034F; Mon, 7 Jun 2021 20:09:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1E8341206; Mon, 7 Jun 2021 20:05:48 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 7B89F41173 for ; Mon, 7 Jun 2021 20:05:47 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 157I1avV017507 for ; Mon, 7 Jun 2021 11:05:47 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0220; bh=cwpUMCJPde9/hFqoLJVhD6t2zwf7r/kWJuoeGKUWU+c=; b=MJohjz0KDNKmpGUDki39IDSiTBXkQe+EQ+WCTT+YqFptCgdy5f7ltoaP5IedZqqVVCEt rHbZ0ecVRx8Iccjy/slVKHm4OMOvIe3RVrDDvWd5u6BJ4IOuXl+arOVjcgQqG+gkWcz7 yLGp85AW/IrxfppUEr+fl3TVbEYCnYYLsYSnfQLIFI1g4qV7KMhPPNICOYxagy5YK8ku FpSsabazKRV8MU76BNaUKie2WdvqJ0F2g8cfNvdnuWaxtcJrD/FBNtstd2NvKwN8ChDw 6m5DmJqIBxm7uVgZSR1Fp3+fSmqbjK74h1IVX9lqyv2K9knVz3pN7od9DKiQVJDFyNE+ UQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com with ESMTP id 391ecv2eq6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 07 Jun 2021 11:05:46 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 7 Jun 2021 11:05:44 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 7 Jun 2021 11:05:44 -0700 Received: from hyd1588t430.marvell.com (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id 7ACD53F703F; Mon, 7 Jun 2021 11:05:42 -0700 (PDT) From: Nithin Dabilpuram To: CC: , , , , , , Date: Mon, 7 Jun 2021 23:29:33 +0530 Message-ID: <20210607175943.31690-53-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.8.4 In-Reply-To: <20210607175943.31690-1-ndabilpuram@marvell.com> References: <20210306153404.10781-1-ndabilpuram@marvell.com> <20210607175943.31690-1-ndabilpuram@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-GUID: RH5hiEVXS1RoEz0cBbI1K0XKLEx-AIOt X-Proofpoint-ORIG-GUID: RH5hiEVXS1RoEz0cBbI1K0XKLEx-AIOt X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-06-07_14:2021-06-04, 2021-06-07 signatures=0 Subject: [dpdk-dev] [PATCH v2 52/62] net/cnxk: add get register operation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Satha Rao With this patch implemented api to dump platform registers for debug purposes. Signed-off-by: Satha Rao --- doc/guides/nics/cnxk.rst | 1 + doc/guides/nics/features/cnxk.ini | 1 + doc/guides/nics/features/cnxk_vec.ini | 1 + doc/guides/nics/features/cnxk_vf.ini | 1 + drivers/net/cnxk/cnxk_ethdev.c | 1 + drivers/net/cnxk/cnxk_ethdev.h | 4 ++++ drivers/net/cnxk/cnxk_ethdev_ops.c | 25 +++++++++++++++++++++++++ 7 files changed, 34 insertions(+) diff --git a/doc/guides/nics/cnxk.rst b/doc/guides/nics/cnxk.rst index 87401f0..98bcb51 100644 --- a/doc/guides/nics/cnxk.rst +++ b/doc/guides/nics/cnxk.rst @@ -32,6 +32,7 @@ Features of the CNXK Ethdev PMD are: - MTU update - Scatter-Gather IO support - Vector Poll mode driver +- Debug utilities - Context dump and error interrupt support - Support Rx interrupt Prerequisites diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini index b9c11b6..861b7c1 100644 --- a/doc/guides/nics/features/cnxk.ini +++ b/doc/guides/nics/features/cnxk.ini @@ -37,6 +37,7 @@ Stats per queue = Y Extended stats = Y FW version = Y Module EEPROM dump = Y +Registers dump = Y Linux = Y ARMv8 = Y Usage doc = Y diff --git a/doc/guides/nics/features/cnxk_vec.ini b/doc/guides/nics/features/cnxk_vec.ini index 6b9ce2d..65ee8ba 100644 --- a/doc/guides/nics/features/cnxk_vec.ini +++ b/doc/guides/nics/features/cnxk_vec.ini @@ -35,6 +35,7 @@ Stats per queue = Y Extended stats = Y FW version = Y Module EEPROM dump = Y +Registers dump = Y Linux = Y ARMv8 = Y Usage doc = Y diff --git a/doc/guides/nics/features/cnxk_vf.ini b/doc/guides/nics/features/cnxk_vf.ini index 5629d07..00bde9b 100644 --- a/doc/guides/nics/features/cnxk_vf.ini +++ b/doc/guides/nics/features/cnxk_vf.ini @@ -32,6 +32,7 @@ Stats per queue = Y Extended stats = Y FW version = Y Module EEPROM dump = Y +Registers dump = Y Linux = Y ARMv8 = Y Usage doc = Y diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c index d12e68d..a40625e 100644 --- a/drivers/net/cnxk/cnxk_ethdev.c +++ b/drivers/net/cnxk/cnxk_ethdev.c @@ -1198,6 +1198,7 @@ struct eth_dev_ops cnxk_eth_dev_ops = { .txq_info_get = cnxk_nix_txq_info_get, .tx_done_cleanup = cnxk_nix_tx_done_cleanup, .flow_ops_get = cnxk_nix_flow_ops_get, + .get_reg = cnxk_nix_dev_get_reg, }; static int diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h index 38ef0a9..e5a7e98 100644 --- a/drivers/net/cnxk/cnxk_ethdev.h +++ b/drivers/net/cnxk/cnxk_ethdev.h @@ -312,6 +312,10 @@ void *cnxk_nix_fastpath_lookup_mem_get(void); int cnxk_ethdev_parse_devargs(struct rte_devargs *devargs, struct cnxk_eth_dev *dev); +/* Debug */ +int cnxk_nix_dev_get_reg(struct rte_eth_dev *eth_dev, + struct rte_dev_reg_info *regs); + /* Inlines */ static __rte_always_inline uint64_t cnxk_pktmbuf_detach(struct rte_mbuf *m) diff --git a/drivers/net/cnxk/cnxk_ethdev_ops.c b/drivers/net/cnxk/cnxk_ethdev_ops.c index dbc7498..a15d87c 100644 --- a/drivers/net/cnxk/cnxk_ethdev_ops.c +++ b/drivers/net/cnxk/cnxk_ethdev_ops.c @@ -691,3 +691,28 @@ cnxk_nix_tx_done_cleanup(void *txq, uint32_t free_cnt) return 0; } + +int +cnxk_nix_dev_get_reg(struct rte_eth_dev *eth_dev, struct rte_dev_reg_info *regs) +{ + struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev); + struct roc_nix *nix = &dev->nix; + uint64_t *data = regs->data; + int rc = -ENOTSUP; + + if (data == NULL) { + rc = roc_nix_lf_get_reg_count(nix); + if (rc > 0) { + regs->length = rc; + regs->width = 8; + rc = 0; + } + return rc; + } + + if (!regs->length || + regs->length == (uint32_t)roc_nix_lf_get_reg_count(nix)) + return roc_nix_lf_reg_dump(nix, data); + + return rc; +} -- 2.8.4