sonic-swss icon indicating copy to clipboard operation
sonic-swss copied to clipboard

[Chassis][LAG_ID] Address the same lagid been used in two different LCs issue

Open mlok-nokia opened this issue 4 months ago • 2 comments

What I did Create SYSTEM_LAG_IDS_FREE_LIST for assign lagId for all portchannel creation.

  1. Portchannel creation a) If Portchannel is created with a valid plagid * check if plagid is in free list, use plagid and remove it from SYSTEM_LAG_IDS_FREE_LIST. Add this lagid to the SYSTEM_LAG_ID_SET for debug info * If plagid is not in the FREE_LIST, lpop and use the first lagid from the SYSTEM_LAG_IDS_FREE_LIST. Add this lagid to the SYSTEM_LAG_ID_SET for debug info b) If Portchannel is created with invalid plagid or without any lagid
    • lpop and use the first lagid from the SYSTEM_LAG_IDS_FREE_LIST. Add this lagid to the SYSTEM_LAG_ID_SET for debug info
  2. Portchannel delection
    • Append the lagid to the end of SYSTEM_LAG_IDS_FREE_LIST. Also remove it from SYSTEM_LAG_ID_SET.

This PR works with the following 2 PRs: https://github.com/sonic-net/sonic-platform-daemons/pull/542 https://github.com/sonic-net/sonic-buildimage/pull/20369

Why I did it To address the issue of the same lagid could be used by two Portchannels in two different linecards. This issue occurs when reboot many Linecards together with 20 seconds delay in each LC reboot.

How I verified it

Details if related

mlok-nokia avatar Sep 28 '24 02:09 mlok-nokia