Some SAS JBODs support zoning. This feature allows individual SAS
targets to be accessible by only some initiator ports. One application
would be connecting two servers to the same JBOD, but they wouldn't be
able to see each other's disks.
A zoned JBOD should also prohibit initiators from accessing SES elements
corresponding to inaccessible SAS targets. It reports that by setting
the element's status code to 0x8 (No Access Allowed).
The bug is that when doing "sesutil (fault|locate) all ...", sesutil
will attempt a ENCIOC_SETELMSTAT ioctl for every single element, even
the inaccessible ones. The enclosure will reject the command, the
kernel will return EINVAL, and sesutil will exit.
The solution is to check the element's status, and skip trying to set it
if the status is 0x8. But if the user actually supplied a ses ID, then
assume that he knows what he's doing and try to set it anyway.
PR: 270093
MFC after: 1 week
Sponsored by: Axcient
Reviewed by: mav, trasz
Differential Revision: https://reviews.freebsd.org/D39017
The tests require SES hardware. Without it, the test cases will be
skipped.
Reviewed by: ken
Differential Revision: https://reviews.freebsd.org/D31809
Sponsored by: Axcient
MFC after: 2 weeks
Weird side of SES specification is that some bits have different
meaning or semantics in status and control pages. This patch fixes
non-zero writes into reserved fields, that caused errors on some
enclosures when trying to control locate/fault LEDs, keeping other
bits unchanged.
MFC after: 2 weeks
Sposonred by: iXsystems, Inc.
Previously we would display "OK, Swapped" for swapped disks,
instead of the usual disk size.
Reviewed By: allanjude
Differential Revision: https://reviews.freebsd.org/D31219
Instead of calloc()ing (and forgetting to free) in a tight loop, just put
this small array on the stack.
Reported by: Coverity
Coverity CID: 1331665
MFC after: 2 weeks
Sponsored by: Axcient
sesutil would allow the user to toggle an LED that was one past the maximum
element. If he tried, ENCIOC_GETELMSTAT would return EINVAL.
Reported by: Coverity
Coverity CID: 1398940
MFC after: 2 weeks
Sponsored by: Axcient
With r319610, sesutil started twiddling the bits of every SES device.
Not everything is a disk slot, there are also fan controllers, temperature
sensors, even power supplies, among other things controlled by SES.
Add a type check to make sure we are only operating on device slot and array
device slot elements. Other type elements will be skipped, but it would be
simple to add additional cases for controlling the ident LEDs of other
element types (which are not necessarily the same bits).
Rather than doing raw bit manipulation of an unstructured byte array using
unnamed numeric constants, leverage existing code abstractions.
Submitted by: Ryan Moeller <ryan@freqlabs.com>
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D19052
then printing it.
This prepares the code to make it libxo friendly
Reviewed by: manu, Nikita Kozlov (nikita elyzion.net)
MFC after: 2 weeks
Sponsored by: Gandi.net
Rework stat2ascii preparing a buffer of what could be printed. This prevent the
risk of overflowing a static buffer.
Do not print those informations anymore in the "status" but into a new
"extra status" only printed if there are actually extra things to print.
Now add those extra informations:
* Thermal sensor temperature
* Cooling devices speed
* Voltage sensors, current consumption
Tested by: AllanJude
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D4520
- Return an error if no matching device is found when the locate command is run
- Enhance the locate command to be able to address drive bays with no disk, or where the SES controller has not made the mapping to the device name
- Added the fault command, similar to locate, but a different SES property. On some of my controllers locate blinks the activity light, others the fault light. The fault command keeps the fault light on constant.
- Improve the usage() output and use it everywhere
- Added the map command, displays all elements connected to each (or the specified) ses(4) controller
- Added the status command, returns the overall status of the ses(4) controller
Reviewed by: wblock (man page, earlier version)
Approved by: bapt (mentor)
MFC after: 3 weeks
Relnotes: yes
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D3580
This is an utility for managing SCSI Enclosure Services (SES) device.
For now only one command is supported "locate" which will change the test of the
external LED associated to a given disk.
Usage if the following:
sesutil locate disk [on|off]
Disk can be a device name: "da12" or a special keyword: "all".
Reviewed by: mav
MFC after: 1 month
Relnotes: yes
Sponsored by: gandi.net
Differential Revision: https://reviews.freebsd.org/D3544