Skip to content

Commit a00584b

Browse files
author
Stefan Raspl
committed
smc_rnics: Suppress unknown non-networking devices
As reported by Test, non-networking devices are still visible (see last line): $ smc_rnics FID Power PCI ID PCHID Type Port PNET ID Interface ------------------------------------------------------------------------- 0 1 0000:00:00.0 0150 RoCE Express2 0 PERFNET enp0s0 40 1 000e:00:00.0 011c RoCE Express2 0 PERFNET enP14s40 80 1 000d:00:00.0 013c RoCE Express2 0 PERFNET enP13s80 c0 1 000c:00:00.0 0170 RoCE Express2 0 PERFNET enP12p0s0 800 1 0004:00:00.0 0110 144d:a822 To address this, we are now defaulting to supression of any unknown device in the default output. However, if option '-r' is specified, we still show all output, including non-networking devices - this can be useful in case an older version is run with later hardware. Note that it is tedious to blacklist all non-networking devices: Since users can add their own NVMe devices, we can never know what we will encounterin the wild. Signed-off-by: Stefan Raspl <raspl@linux.ibm.com>
1 parent 7d06ce6 commit a00584b

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

README.smctools

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ Release History:
5151
- smcss: Add further error codes to man page
5252

5353
Bug fixes:
54+
- smcss: Display more than 321 connections
55+
- smc_rnics: Suppress any unknown non-networking device unless
56+
option -r is specified
5457

5558
1.3.0 (2020-06-16)
5659
Changes:

smc_rnics

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,14 @@ function print_rnics() {
8888
vend=`cat vendor`;
8989
dev_type="${vend#0x}:${id#0x}";
9090
if [ $rawIDs -eq 0 ]; then
91+
# suppress all output except the devices we know
9192
case "$vend" in
9293
"0x1014" ) # IBM
9394
case "$id" in
9495
"0x04ed") dev_type="ISM";
9596
int="n/a";;
96-
"0x044b") continue;; # zEDC
97+
*)
98+
continue;
9799
esac;;
98100
"0x15b3" ) # Mellanox
99101
case "$id" in
@@ -108,7 +110,11 @@ function print_rnics() {
108110
port=1;
109111
fi
110112
fi;;
113+
*)
114+
continue;
111115
esac;;
116+
*)
117+
continue;
112118
esac
113119
fi
114120
pchid="`cat pchid | sed 's/^0x//'`";

smc_rnics.8

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ usage information.
5252
Display IB device information.
5353
.TP
5454
.BR "\-r, \-\-rawids"
55-
Display raw PCI vendor and device codes in column
55+
Display raw PCI vendor and device codes in column. Note that this will
56+
also toggle display of non-networking realted devices.
5657
.I Type
5758
. .
5859
.TP

0 commit comments

Comments
 (0)