Skip to content

Add label attribute for ACL entry - #2322

Merged
tjchadaga merged 1 commit into
opencomputeproject:masterfrom
zechengh09:acl-entry-label
Aug 3, 2026
Merged

Add label attribute for ACL entry#2322
tjchadaga merged 1 commit into
opencomputeproject:masterfrom
zechengh09:acl-entry-label

Conversation

@zechengh09

Copy link
Copy Markdown
Contributor

Summary:

This is similar to #1158, #1407, #1430.

Those PRs added label attribute for LAG/virtual router, counter, ACL Counter. This PR adds similar label attribute for ACL entries.

Adding a label attribute that can be used to uniquely identify ACL entry object during warmboot. This attribute is considered as user data attached to the object.

Summary:

This is similar to opencomputeproject#1158, opencomputeproject#1407, opencomputeproject#1430.

Those PRs added label attribute for LAG/virtual router, counter, ACL Counter. This PR adds similar label attribute for ACL entries.

Adding a label attribute that can be used to uniquely identify ACL entry object during warmboot. This attribute is considered as user data attached to the object.

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>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@zechengh09
zechengh09 marked this pull request as ready for review July 24, 2026 23:26
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@kcudnik

kcudnik commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Comment thread inc/saiacl.h
* @default empty
*/
SAI_ACL_ENTRY_ATTR_LABEL,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the data type is specified as s8_list_t instead of char?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SAI spec limits char datatype to 32-bytes. In practice, we have seen cases where the label length may exceed this limit. For example, we may want to capture the use case for the ACL entry in the label name itself, and that could exceed 32-bytes.

sai_s8_list_t keeps it generic, so NOS can choose the desired label length without being constrained by the 32-byte limits.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

32 bytes for label is i think long enough, so far almost all labels are chars, and this should be a label not poem

@tjchadaga tjchadaga added the reviewed PR is discussed in SAI Meeting label Aug 3, 2026
@tjchadaga
tjchadaga merged commit 6dd7381 into opencomputeproject:master Aug 3, 2026
3 checks passed
zechengh09 pushed a commit to zechengh09/SAI that referenced this pull request Aug 5, 2026
Summary:

This is similar to opencomputeproject#1158, opencomputeproject#1407, opencomputeproject#1430, opencomputeproject#2322.

SAI_COUNTER_ATTR_LABEL and SAI_ACL_COUNTER_ATTR_LABEL 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 counter identifiers.

Add SAI_COUNTER_ATTR_LABEL_WIDE and SAI_ACL_COUNTER_ATTR_LABEL_WIDE of type sai_s8_list_t. 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. Both are appended at the end of their attribute enum so that no existing attribute is renumbered.

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 pushed a commit to zechengh09/SAI that referenced this pull request Aug 6, 2026
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 pushed a commit to zechengh09/SAI that referenced this pull request Aug 6, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

reviewed PR is discussed in SAI Meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants