Re: [dpdk-dev] [PATCH] app/procinfo: add device registers dump
From: Pattan, Reshma <hidden>
Date: 2021-06-10 16:25:42
From: Pattan, Reshma <hidden>
Date: 2021-06-10 16:25:42
-----Original Message----- From: Chengchang Tang <tangchengchang@huawei.com>
quoted
quoted
+ ret = rte_eth_dev_get_reg_info(i, ®_info); + if (ret) { + printf("Error getting device reg info: %d\n", ret); + continue; + } + + buf_size = reg_info.length * reg_info.width;If it is to get the regs length, you can directly call"rte_ethtool_get_regs_len(uint16_t port_id)" API , instead of again writing the above logic.quoted
And use the returned length in below malloc.This logic is indeed identical to the logic of the "rte_ethtool_get_regs_len" API of Ethtool, but the method of using the "rte_eth_dev_get_reg_info" API is the case. All users will have similar code logic when using this API.
Oh yes, my bad, I overlooked it. It makes complete sense now.