ethtool: fbnic: ethtool dump parser
Subsystems (3)
PATCH 1/1 ethtool: fbnic: ethtool dump parser
This patch adds support for parsing the register dump for fbnic.
The patch is composed of several register sections, and each of these sections is dumped lineraly except for the RPC_RAM section which is handled differently.
For each of the sections, we dump register name, its value, the bit mask of any subfields within that register, the name of the subfield, and the corresponding value.
Furthermore, there may be unused blocks within a section; we skip such blocks while dumping registers linearly.
Validation:
- Validate patch applies to master without any warning
- Validate 'ethtool -d' for net-next branch generates ascii dump
$ uname -r 6.14.0-0_fbk701_rc0_429_g8e5edf971d0 $ ./ethtool -d eth0 > /tmp/fbnic_ascii_dump
--- Makefile.am | 2 +- ethtool.c | 1 + fbnic.c | 25504 ++++++++++++++++++++++++++++++++++++++++++++++++++ internal.h | 2 + 4 files changed, 25508 insertions(+), 1 deletion(-) create mode 100644 fbnic.c
Makefile.am +1 -1
@@ -23,7 +23,7 @@ ethtool_SOURCES += \ smsc911x.c at76c50x-usb.c sfc.c stmmac.c \ sff-common.c sff-common.h sfpid.c sfpdiag.c \ ixgbevf.c tse.c vmxnet3.c qsfp.c qsfp.h fjes.c lan78xx.c \ - igc.c cmis.c cmis.h bnxt.c cpsw.c lan743x.c hns3.c + igc.c cmis.c cmis.h bnxt.c cpsw.c lan743x.c hns3.c fbnic.c endif if ENABLE_BASH_COMPLETION
ethtool.c +1 -0
@@ -1206,6 +1206,7 @@ static const struct { { "fsl_enetc", fsl_enetc_dump_regs }, { "fsl_enetc_vf", fsl_enetc_dump_regs }, { "hns3", hns3_dump_regs }, + { "fbnic", fbnic_dump_regs }, }; #endif
fbnic.c new file +25504 -0
2,985 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.43.5
Part of the diff is not shown here. View the raw message.
Quoted 16 lines · Mohsin Bashir
This patch adds support for parsing the register dump for fbnic.
The patch is composed of several register sections, and each of these sections is dumped lineraly except for the
RPC_RAMsection which is handled differently.For each of the sections, we dump register name, its value, the bit mask of any subfields within that register, the name of the subfield, and the corresponding value.
Furthermore, there may be unused blocks within a section; we skip such blocks while dumping registers linearly.
Validation:
- Validate patch applies to master without any warning
- Validate 'ethtool -d' for net-next branch generates ascii dump
Quoted 6 lines
$ uname -r 6.14.0-0_fbk701_rc0_429_g8e5edf971d0 $ ./ethtool -d eth0 > /tmp/fbnic_ascii_dumpSigned-off-by Mohsin Bashir <[email protected]>---
Hello,
the patch introduces warnings (see below) when compiled on i386 (32-bit), can you check?
Thank you,
Michal
fbnic.c: In function ‘fbnic_dump_fb_nic_intr_global’:
fbnic.c:5679:16: error: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
5679 | if (nn != regs_buff - section_start) {
| ^~fbnic.c: In function ‘fbnic_dump_fb_nic_intr_msix’:
fbnic.c:5773:16: error: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
5773 | if (nn != regs_buff - section_start) {
| ^~fbnic.c: In function ‘fbnic_dump_fb_nic_qm_tx_global’:
fbnic.c:6255:16: error: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
6255 | if (nn != regs_buff - section_start) {
| ^~fbnic.c: In function ‘fbnic_dump_fb_nic_qm_rx_global’:
fbnic.c:6705:16: error: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
6705 | if (nn != regs_buff - section_start) {
| ^~fbnic.c: In function ‘fbnic_dump_fb_nic_tce’:
fbnic.c:7404:16: error: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
7404 | if (nn != regs_buff - section_start) {
| ^~fbnic.c: In function ‘fbnic_dump_fb_nic_tce_ram’:
fbnic.c:7535:16: error: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
7535 | if (nn != regs_buff - section_start) {
| ^~fbnic.c: In function ‘fbnic_dump_fb_nic_tmi’:
fbnic.c:7918:16: error: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
7918 | if (nn != regs_buff - section_start) {
| ^~fbnic.c: In function ‘fbnic_dump_fb_nic_ptp’:
fbnic.c:8087:16: error: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
8087 | if (nn != regs_buff - section_start) {
| ^~fbnic.c: In function ‘fbnic_dump_fb_nic_rxb’:
fbnic.c:9154:16: error: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
9154 | if (nn != regs_buff - section_start) {
| ^~fbnic.c: In function ‘fbnic_dump_fb_nic_rpc’:
fbnic.c:9942:16: error: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
9942 | if (nn != regs_buff - section_start) {
| ^~fbnic.c: In function ‘fbnic_dump_fb_nic_rpc_ram’:
fbnic.c:10176:16: error: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
10176 | if (nn != regs_buff - section_start) {
| ^~fbnic.c: In function ‘fbnic_dump_fb_nic_fab’:
fbnic.c:10598:16: error: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
10598 | if (nn != regs_buff - section_start) {
| ^~fbnic.c: In function ‘fbnic_dump_fb_nic_master’:
fbnic.c:11534:16: error: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
11534 | if (nn != regs_buff - section_start) {
| ^~fbnic.c: In function ‘fbnic_dump_fb_nic_mac_pcs’:
fbnic.c:12251:16: error: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
12251 | if (nn != regs_buff - section_start) {
| ^~fbnic.c: In function ‘fbnic_dump_fb_nic_mac_rsfec’:
fbnic.c:12619:16: error: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
12619 | if (nn != regs_buff - section_start) {
| ^~fbnic.c: In function ‘fbnic_dump_fb_nic_mac_mac’:
fbnic.c:13495:16: error: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
13495 | if (nn != regs_buff - section_start) {
| ^~fbnic.c: In function ‘fbnic_dump_fb_nic_pcie_ss_comphy’:
fbnic.c:21516:16: error: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
21516 | if (nn != regs_buff - section_start) {
| ^~fbnic.c: In function ‘fbnic_dump_fb_nic_sig’:
fbnic.c:22359:16: error: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
22359 | if (nn != regs_buff - section_start) {
| ^~fbnic.c: In function ‘fbnic_dump_fb_nic_pul_user’:
fbnic.c:24349:16: error: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
24349 | if (nn != regs_buff - section_start) {
| ^~fbnic.c: In function ‘fbnic_dump_fb_nic_queue’:
fbnic.c:25416:16: error: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
25416 | if (nn != regs_buff - section_start) {
| ^~fbnic.c: In function ‘fbnic_dump_regs’:
fbnic.c:25495:46: error: comparison of integer expressions of different signedness: ‘int’ and ‘__u32’ {aka ‘unsigned int’} [-Werror=sign-compare]
25495 | if ((regs_buff - section_start) << 2 != regs->len) {
| ^~
fbnic.c:25498:51: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘int’ [-Werror=format=]
25498 | fprintf(stderr, "dwords [bytes] %lu\n",
| ~~^
| |
| long unsigned int
| %u
25499 | (regs_buff - section_start) << 2);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int