Thread (15 messages) 15 messages, 5 authors, 2021-07-30

Re: [dpdk-dev] [PATCH] app/procinfo: add device registers dump

From: Chengchang Tang <tangchengchang@huawei.com>
Date: 2021-07-19 06:40:39

On 2021/7/18 1:51, Stephen Hemminger wrote:
On Sun, 25 Apr 2021 21:02:22 +0800
"Min Hu (Connor)" [off-list ref] wrote:
quoted
+
+		memset(&reg_info, 0, sizeof(reg_info));
+		memset(&dev_info, 0, sizeof(dev_info));
This memset is redundant, rte_eth_dev_info_get already has the same memset.
For the registers, ethdev should be fixed to do it.
The memset for dev_info is indeed redundant. But the memset for reg_info seems
reasonable, because there are some input parameters in reg_info.

E.g. If info->data is NULL the get_reg_info() fills in the width and length
fields. If non-NULL the registers are put into the buffer pointed at by the data
field.

So, I will remove the redundant memset for dev_info, and keep the memset for reg_info
in the next version.
quoted
+
+		ret = rte_eth_dev_info_get(i, &dev_info);
+		if (ret) {
+			printf("Error getting device info: %d\n", ret);
+			continue;
+		}
+
+		ret = rte_eth_dev_get_reg_info(i, &reg_info);
+		if (ret) {
+			printf("Error getting device reg info: %d\n", ret);
+			continue;
+		}
.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help