sonic-net / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
718 stars 1.38k forks source link

orchagent exits when using everflow policer on unsupported platform #11826

Open tcusto opened 2 years ago

tcusto commented 2 years ago

Description

Orchagent errors out when configuring a everflow mirror session with a policer on the DNX platform. The policer is not supported on the ASIC and when the error is returned from sai, the session creation failure causes orchagent to exit.

Sample logs:

ERR syncd0#syncd: [06:00.0] SAI_API_MIRROR:_brcm_sai_dnx_create_mirror_session:2825 Platform does not support SAI_MIRROR_SESSION_ATTR_POLICER ERR syncd0#syncd: [06:00.0] SAI_API_MIRROR:_brcm_sai_dnx_create_mirror_session:2857 Error processing mirror attributes ERR syncd0#syncd: :- sendApiResponse: api SAI_COMMON_API_CREATE failed in syncd mode: -327669 ERR swss0#orchagent: :- activateSession: Failed to activate mirroring session TEST_POLICER_SESSION ERR swss0#orchagent: :- handleSaiCreateStatus: Encountered failure in create operation, exiting orchagent, SAI API: SAI_API_MIRROR, status: -327669

Steps to reproduce the issue:

  1. Use sonic with DNX asic.
  2. Configure an everflow mirror session without policer and add egress route to verify it is active.
  3. Configure a policer in the asic configdb. (e.g. sonic-db-cli -n asic0 CONFIG_DB hmset "POLICER|TEST_POLICER" meter_type packets mode sr_tcm cir 100 cbs 100 red_packet_action drop)
  4. Configure a second everflow session with that policer. (e.g. sudo config mirror_session add test_session_1 1.1.1.1 2.2.2.2 8 4 35006 --policer TEST_POLICER)

Describe the results you received:

orchagent exits

Describe the results you expected:

Either command rejected or policer configuration silently ignored.

Output of show version:

msft-2205

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

zhangyanzhao commented 2 years ago

unsupported platform. Can you please contribute to this platform?

zhangyanzhao commented 2 years ago

BRCM will take a look.

adyeung commented 2 years ago

@zhangyanzhao @bingwang-ms SAI_MIRROR_SESSION_ATTR_POLICER is not currently supported in DNX. Syncd received an ERROR code from SAI within the SAI_STATUS_ATTR_NOT_SUPPORTED range. To prevent the crash, either syncd has to be modified to handle the error code gracefully or introduce a SAI capability check before setting SAI_MIRROR_SESSION_ATTR_POLICIER. Request feature owner of everflow to address the crash