Skip to content

SES: Correctly interpret element index field when EIIOE=1#278

Open
cjs-nexsan wants to merge 1 commit into
md-raid-utilities:mainfrom
cjs-nexsan:ses-eiioe-support
Open

SES: Correctly interpret element index field when EIIOE=1#278
cjs-nexsan wants to merge 1 commit into
md-raid-utilities:mainfrom
cjs-nexsan:ses-eiioe-support

Conversation

@cjs-nexsan

Copy link
Copy Markdown
Contributor

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.

@mtkaczyk

mtkaczyk commented Jul 1, 2026

Copy link
Copy Markdown
Member

Hey @cjs-nexsan
is it still valid?

@cjs-nexsan
cjs-nexsan marked this pull request as draft July 1, 2026 12:44
@cjs-nexsan

Copy link
Copy Markdown
Contributor Author

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.

@cjs-nexsan cjs-nexsan closed this Jul 3, 2026
@cjs-nexsan
cjs-nexsan force-pushed the ses-eiioe-support branch from 138c5bc to 907cdcc Compare July 3, 2026 08:01
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>
@cjs-nexsan cjs-nexsan reopened this Jul 3, 2026
@cjs-nexsan
cjs-nexsan marked this pull request as ready for review July 3, 2026 08:22
@cjs-nexsan

Copy link
Copy Markdown
Contributor Author

@mtkaczyk This PR should now be properly formed.

@mtkaczyk

mtkaczyk commented Jul 3, 2026

Copy link
Copy Markdown
Member

Thanks @cjs-nexsan
Honestly, I have totally no clue what you are fixing and what this "overall elements" hell is.
You have my ack- if that works for you then I'm confident enough to merge it.

@cjs-nexsan

Copy link
Copy Markdown
Contributor Author

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).

@tasleson

Copy link
Copy Markdown
Collaborator

I'll build and test on my SES hardware, and give it a review tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants