Skip to content

Commit 1b4d78b

Browse files
author
Stefan Raspl
committed
smc_rnics: Recognize RoCE Express3 cards
Signed-off-by: Stefan Raspl <raspl@linux.ibm.com>
1 parent 7eaa0f6 commit 1b4d78b

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Release History:
4242
* __v1.8.99 (tbd)__
4343

4444
Changes:
45+
- `smc_rncs`: Recognize RoCE Express3 cards
4546

4647
Bug fixes:
4748

smc_rnics

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,23 @@ function set_RoCE_dev_and_port() {
9494
fi;
9595
}
9696

97+
function set_by_firmware_lvl() {
98+
local iface;
99+
local name;
100+
local lvl;
101+
102+
name="Mlx_$id";
103+
which ethtool >/dev/null 2>&1;
104+
if [ $? -eq 0 ] && [ "$int" != "n/a" ] && [ -d "net" ]; then
105+
iface="`ls -1 net | head -1`";
106+
lvl="`ethtool -i $iface | grep -e "^firmware-version:" | awk '{print($2)}'`";
107+
if [ "${lvl%%.*}" == "22" ]; then
108+
name="RoCE_Express3";
109+
fi
110+
fi
111+
set_RoCE_dev_and_port $name;
112+
}
113+
97114
function print_rnics() {
98115
# iterate over slots, as powered-off devices won't show elsewhere
99116
for fid in `ls -1 /sys/bus/pci/slots`; do
@@ -148,6 +165,7 @@ function print_rnics() {
148165
"0x1003" | \
149166
"0x1004") dev_type="RoCE_Express";;
150167
"0x1016") set_RoCE_dev_and_port "RoCE_Express2";;
168+
"0x101e") set_by_firmware_lvl;;
151169
*) set_RoCE_dev_and_port "Mlx_$id";;
152170
esac;;
153171
*) [ $all -eq 0 ] && continue

0 commit comments

Comments
 (0)