Add ACL Mirror Copy Type and Mirror Session ID match fields#2274
Add ACL Mirror Copy Type and Mirror Session ID match fields#2274mobinmohan wants to merge 2 commits into
Conversation
cd28e05 to
0ae367c
Compare
Pleas provide description of the PR |
|
@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 |
I don't think we need to have type_t. 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? |
Added description. |
Sounds good. We can continue with the default(bool). |
The current bool definition still leaves ambiguity on what exactly is being matched. then SAI_ACL_ENTRY_ATTR_FIELD_MIRROR_COPY=true in an egress ACL table, does it mean only egress mirror copies, not any mirrored packet ? please clarify. Modeling this stage/direction explicitly using sai_acl_mirror_copy_type_t (as proposed in this conversation) would make the semantics unambiguous and future-proof the design, enum capability query allows the vendor to announce their capabilities. |
| * @flags CREATE_ONLY | ||
| * @default false | ||
| */ | ||
| SAI_ACL_TABLE_ATTR_FIELD_MIRROR_COPY = SAI_ACL_TABLE_ATTR_FIELD_START + 0x167, |
There was a problem hiding this comment.
Can you clarify whether SAI_ACL_ENTRY_ATTR_FIELD_MIRROR_COPY matches mirror copies generated by any mirror session (i.e. a generic “mirrored packet” qualifier), or whether there is intent to support classification of mirror copies generated by a specific mirror session?
A potential use case is applying different ACL treatment to traffic mirrored by different mirror sessions (for example, Mirror session A vs session B). With the current boolean qualifier, it is not clear how per-session discrimination would be achieved.
I agree and take my earlier statement back. |
0ae367c to
1fc21bb
Compare
I received a similar feedback during the weekly review meeting. I agree using sai_acl_mirror_copy_type_t makes the design future proof. I have updated the PR to use the enum type, though proper distinction will depend on the ASIC support. |
Thanks for reviewing this during the weekly meeting. I have update the PR now. |
1fc21bb to
6923c55
Compare
6923c55 to
d56bb79
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This change introduces a new ACL match field `ACL_MIRROR_COPY_TYPE` to allow ACLs to match based on whether the packet is a mirror copy. It allows ACLs to match based on the type of mirror copy (Ingress, Egress, or Ingress or Egress). Change-Id: I351b2aba82b10ce52425615920eb07e7fd964f96 Signed-off-by: Mobin Mohan <mobinmohan@google.com>
d56bb79 to
b31131d
Compare
| * @flags CREATE_AND_SET | ||
| * @default disabled | ||
| */ | ||
| SAI_ACL_ENTRY_ATTR_FIELD_ACL_MIRROR_COPY_TYPE = SAI_ACL_ENTRY_ATTR_FIELD_START + 0x167, |
There was a problem hiding this comment.
Semantics related:
Remove ACL from the new attr to be inlined with existing attr SAI_ACL_ENTRY_ATTR_FIELD_ACL_MIRROR_COPY_TYPE to
SAI_ACL_ENTRY_ATTR_FIELD_MIRROR_COPY_TYPE
Same for other attr as well
There was a problem hiding this comment.
The SAI metadata checker enforces a convention for attributes with custom enum type. It requires the attribute name suffix match the enum type name (excluding the sai_ prefix and _t suffix). Here the type name is sai_acl_mirror_copy_type_t. Removing acl keyword from the type_t would not be preferred here.
The naming is also similar to SAI_ACL_ENTRY_ATTR_FIELD_ACL_IP_TYPE and SAI_ACL_ENTRY_ATTR_FIELD_ACL_IP_FRAG.
| typedef enum _sai_acl_mirror_copy_type_t | ||
| { | ||
| /** Match packets that are not mirror copies */ | ||
| SAI_ACL_MIRROR_COPY_TYPE_NONE, |
There was a problem hiding this comment.
what does NONE signifies ?
MIRROR_COPY is a match criteria that is specifically meant for matching on the mirrored copy of the packet alone and not the original packet.
`NONE' description indicated not mirror copies
NONE enum description and the primary intent of this qualifier still raises ambiguity
There was a problem hiding this comment.
what does NONE signifies ?
Match on original packet is specified using NONE.
MIRROR_COPY is a match criteria that is specifically meant for matching on the mirrored copy of the packet alone and not the original packet.
I do not think that aligns with the intended behavior. If a user shares the same ACL group for multiple features, they need control to differentiate between original vs mirror traffic. If a feature should not apply to mirror copies, they need a way to specify that. NONE will help to specify the rule should not match on mirror copies.
| SAI_ACL_ENTRY_ATTR_FIELD_ACL_MIRROR_COPY_TYPE = SAI_ACL_ENTRY_ATTR_FIELD_START + 0x167, | ||
|
|
||
| /** | ||
| * @brief Match on mirror session ID |
There was a problem hiding this comment.
it would be better to brief it like Match on mirror copies generated by this mirror session ID
This change introduces a new ACL match field `ACL_MIRROR_SESSION_ID` to allow ACLs to match based on a specific mirror session ID. * Added support to match on `SAI_OBJECT_TYPE_MIRROR_SESSION` objects in ACL entries. * Added Table and Entry attributes with updated end markers. Change-Id: Iea1a664dbe8fca6e22a9b3f9c50ecb0fc9f29b75 Signed-off-by: Mobin Mohan <mobinmohan@google.com>
73aa841 to
d33e34b
Compare
This PR introduces two new ACL match fields to the SAI ACL headers:
SAI_ACL_TABLE_ATTR_FIELD_ACL_MIRROR_COPY_TYPE: Allows ACL rules to match packets based on whether they are mirror copies and their specific type (Ingress, Egress, or Ingress Or Egress).SAI_ACL_TABLE_ATTR_FIELD_ACL_MIRROR_SESSION_ID: Allows ACL rules to match based on a specific mirror session ID.