Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Yang] Incorrerct definition of ACL_TABLE_TYPE in sonic-acl.yang #16243

Closed
lizhijianrd opened this issue Aug 23, 2023 · 0 comments · Fixed by #16247
Closed

[Yang] Incorrerct definition of ACL_TABLE_TYPE in sonic-acl.yang #16243

lizhijianrd opened this issue Aug 23, 2023 · 0 comments · Fixed by #16247

Comments

@lizhijianrd
Copy link
Contributor

Description

The definition of ACL_TABLE_TYPE in sonic-acl.yang.j2#290 is incorrect.

According to ACL-Table-Type-HLD, key MATCHES, ACTIONS and BIND_POINTS should be uppercase. But they are written as lowercase in sonic-acl.yang.j2#290.

Steps to reproduce the issue:

  1. Write below content to file patch.json on DUT:
[
    {
        "op": "add",
        "path": "/ACL_TABLE_TYPE",
        "value": {
            "BMCDATA": {
                "MATCHES": ["SRC_IP", "DST_IP", "ETHER_TYPE", "IP_TYPE", "IP_PROTOCOL", "IN_PORTS", "L4_SRC_PORT", "L4_DST_PORT", "L4_SRC_PORT_RANGE", "L4_DST_PORT_RANGE"],
                "ACTIONS": ["PACKET_ACTION", "COUNTER"],
                "BIND_POINTS": ["PORT"]
            },
            "BMCDATAV6": {
                "MATCHES": ["SRC_IPV6", "DST_IPV6", "ETHER_TYPE", "IP_TYPE", "IP_PROTOCOL", "IN_PORTS", "L4_SRC_PORT", "L4_DST_PORT", "L4_SRC_PORT_RANGE", "L4_DST_PORT_RANGE"],
                "ACTIONS": ["PACKET_ACTION", "COUNTER"],
                "BIND_POINTS": ["PORT"]
            }
        }
    }
]
  1. Use GCU to apply this patch: sudo config apply-patch patch.json

Describe the results you received:

Got below error message at step 2:

$ sudo config apply-patch patch.json
Patch Applier: Patch application starting.
Patch Applier: Patch: [{"op": "add", "path": "/ACL_TABLE_TYPE", "value": {"BMCDATA": {"MATCHES": ["SRC_IP", "DST_IP", "ETHER_TYPE", "IP_TYPE", "IP_PROTOCOL", "IN_PORTS", "L4_SRC_PORT", "L4_DST_PORT", "L4_SRC_PORT_RANGE", "L4_DST_PORT_RANGE"], "ACTIONS": ["PACKET_ACTION", "COUNTER"], "BIND_POINTS": ["PORT"]}, "BMCDATAV6": {"MATCHES": ["SRC_IPV6", "DST_IPV6", "ETHER_TYPE", "IP_TYPE", "IP_PROTOCOL", "IN_PORTS", "L4_SRC_PORT", "L4_DST_PORT", "L4_SRC_PORT_RANGE", "L4_DST_PORT_RANGE"], "ACTIONS": ["PACKET_ACTION", "COUNTER"], "BIND_POINTS": ["PORT"]}}}]
Patch Applier: Getting current config db.
Patch Applier: Simulating the target full config after applying the patch.
Patch Applier: Validating all JsonPatch operations are permitted on the specified fields
Patch Applier: Validating target config does not have empty tables, since they do not show up in ConfigDb.
Patch Applier: Sorting patch updates.
Failed to apply patch
Usage: config apply-patch [OPTIONS] PATCH_FILE_PATH
Try "config apply-patch -h" for help.

Error: Given patch will produce invalid config. Error: Data Loading Failed
All Keys are not parsed in ACL_TABLE_TYPE
dict_keys(['BMCDATA', 'BMCDATAV6'])
exceptionList:["'MATCHES'", "'MATCHES'"]

Describe the results you expected:

Expect the custom ACL table types can be created in config DB.

Output of show version:

Can repro this issue on 202205 image.

Output of show techsupport:

(paste your output here or download and attach the file here )

Additional information you deem important (e.g. issue happens only occasionally):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant