Repository navigation
ACL Table IP Type Attribute - #2343
AnandhiDhanabalan wants to merge 4 commits into
Conversation
Signed-off-by: Anandhi Dhanabalan <adhanabalan@marvell.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
@j-bos , Question asked during discussion if SONIC uses any of the In MCLAG port-isolation ACL rules, auto-generated by Also notable: |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
@tjchadaga, could you approve this PR? |
|
@j-bos, @JaiOCP, @marian-pritsak, @eddyk-nvidia - could you please help review? |
|
@j-bos @JaiOCP @marian-pritsak @eddyk-nvidia - gentle reminder, can you review and approve this PR |
|
@j-bos @JaiOCP @marian-pritsak @eddyk-nvidia @tjchadaga Could you please review and share your feedback, or let me know if someone else would be better suited to look into this? |
|
Hi, there are a few items I want to check:
|
ARP classification: this is addressed in section 5.1 of the proposal doc.
@j-bos Let me know if a combined/bitmask value is actually needed for your use case. If yes, we can consider future extension of this PR |
|
I'm looking at it even in terms of the sonic use-case. For example, in aclorch, there is the below description of the table matching for mirror tables, where the non-ip rules (e.g. match ethertype) live in the table with the ipv4 rules, in case of separated v4/v6 model. So in case of SONiC, it's not clear how they would configure TABLE_MIRROR, since that single table needs to handle v4 and non-ip. If configured as ALL, I believe that would be a hint to the SDK that V6 exists as well in the first table and so it could not be relied on for optimizing the allocation. It seems like the attribute may need to be a list of enum values, similar to the bind-point type list (and then ARP could probably also be solved by splitting it out from V4, to allow for V4 or V4+ARP). |
|
@j-bos , I see what you mean, We can discuss this over a meeting in community and decide on the best possible approach. |
|
@j-bos, adding the following two enum values should address the mirror case you mentioned: I specifically prefer not to use a list of enum values, as that could introduce backward-compatibility concerns. |
|
So with these additional enum values are we saying that ARP falls under NON_IP and then it can be used as intended with the NON_IPV6? |
@mclayto,
|
bandaru-viswanath
left a comment
There was a problem hiding this comment.
The PR introduces a new attribute that becomes another source of truth for determining the table details, the existing source being the list of qualifiers. SAI, in general, avoids defining such multiple sources. Some of the inherent issues are commented as inline comments below. Perhaps we can solve the problem differently ?
| The new attribute is optional and defaults to an empty list. | ||
|
|
||
| An empty list means the attribute is not configured. The table is unrestricted: it behaves as if all packet types were listed, no packet-type validation is applied to entries, and the implementation selects the table resources. | ||
|
|
There was a problem hiding this comment.
This default behaviour of "unrestricted" can conflict with other Qualifiers set for the table.
"empty list" can't mean "not configured" and "unrestricted" both, at the same time. The problem is because the other qualifiers are also in place and they will determine.
-
Imagine a table created without this attribute, but for an IPv6 qualifier set. A GET on this attribute is supposed to return the default value (being not configured), but that mean it is unrestricted and it is wrong. Returning non-default value for an not-configured attribute is against the spec.
-
If a Table is created with "IPv4" in the list (of this attribute) but has "IPv6" qualifiers in the create parameters, how to handle that situation ?
There was a problem hiding this comment.
I think the point of this PR is that an "IPv6 qualifier set" does not restrict a table to IPv6. If it did, there would be no need for this PR. My example:
Table: FIELD_SRC_IPV6 (only IPv6 fields specified)
Entry: FIELD_SRC_IPV6 --> Matches only IPv6 packets with that SIP
Entry: <no qualifiers> --> Matches All other packets including IPv4 & non-IP
I agree that the second bullet should be clear. Is it an error to specify a field that cannot be matched by the table type or is it just a useless field?
There was a problem hiding this comment.
IMO, the example provided is not the right behaviour.
If a Table has FIELD_SRC_IPV6 (and no V4 for example), then no entry in that table should match a non-IPv6 packet. The wildcards in the entries are constrained by the table definition. Otherwise, the table definition doesn't have a purpose and is not required.
For example, if the table definition has FIELD_SRC_IPV6 and FIELD_DST_UDP_PORT, and an entry in that table has "match all packets to UDP port X", and if it starts matching IPv4 packets with that udp-port X, as well, it becomes a mockery of the table definition. There is an expectation of IPv6 packets here from the table definition.
There was a problem hiding this comment.
Interesting - Is this documented somewhere? If this is the community consensus then I agree we don't need this PR. To be clear, we have this interpretation but I always considered it an imperfect heuristic to accommodate SONiC table types without wasting resources. I find that the tricky part is determining when non-IP is included or not (we've adjusted our interpretation of ETHER_TYPE over time). If we're documenting this as proper SAI behavior, I suggest we capture how each field affects the interpreted table type.
There was a problem hiding this comment.
Actually, I will push back on this statement though: "Otherwise, the table definition doesn't have a purpose and is not required."
This may be true for devices with a fixed key, but not for devices with dynamic key definitions. We still need a predefined set of fields that will be used to construct the keys for this ACL.
There was a problem hiding this comment.
SAI spec is defined for the hypothetical SAI pipeline. It needs to be mapped to individual ASIC's from each vendor. So the Spec's Table definition is provided for the SAI pipeline via qualifiers. So, my point is that the definition in the spec has a purpose, and we shouldn't add attributes bypassing that purpose.
There was a problem hiding this comment.
@bandaru-viswanath , I agree with @mclayto.
The below interpretation of yours is not documented in SAI, and this implementation proves we need a attribute to identify the table type explicitly.
"For example, if the table definition has FIELD_SRC_IPV6 and FIELD_DST_UDP_PORT, and an entry in that table has "match all packets to UDP port X", and if it starts matching IPv4 packets with that udp-port X, as well, it becomes a mockery of the table definition. There is an expectation of IPv6 packets here from the table definition."
|
|
||
| # 1. Overview | ||
|
|
||
| SAI currently defines the packet type of an ACL entry through `SAI_ACL_ENTRY_ATTR_FIELD_ACL_IP_TYPE`, but does not provide an ACL-table-level attribute to declare the intended packet domain of the table. |
There was a problem hiding this comment.
The Table qualifier set is used, today, to derive the packet types. In the review meeting, it was suggested to list the specific reasons that required this attribute being introduced. Could you please update the doc ?
There was a problem hiding this comment.
@bandaru-viswanath , thanks for your comments.
I am re-working on this proposal to capture all points discussed, will call for a offline discussion soon with these points answered.
This PR introduces
SAI_ACL_TABLE_ATTR_IP_TYPE, a newCREATE_ONLYACL table attribute that allows the NOS to explicitly declare the packet domain (ANY/IP/IPV4/IPV6/NON_IP) of an ACL table at creation time. This enables implementations to select an optimal TCAM key profile upfront rather than inferring the packet domain from entry match fields.