Add wide label attribute for objects with a label attribute - #2327
Open
zechengh09 wants to merge 1 commit into
Open
Add wide label attribute for objects with a label attribute#2327zechengh09 wants to merge 1 commit into
zechengh09 wants to merge 1 commit into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
zechengh09
marked this pull request as ready for review
August 5, 2026 18:01
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
JaiOCP
reviewed
Aug 5, 2026
zechengh09
force-pushed
the
counter-label-extended
branch
from
August 5, 2026 21:00
52ead54 to
af73f3e
Compare
zechengh09
force-pushed
the
counter-label-extended
branch
from
August 6, 2026 15:53
af73f3e to
16bac09
Compare
Summary: This is similar to opencomputeproject#1158, opencomputeproject#1407, opencomputeproject#1430, opencomputeproject#2322. SAI label attributes are of type char, which maps to sai_attribute_value_t::chardata[32]. That is 32 bytes including the NUL terminator, so 31 usable characters. That can be too small for real identifiers. Add a LABEL_WIDE attribute of type sai_s8_list_t alongside each existing char label attribute. A list keeps the label length open, so the NOS can choose the length it needs instead of being constrained by an arbitrary limit in the SAI spec. Each new attribute is appended at the end of its attribute enum so that no existing attribute is renumbered. Objects covered: counter, ACL counter, LAG, mirror session, prefix compression table, policer, scheduler, next hop group, virtual router, UDF group and router interface. The existing char attributes are marked deprecated. Exactly one of the two attributes may be set to a non-default value; setting both is invalid. Signed-off-by: Shrikrishna (Shri) Khare <skhare@meta.com> Signed-off-by: Jasmeet Bagga <jasmeetbagga@meta.com> Signed-off-by: Ron He <zecheng@meta.com>
zechengh09
force-pushed
the
counter-label-extended
branch
from
August 6, 2026 19:22
16bac09 to
d446f26
Compare
rajkumar38
approved these changes
Aug 7, 2026
kcudnik
reviewed
Aug 7, 2026
| * | ||
| * Replaces #SAI_ROUTER_INTERFACE_ATTR_LABEL, which is limited to 32 bytes. | ||
| * Exactly one of the two attributes may be set to a non-default | ||
| * value; setting both is invalid. |
Collaborator
There was a problem hiding this comment.
from my perspective it could be valid, and more over they could be even different at the same time
Contributor
Author
There was a problem hiding this comment.
Thanks for the review - the wide label attribute is added to replace the current label attribute, which is marked as deprecated. It is kept for backward compatibility, but our goal is for both NOS and SDK starting using the new attribute in the new spec.
Therefore, only one attribute should be set at a given time. They could be different only if NOS starting to use the wide label with more than 32 characters.
j-bos
approved these changes
Aug 7, 2026
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
This is similar to #1158, #1407, #1430, #2322.
SAI label attributes are of type char, which maps to sai_attribute_value_t::chardata[32]. That is 32 bytes including the NUL terminator, so 31 usable characters. That can be too small for real identifiers.
Add a LABEL_WIDE attribute of type sai_s8_list_t alongside each existing char label attribute. A list keeps the label length open, so the NOS can choose the length it needs instead of being constrained by an arbitrary limit in the SAI spec. Each new attribute is appended at the end of its attribute enum so that no existing attribute is renumbered.
Objects covered: counter, ACL counter, LAG, mirror session, prefix compression table, policer, scheduler, next hop group, virtual router, UDF group and router interface.
The existing char attributes are marked deprecated. Exactly one of the two attributes may be set to a non-default value; setting both is invalid.