Skip to content

Add SAI_ACL_TABLE_ATTR_FIELD_MIRROR_COPY#2274

Open
mobinmohan wants to merge 1 commit intoopencomputeproject:masterfrom
mobinmohan:add_mirror_copy
Open

Add SAI_ACL_TABLE_ATTR_FIELD_MIRROR_COPY#2274
mobinmohan wants to merge 1 commit intoopencomputeproject:masterfrom
mobinmohan:add_mirror_copy

Conversation

@mobinmohan
Copy link
Copy Markdown

No description provided.

This change introduces a new ACL match field `MIRROR_COPY` to allow ACLs to match based on whether the packet is a mirror copy.

Signed-off-by: Mobin Mohan <mobinmohan@google.com>
@JaiOCP
Copy link
Copy Markdown
Contributor

JaiOCP commented Apr 13, 2026

_ No description provided. _

Pleas provide description of the PR

@JaiOCP
Copy link
Copy Markdown
Contributor

JaiOCP commented Apr 13, 2026

@mobinmohan Is it an ingress mirror or egress mirror copy match condition.

@mobinmohan
Copy link
Copy Markdown
Author

@mobinmohan Is it an ingress mirror or egress mirror copy match condition.

The attribute was to match both ingress and egress mirror copies. However, I can change the type from bool to sai_acl_mirror_copy_type_t to allow selective matching, if the underlying hardware supports it. Please let me know your recommendation.

+/**
+ * @brief Mirror copy type for ACL matching
+ */
+typedef enum _sai_acl_mirror_copy_type_t
+{
+    SAI_ACL_MIRROR_COPY_TYPE_NONE,
+    SAI_ACL_MIRROR_COPY_TYPE_INGRESS,
+    SAI_ACL_MIRROR_COPY_TYPE_EGRESS,
+    SAI_ACL_MIRROR_COPY_TYPE_ANY
+} sai_acl_mirror_copy_type_t;
+
+

@JaiOCP
Copy link
Copy Markdown
Contributor

JaiOCP commented Apr 14, 2026

@mobinmohan Is it an ingress mirror or egress mirror copy match condition.

The attribute was to match both ingress and egress mirror copies. However, I can change the type from bool to sai_acl_mirror_copy_type_t to allow selective matching, if the underlying hardware supports it. Please let me know your recommendation.

+/**
+ * @brief Mirror copy type for ACL matching
+ */
+typedef enum _sai_acl_mirror_copy_type_t
+{
+    SAI_ACL_MIRROR_COPY_TYPE_NONE,
+    SAI_ACL_MIRROR_COPY_TYPE_INGRESS,
+    SAI_ACL_MIRROR_COPY_TYPE_EGRESS,
+    SAI_ACL_MIRROR_COPY_TYPE_ANY
+} sai_acl_mirror_copy_type_t;
+
+

I don't think we need to have type_t.
If the ACL table stage is ingress then the match action would apply to ingress mirror.
If the ACL table stage is egress then the match action would apply to egress mirror.

Typically there is no case where ingress mirror copy needs an egress ACL rule for match action as the mirror copy is taken out to the mirror port directly but I am not very sure about it. Is that a use case for you?

* @brief End of Rule Match Fields
*/
SAI_ACL_ENTRY_ATTR_FIELD_END = SAI_ACL_ENTRY_ATTR_FIELD_CSIG_D_BIT,
SAI_ACL_ENTRY_ATTR_FIELD_END = SAI_ACL_ENTRY_ATTR_FIELD_MIRROR_COPY,
Copy link
Copy Markdown
Collaborator

@kcudnik kcudnik Apr 14, 2026

Choose a reason for hiding this comment

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

i'm wondering whether we should make those as last item, not equal to last valid item, all _END attributes in all SAI are defined after last valid enum item, except those 4:

saiacl.h:    SAI_ACL_TABLE_ATTR_FIELD_END = SAI_ACL_TABLE_ATTR_FIELD_CSIG_D_BIT,
saiacl.h:    SAI_ACL_TABLE_ATTR_FIELD_VALID_BITS_END = SAI_ACL_TABLE_ATTR_FIELD_VALID_BITS_DST_IPV6,
saiacl.h:    SAI_ACL_ENTRY_ATTR_FIELD_END = SAI_ACL_ENTRY_ATTR_FIELD_CSIG_D_BIT,
saiacl.h:    SAI_ACL_ENTRY_ATTR_ACTION_END = SAI_ACL_ENTRY_ATTR_ACTION_TAM_OBJECT,

which requires alywas to set change those after adding new values

we could redefine those 4 and not have to touch them every time, then we could have consistency across all SAI

proble could be for

1753     SAI_ACL_TABLE_ATTR_FIELD_VALID_BITS_END = SAI_ACL_TABLE_ATTR_FIELD_VALID_BITS_DST_IPV6,
1754 
1755     /**
1756      * @brief End of ACL Table attributes
1757      */
1758     SAI_ACL_TABLE_ATTR_END,
1759 

3480     SAI_ACL_ENTRY_ATTR_ACTION_END = SAI_ACL_ENTRY_ATTR_ACTION_TAM_OBJECT,
3481 
3482     /**
3483      * @brief End of ACL Entry attributes
3484      */
3485     SAI_ACL_ENTRY_ATTR_END,
3486 

since if we made it like this:

SAI_ACL_TABLE_ATTR_FIELD_VALID_BITS_END,
SAI_ACL_TABLE_ATTR_END


SAI_ACL_ENTRY_ATTR_ACTION_END,
SAI_ACL_ENTRY_ATTR_END

then SAI_ACL_TABLE_ATTR_END and SAI_ACL_ENTRY_ATTR_END will not point to last valid attribute but rather SAI_ACL_TABLE_ATTR_FIELD_VALID_BITS_END and SAI_ACL_ENTRY_ATTR_ACTION_END which are just markers

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