Commit a63bcf1
committed
ibstat: ignore non-RDMA endpoint devices when umad_get_ca() fails
When umad_get_ca() fails, ibstat currently propagates the error even for
devices that are not usable RDMA endpoints.
Add lightweight sysfs checks to detect non-endpoint devices by verifying
either the presence of port GID 0 (ports/<n>/gids/0) or the Connection
Manager capability bit (port cap_mask bit 16). If neither is present,
treat the device as non-RDMA and return 0 instead of failing.
This improves behavior on systems exposing non-endpoint IB-class devices
under /sys/class/infiniband/.
Signed-off-by: Nagappan Ramasamy Palaniappan <nagappan.ramasamy.palaniappan@oracle.com>1 parent cc0e95c commit a63bcf1
1 file changed
Lines changed: 50 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
| |||
193 | 198 | | |
194 | 199 | | |
195 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
196 | 232 | | |
197 | 233 | | |
198 | 234 | | |
199 | | - | |
200 | | - | |
201 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
202 | 248 | | |
| 249 | + | |
203 | 250 | | |
204 | 251 | | |
205 | 252 | | |
| |||
0 commit comments