SMP_PHY_CONTROL(8)

πŸ’– SMP_PHY_CONTROL(8) πŸ’–

okay bestie, welcome to smp_phy_control from the smp_utils squad β€” she's an 8th-section manual page and she's serving. pull up a chair, we're doing PHY CONTROL today πŸ¦‹


✨ NAME ✨

smp_phy_control β€” invoke the PHY CONTROL SMP function πŸ’…


✨ SYNOPSIS ✨

smp_phy_control [--attached=ADN] [--expected=EX] [--help] [--hex]
[--interface=PARAMS] [--max=MA] [--min=MI] [--op=OP] [--phy=ID]
[--pptv=TI] [--pwrdis=PDC] [--raw] [--sa=SAS_ADDR] [--sas_pa=CO]
[--sas_sl=CO] [--sata_pa=CO] [--sata_sl=CO] [--verbose] [--version]
SMP_DEVICE[,N]

✨ DESCRIPTION ✨

So basically this sends a SAS Serial Management Protocol (SMP) PHY CONTROL function request to an SMP target. 🌸

The SMP target gets identified by the SMP_DEVICE and the SAS_ADDR. Depending on which interface you're using, the SAS_ADDR might just be deduced from the SMP_DEVICE β€” she's lowkey self-sufficient like that. The mpt interface uses SMP_DEVICE to identify a HBA (that's an SMP initiator), and it needs the extra ,N to tell the HBAs apart if there's more than one hanging around. iykyk πŸ‘‘

The PHY CONTROL function is the one you call when you want to change the state of a phy inside an SMP target. SMP targets are typically SAS expanders, which have so many phys, like a whole friend group. 🫢 Some operation values β€” 'lr' (link reset) and 'hr' (hard reset), for example β€” change the state of the attached phy. And here's the tea: if you send those operation values to the phy in the SMP target that's attached to the originator (that's the SMP initiator), you might get a bad response. 😭 not the vibe.

✨ Fun fact: running this utility with no arguments at all (other than SMP_DEVICE, which might be chilling in an environment variable, and --sa=SAS_ADDR, which might also be in an environment variable or might not even be needed) is harmless. Like, genuinely. In other words, a phy's state only changes when either --max=MA, --min=MI, --op=OP or --pptv=TI is given with a non-default value. No accidental chaos, we love to see it. πŸ’–

✨ OPTIONS ✨

Mandatory arguments to long options are mandatory for short options too, bestie. no exceptions. πŸ’…

  • -a, --attached=ADN β€” specifies the attached device name (ADN). Default is 0. The ADN is in decimal, but it's probably gonna be a SAS address, which is typically shown in hexadecimal. To give a number in hexadecimal, either prefix it with '0x' or slap a trailing 'h' on it. This option gets ignored by the expander unless you also give the --op=sadn option. πŸ™ˆ
  • -E, --expected=EX β€” sets the 'expected expander change count' field in the SMP request. EX goes from 0 to 65535 inclusive, and 0 is the default. When EX is greater than zero, then if the value doesn't match the expander change count of the SMP target (aka the expander) when the request arrives, the target just ignores the request and sets a function result of "invalid expander change count" in the response. periodt. 😀
  • -h, --help β€” outputs the usage message, then exits. classic. ✨
  • -H, --hex β€” outputs the response (minus the CRC field) in hexadecimal.
  • -I, --interface=PARAMS β€” interface specific parameters. In this case "interface" means the path through the operating system to the SMP initiator. Go read the smp_utils man page for more info. πŸ“–
  • -M, --max=MA β€” lets the programmed maximum physical link rate be changed on the given phy. Permitted values are:
  0  : no change
  8  : 1.5 Gbps
  9  : 3 Gbps
  10 : 6 Gbps
  11 : 12 Gbps
  12 : 22.5 Gbps

Default value is 0. (no change, we're being good today πŸŽ€)

  • -m, --min=MI β€” lets the programmed minimum physical link rate be changed on the given phy. Permitted values are:
  0  : no change
  8  : 1.5 Gbps
  9  : 3 Gbps
  10 : 6 Gbps
  11 : 12 Gbps
  12 : 22.5 Gbps

Default value is 0.

  • -o, --op=OP β€” specifies the operation to be performed on the given phy. OP can be either numeric or a string. If you give a number, it gets put into the 'phy operation' field of the request. Allowable strings are abbreviations where only the first two characters need to match. Each line below has a numeric value, a string, and a lil explanation:
  0 : nop  : no operation
  1 : lr   : link reset
  2 : hr   : hard reset
  3 : dis  : disable phy
  5 : cel  : clear error log
  6 : ca   : clear affiliation
  7 : tspss: transmit SATA port selection signal
  8 : citnl: clear STP I_T nexus loss (bit)
  9 : sadn : set attached device name

Default value is 0 (no operation).

  • -p, --phy=ID β€” phy identifier. ID is a value between 0 and 254. Default is 0. πŸ”₯
  • -P, --pptv=TI β€” partial pathway timeout value. Units are microseconds and permitted values are between 0 and 15 inclusive. 7 microseconds is what sas2r07 recommends. πŸ’œ
  • -D, --pwrdis=PDC β€” where PDC is the power disable control value. Default is 0, which means no change. The value of 1 is reserved; 2, if supported, tells the management device server to negate the POWER DISABLE signal; while 3, if supported, tells it to assert that signal. This applies to the phy given by ID (which defaults to 0). ⚑
  • -r, --raw β€” sends the response (minus the CRC field) to stdout in binary. All error messages go to stderr. keeping things separated, as she should. 🫢
  • -s, --sa=SAS_ADDR β€” specifies the SAS address of the SMP target device. Typically this is an expander. This option may not be needed if the SMP_DEVICE already has the target's SAS address inside it. The SAS_ADDR is in decimal, but most SAS addresses are shown in hexadecimal. To give a number in hexadecimal, either prefix it with '0x' or put a trailing 'h' on it. 🌈
  • -q, --sas_pa=CO β€” sets the Enable SAS Partial field to CO, which is two bits wide. The defined values for CO are 0 for no change; 1 for manage partial phy power conditions; 2 for disable partial phy power conditions.
  • -l, --sas_sl=CO β€” sets the Enable SAS Slumber field to CO, which is two bits wide. The defined values for CO are 0 for no change; 1 for manage slumber phy power conditions; 2 for disable slumber phy power conditions.
  • -Q, --sata_pa=CO β€” sets the Enable SATA Partial field to CO, which is two bits wide. The defined values for CO are 0 for no change; 1 for manage partial phy power conditions; 2 for disable partial phy power conditions.
  • -L, --sata_sl=CO β€” sets the Enable SATA Slumber field to CO, which is two bits wide. The defined values for CO are 0 for no change; 1 for manage slumber phy power conditions; 2 for disable slumber phy power conditions.
  • -v, --verbose β€” increases the verbosity of the output. Can be used multiple times. go off, stack those -vs πŸ“ˆ
  • -V, --version β€” prints the version string, then exits.

✨ NOTES ✨

Once an expander phy has been disabled with --op=dis, it can later be re-enabled with a link reset or a hard reset (e.g. --op=lr). so like... it's not forever, she just needed a nap πŸ˜΄πŸ’–


✨ EXAMPLES ✨

See the "Examples" section over at http://sg.danny.cz/sg/smp_utils.html 🌸


✨ CONFORMING TO ✨

The SMP PHY CONTROL function was introduced in SAS-1. an icon, an OG, a legend πŸ‘‘


✨ AUTHORS ✨

Written by Douglas Gilbert.


✨ REPORTING BUGS ✨

Report bugs to <dgilbert at interlog dot com>. πŸ“¬


Copyright Β© 2006-2015 Douglas Gilbert

This software is distributed under a FreeBSD license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

🫢 bestie that's the legal way of saying "if it breaks, that's on you". read it, respect it, move on.

✨ SEE ALSO ✨

smp_utils, smp_discover(smp_utils)


and that's the whole page, no cap πŸ’œ this was smp_utils-0.99, dated November 2015, and yes she's still out here serving PHY CONTROL realness. mwah πŸ’…βœ¨