Skip to content

[ACL] FlexCounter is duplicated when updating existing ACL rules  #18719

@bingwang-ms

Description

@bingwang-ms

Description

The issue happens when updating an existing ACL rule.

  1. When ACL rule is created for the first time, a flex counter is created and registered https://github.com/sonic-net/sonic-swss/blob/9e183a650cf38e0d5af46adc1342dcde85ecb84d/orchagent/aclorch.cpp#L4076
  2. When the same ACL rule is being updated, the FlexCounter created before is not removed, and another FlexCounter is created and registered.

This will cause error log being flooding each 10 seconds

Apr 18 18:20:24.716057 str3-msn4700-03 ERR syncd#SDK: [FLOW_COUNTER.ERR] spectrum_flow_counter_lock: cm_lock failed [lid=15, flow_counter_id=122880]
Apr 18 18:20:24.716057 str3-msn4700-03 ERR syncd#SDK: [FLOW_COUNTER.ERR] spectrum_flow_counter_get: spectrum_flow_counter_lock failed [cntr_id=122880]
Apr 18 18:20:24.716057 str3-msn4700-03 ERR syncd#SDK: [SAI_ACL.ERR] ./src/mlnx_sai_acl.c[15023]- mlnx_acl_counter_get:  Failure to get counter in SDK - Entry Not Found 
Apr 18 18:20:24.716057 str3-msn4700-03 ERR syncd#SDK: [SAI_UTILS.ERR] ./src/mlnx_sai_utils.c[2013]- get_dispatch_attribs_handler: Failed Get #0, BYTES, key:ACL_COUNTER [OID:0x1E00000030009] [sx_flow_counter_id:122880, byte_flag:true, packet_flag:true, acl_table_db[0]]
Apr 18 18:20:24.716072 str3-msn4700-03 ERR syncd#SDK: [SAI_UTILS.ERR] ./src/mlnx_sai_utils.c[2190]- sai_get_attributes: Failed to get attribute
Apr 18 18:20:24.716091 str3-msn4700-03 ERR syncd#SDK: :- collectData: Failed to get attr of SAI_OBJECT_TYPE_ACL_COUNTER 0x9000000000a64: -7

Steps to reproduce the issue:

  1. Create an ACL rule with acl-loader or modifying CONFIG_DB
  2. Update the existing ACL rule by modifying CONFIG_DB directly.
  3. Check entries in FLEX_COUNTER db and there will be duplicated entries.

Describe the results you received:

Describe the results you expected:

Output of show version:

It should be a day-1 issue since FlexCounter was introduced for ACL by sonic-net/sonic-swss#1943.

SONiC Software Version: SONiC.20230531.25
SONiC OS Version: 11
Distribution: Debian 11.8
Kernel: 5.10.0-23-2-amd64
Build commit: 6c9a37ffde
Build date: Fri Apr  5 17:31:13 UTC 2024
Built by: cloudtest@f95ea26dc000000

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):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions