SES: Correctly interpret element index field when EIIOE=1#278
SES: Correctly interpret element index field when EIIOE=1#278cjs-nexsan wants to merge 1 commit into
Conversation
|
Hey @cjs-nexsan |
|
Apologies for not marking this as draft. Yes, the issue is still valid and I believe the fix is correct (subject to review). As there were issues with how I submitted PR#277, I was waiting until that was completed to confirm I understood the process before finalising this change (rebasing, squashing, and updating the commit comment). I'll aim to do that in the next few days. |
138c5bc to
907cdcc
Compare
In SES-3, the EIIOE field indicates whether the ELEMENT INDEX field includes overall elements. If EIIOE=1, ELEMENT INDEX includes overall elements. For all other values of EIIOE, ELEMENT INDEX excludes overall elements. There will be one overall element per element type (including the current one). Signed-off-by: Chris Smith <csmith@nexsan.com>
|
@mtkaczyk This PR should now be properly formed. |
|
Thanks @cjs-nexsan |
|
Yes, I'm confident the fix is correct and compliant with the published SES-3 specification (table 34, defining a 2-bit EIIOE field, previously reserved in SES-2). |
|
I'll build and test on my SES hardware, and give it a review tomorrow. |
Issue:
If an SES enclosure reports elements using EIIOE=1 (defined in SES-3), the mapping of SAS devices to slots is offset by 1, causing the incorrect LEDs to be changed.
Cause:
When parsing Additional Element Status descriptors, ledmon does not correctly interpret the SES ELEMENT INDEX field when EIIOE=1; it assumes the SES-2 interpretation where ELEMENT INDEX does not include overall elements. The EIIOE field is defined in SES-3, where an EIIOE=1 indicates that the ELEMENT INDEX field includes overall elements.
Solution:
As the (Array) Device Slot elements are required to be first in the list, there will be exactly one overall element prior to the individual (Array) Device Slot elements, so subtracting one from ELEMENT_INDEX if EIIOE=1 produces the same 0-based individual element index as assumed elsewhere.