SMP_PHY_TEST(8)

πŸ’… SMP_PHY_TEST(8) β€” the smp_utils glow-up ✨

okay so bestie, welcome to smp_phy_test from the SMP_UTILS collection, section 8 of the manual, we love a system-administration moment πŸŽ€


🌸 NAME 🌸

smp_phy_test β€” literally just invokes the PHY TEST FUNCTION SMP function, no cap πŸ’–


✨ SYNOPSIS ✨

smp_phy_test [--control=CO] [--dwords=DW] [--expected=EX]
[--function=FN]  [--help] [--hex] [--interface=PARAMS] [--linkrate=LR]
[--pattern=PA] [--phy=ID] [--raw] [--sa=SAS_ADDR] [--sata] [--spread=SC]
[--verbose] [--version] SMP_DEVICE[,N]

she's giving flags for days πŸ¦‹


🫢 DESCRIPTION 🫢

so what she actually does: she sends a SAS Serial Management Protocol (SMP) PHY TEST FUNCTION function request to an SMP target. the SMP target gets identified by the SMP_DEVICE plus the SAS_ADDR. depending on which interface you're on, the SAS_ADDR might just be deduced from the SMP_DEVICE, cute. the mpt interface uses SMP_DEVICE to identify a HBA (an SMP initiator) and it needs that extra ,N to tell HBAs apart if there's more than one hanging around πŸ™ˆ

the PHY TEST FUNCTION function can start and stop test pattern transmission. and here's the tea β˜•: when a phy associated with an SMP target (most likely an expander) starts test pattern transmission, then the attached phy (if there even is one) sees a link down πŸ’€ so yeah. that's the vibe.

SAS phys associated with SSP targets (e.g. a SAS disk) can generate similar test patterns by using the SEND DIAGNOSTIC SCSI command with page code 3fh. go check the sg_senddiag utility for that one πŸ’œ


πŸ‘‘ OPTIONS πŸ‘‘

mandatory arguments to long options are mandatory for short options as well. yes bestie, the rules apply both ways πŸŽ€

  • -c, --control=CO β€” sets the 'phy test pattern dwords control' field. CO can be anywhere from 0 to 255 inclusive, and the default is 0 (which means each byte in 'dwords' gets sent as a data byte (Dxx.y) without scrambling). heads up: this is only active when 'pattern' is set to 40h (i.e. "two_dwords") ⭐
  • -d, --dwords=DW β€” sets the 'phy test pattern dwords' field, which is 8 bytes long. DW would normally be entered in hex with a leading 0x or a trailing h (otherwise it's gonna be interpreted as decimal, oops). and due to a quirk in the command line parser, the argument value ffffffffffffffffh (i.e. all bits sets) needs to be entered as '-1' 😭 quirky fr fr
  • -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 (i.e. the expander) when the request arrives, then the target ignores the request and sets a function result of "invalid expander change count" in the response. it's giving ✨trust issues✨
  • -f, --function=FN β€” sets the 'phy test function' field in the SMP request. values between 0 and 255 are accepted, default is 0. the value 0 stops the selected phy from performing a phy test function. the value 1 starts the selected phy transmitting the test pattern (and anything that the phy receives is discarded, bye πŸ‘‹).
  • -h, --help β€” outputs the usage message then exits. classic 🫢
  • -H, --hex β€” outputs the response (less the CRC field) in hexadecimal πŸ’…
  • -I, --interface=PARAMS β€” interface specific parameters. in this case "interface" refers to the path through the operating system to the SMP initiator. go read the smp_utils man page for more info πŸ“–
  • -l, --linkrate=LR β€” transmits the test pattern at the specified physical link rate: 8 β†’ 1.5 Gbps, 9 β†’ 3 Gbps, 10 β†’ 6 Gbps, 11 β†’ 12 Gbps. default value is 0xa (i.e. 6 Gbps). and prior to version 0.99 the default value was 9 (i.e. 3 Gbps) β€” throwback era 😌
  • -P, --pattern=PA β€” specifies the type of test pattern to transmit. SPL-4 (rev 8) values are: 1 β†’ JTPAT, 2 β†’ CJTPAT, 3 β†’ PRBS9, 4 β†’ PRBS15, 10h β†’ TRAIN, 11h β†’ TRAIN_DONE, 12h β†’ IDLE, 13h β†’ SCRAMBLED_0, 40h β†’ TWO_DWORDS. the default value is 2 (i.e. CJTPAT) 🌈
  • -p, --phy=ID β€” phy identifier. ID is a value between 0 and 254. default is 0 πŸ¦‹
  • -r, --raw β€” sends the response (less the CRC field) to stdout in binary. all error messages go to stderr. keepin' em separated, iconic πŸ”₯
  • -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 has the target's SAS address within 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 πŸ’œ
  • -t, --sata β€” sets phy test function SATA bit. the default action is to leave that bit clear (zero) πŸ™ˆ
  • -S, --spread=SC β€” sets the phy test function Spread Spectrum Clocking (SSC) field to SC. default value is zero (no spreading). other defined values are 1 for centre spreading and 2 for down spreading 🌸
  • -v, --verbose β€” increases the verbosity of the output. can be used multiple times πŸ‘‘
  • -V, --version β€” prints the version string and then exits. short and sweet ⭐

🧚 CONFORMING TO 🧚

the SMP PHY TEST function was introduced in SAS-1.1 and enhanced in SAS-2. she's been through eras, and she ate every time πŸ’…


πŸ’– AUTHORS πŸ’–

written by Douglas Gilbert. king behaviour honestly πŸ‘‘


πŸ› REPORTING BUGS πŸ›

report bugs to <dgilbert at interlog dot com>. bestie will hear you out 🫢


copyright Β© 2006-2017 Douglas Gilbert

this software is distributed under a FreeBSD license. there is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. so if it breaks, that's on you, no cap πŸ’€


πŸ”— SEE ALSO πŸ”—

  • smp_utils
  • sg_senddiag(sg3_utils)

πŸ’Œ and that's the whole page, bestie! this was smp_utils-0.99, dated October 2017, and she's still serving. go forth and test those phys, you absolute main character πŸŒŸπŸ’–βœ¨