Skip to content

Conversation

@iamjustadd
Copy link
Contributor

1. Fix bug in saisanitycheck that there is no check for range
   SAI_ACL_ENTRY_ATTR(/_FIELD/_ACTION)_CUSTOM_RANGE_START to
   SAI_ACL_ENTRY_ATTR(/_FIELD/_ACTION)_CUSTOM_RANGE_END
2. Remove all SAI_*_CUSTOM_RANGE_START/END, using SAI_*_CUSTOM_RANGE_BASE instead.
3. Adjust metadata generator to compitable with above changes.

@iamjustadd
Copy link
Contributor Author

@kcudnik , it's a new commit.

  1. Didn't create any custom headers, only have a example custom ACL header in doc/ .
  2. Replace CUSTOM_RANGE_START/END with CUSTOM_BASE.
    Reason: In custom headers, create new attribute won't modify the value of CUSTOM_RANGE_END. So it's better to define START/END at custom headers for customer's need.
  3. Create ACL_ENTRY_ACTION/FIELD_CUSTOM_RANGE_BASE = ACL_ENTRY_CUSTOM_RANGE_BASE + 0x1000 to align with non-custom attributes range.
  4. Modify saisanitycheck.c and test.pm to compitable with above changes.

@tjchadaga
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Comment on lines +5081 to +5097
for (; meta_acl_entry[index] != NULL; index++)
{
if (meta_acl_entry[index]->attrid == SAI_ACL_ENTRY_ATTR_ACTION_CUSTOM_RANGE_BASE)
{
break;
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is pointless, nothing happens here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why? I think here is to move the index to the first custom attribute of SAI_ACL_ENTRY_ATTR_ACTION_*

Copy link
Collaborator

Choose a reason for hiding this comment

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

add a comment then whats happening, and check if index gets at the last element then log error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added comment for this loop.

This function is to check whether the number of attributes acl_entry_action_* is matched with sai_acl_action_type , in another word, assert that user defined attribute acl_entry_action which must have a correspond acl_action_tyoe.
At line 5136 have this assertion:
META_ASSERT_TRUE(enum_index == sai_metadata_enum_sai_acl_action_type_t.valuescount,
"number of acl entry action mismatch vs number of enums in sai_acl_action_type_t");

If User not create custom attribute of ACL_ENTRY_ACTION, then here will loop till the
meta_acl_entry[index] == NULL(hit the last).
This is not an ERROR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tjchadaga @kcudnik Hi gentlemen, Any other comments?

@iamjustadd iamjustadd force-pushed the master branch 2 times, most recently from 4f2ae9a to b9ab173 Compare October 9, 2025 02:58
@iamjustadd iamjustadd requested a review from kcudnik October 9, 2025 04:41
       SAI_ACL_ENTRY_ATTR(/_FIELD/_ACTION)_CUSTOM_RANGE_START to
       SAI_ACL_ENTRY_ATTR(/_FIELD/_ACTION)_CUSTOM_RANGE_END
    2. Remove all SAI_*_CUSTOM_RANGE_START/END, using SAI_*_CUSTOM_RANGE_BASE instead.
    3. Adjust metadata generator to compitable with above changes.

Signed-off-by: Martin Liao <[email protected]>
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