IBPORTSTATE(8)
β¨ IBPORTSTATE β¨
okay bestie, this is the ibportstate page from the Open IB Diagnostics fam β it lives in section 8 of the manual (the sysadmin-y one, iykyk) π
π NAME π
IBPORTSTATE β handle port (physical) state and link speed of an InfiniBand port π¦
πΈ SYNOPSIS πΈ
ibportstate [options] <dest dr_path|lid|guid> <portnum> [<op>]
β¨ DESCRIPTION β¨
so ibportstate is literally your girl for asking about the port state and port physical state of an IB port β that's the query part. and btw, when the port you're querying is a switch port, it also validates link width and speed against the peer port π
but it's not just a look-but-don't-touch situation. you can also use it to disable, enable, or reset a switch port. and here's the tea: an InfiniBand HCA port state can be changed locally without the Subnet Manager even knowing π (no cap, it just doesn't know).
and if that wasn't enough, it also lets you adjust the link speed/width enabled on any IB port. versatile queen π
π OPTIONS π
π <op> π
Supported ops, in order, exactly as listed: enable, disable, reset, speed, espeed, fdr10, width, query, on, off, down, arm, active, vls, mtu, lid, smlid, lmc, mkey, mkeylease, mkeyprot.
Default op is query β if you don't pick one, that's what you get π«Ά
now let's break the noteworthy ones down:
enable,disable, andresetβ change or reset a switch or HCA port state. β οΈ psst: you must specify the CA name and Port number when locally changing CA port state.offβ changes the port state to disable.onβ changes the port state to enable, but only when the current state is disable. it's giving conditional queen.speedandwidthβ allowed on any port πspeedvalues β these are the legal values forPortInfo:LinkSpeedEnabled. ifPortInfo:LinkSpeedSupporteddoesn't support the setting, you get an error. periodt.espeedβ allowed on any port that supports extended link speeds.fdr10β allowed on any port supporting fdr10. you get an error if the port's capability mask says extended link speeds aren't supported, or ifPortInfo:LinkSpeedExtSupporteddoesn't support the setting.widthvalues β legal values forPortInfo:LinkWidthEnabled. error ifPortInfo:LinkWidthSupporteddoesn't support the setting.
π¨ NOTE: speed and width changes are not effected until the port goes through link renegotiation. so don't @ me when nothing changes instantly, bestie.
queryβ also validates port characteristics (link width, speed, espeed, and fdr10) based on the peer port. this checking happens when the queried port is a switch port, because it relies on combined routing (an initial LID route with directed routing to the peer) β and that can only be done on a switch. and this whole peer port validation feature of thequeryop requires LID routing to be functioning in the subnet. π₯mkey,mkeylease, andmkeyprotβ only allowed on CAs, routers, or switch port 0. if you try it on external switch ports, you get an error, sorry babe π- hexadecimal and octal mkeys: prepend the key with
0xor0, respectively. - if you specify a non-numeric value (like
'x') for the mkey,ibportstatewill prompt for a value. interactive icon β¨
- hexadecimal and octal mkeys: prepend the key with
π Addressing Flags π
-L,--Lidβ the address specified is a LID-G,--Guidβ the address specified is a Port GUID-D,--Directβ the address specified is a directed route
Examples:
[options] -D [options] "0" # self port
[options] -D [options] "0,1,2,1,4" # out via port 1, then 2, ...
(Note: the second number in the path you specify must match the port being used. you can set that with the port selection flag -P, or let the automatic selection process find the port for you.)
-s,--sm_port <smlid>β use'smlid'as the target lid for SA queries.
π¦ Port Selection flags π¦
-C,--Ca <ca_name>β use the specified ca_name.-P,--Port <ca_port>β use the specified ca_port.-Y,--pkey-idx <idx>β P_Key table index (0-65535, default0) used for the outgoing SA/GMP MADs. SMP (SMI directed-route/LID-routed) MADs always use P_Key index 0. no exceptions, bestie.
π Local port Selection π
Multiple port / Multiple CA support, hear me out: when no IB device or port is specified (see the "local umad parameters" below), the libibumad library picks the port using these criteria, in order:
- the first port that is
ACTIVE. - if not found, the first port that is
UP(physical link up).
If a port and/or CA name is specified, libibumad tries to fulfill your request, and will simply fail if it can't. it's not gonna guess for you π
for example:
ibaddr # use the first port (criteria #1 above)
ibaddr -C mthca1 # pick the best port from "mthca1" only.
ibaddr -P 2 # use the second (active/up) port from the first available IB device.
ibaddr -C mthca0 -P 2 # use the specified port only.
π Configuration flags π
--config,-z<config_file>β specify alternate config file. Default:/etc/infiniband-diags/ibdiag.conf-t,--timeout <timeout_ms>β override the default timeout for the solicited mads.-y,--m_key <key>β use the specified M_key for requests. if a non-numeric value (like'x') is specified, then a value will be prompted for.
π§ Debugging flags π§
-h,--helpβ show the usage message-dβ raise the IB debugging level. may be used several times (-dddor-d -d -d).-eβ show send and receive errors (timeouts and others)-K,--show_keysβ show security keys (mkey, smkey, etc.) associated with the request. π-v,--verboseβ increase the application verbosity level. may be used several times (-vvor-v -v -v).-V,--versionβ show the version info.
π FILES π
π CONFIG FILE π
/etc/infiniband-diags/ibdiag.conf
A global config file is provided to set some of the common options for all tools. see the supplied config file for details, bestie π
π₯ EXAMPLES π₯
ibportstate -C qib0 -P 1 3 1 disable # by CA name, CA Port Number, lid, physical port number
ibportstate -C qib0 -P 1 3 1 enable # by CA name, CA Port Number, lid, physical port number
ibportstate -D 0 1 # (query) by direct route
ibportstate 3 1 reset # by lid
ibportstate 3 1 speed 1 # by lid
ibportstate 3 1 width 1 # by lid
ibportstate -D 0 1 lid 0x1234 arm # by direct route
π AUTHOR π
Hal Rosenstock < <hal.rosenstock@gmail.com> >
and that's a wrap, babe π«Ά this lil masterpiece? it's dated 2013-03-26 and it comes to you from the Open IB Diagnostics crew, living its best life as IBPORTSTATE(8). go forth and query, mwah πβ¨
π¦ where this page comes from
- arch rolling: rdma-core 65.0-1 Β· GPL-2.0-or-later OR LicenseRef-OpenIB.org-BSD-MIT AND GPL-2.0-or-later OR LicenseRef-OpenIB.org-BSD-FreeBSD AND GPL-2.0-or-later OR LicenseRef-Intel-BSD-3-Clause AND GPL-2.0-or-later OR LicenseRef-PathScale-BSD-Patent-License AND CC0-1.0 AND MIT AND BSD-2-Clause AND CPL-1.0 OR BSD-2-Clause OR GPL-2.0-or-later
- ubuntu stonking: infiniband-diags 64.0-1ubuntu1 Β· BSD-MIT OR GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms