Why I did it
Mirror references port without increasing the RefCount.
When creating a mirror, the port (Ethernet, PortChannel) is referenced as dst_port/src_port,
but the number of references to the relevant port is not increased.
When calling SAI to delete the portchannel, it is found that there are still related references, and the deletion of the portchannel fails, so the ERR log is printed.
Apr 8 12:07:03.149345 sonic ERR swss#orchagent: :- removeLag: Failed to remove LAG PortChannel2001 lid:2000000000716
Apr 8 12:07:03.213774 sonic WARNING swss#orchagent: :- meta_generic_validation_remove: object 0x2000000000716 reference count is 1, can't remove
Apr 8 12:07:03.213774 sonic ERR swss#orchagent: :- removeLag: Failed to remove LAG PortChannel2001 lid:2000000000716
Apr 8 12:07:04.149346 sonic WARNING swss#orchagent: :- meta_generic_validation_remove: object 0x2000000000716 reference count is 1, can't remove
Apr 8 12:07:04.149346 sonic ERR swss#orchagent: :- removeLag: Failed to remove LAG PortChannel2001 lid:2000000000716
Apr 8 12:07:04.213695 sonic WARNING swss#orchagent: :- meta_generic_validation_remove: object 0x2000000000716 reference count is 1, can't remove
Apr 8 12:07:04.213695 sonic ERR swss#orchagent: :- removeLag: Failed to remove LAG PortChannel2001 lid:2000000000716
What I did
When the mirror refers to port, increase the number of port RefCount.
…easing the RefCount
Why I did it Mirror references port without increasing the RefCount.
When creating a mirror, the port (Ethernet, PortChannel) is referenced as dst_port/src_port, but the number of references to the relevant port is not increased. When calling SAI to delete the portchannel, it is found that there are still related references, and the deletion of the portchannel fails, so the ERR log is printed.
Apr 8 12:07:03.149345 sonic ERR swss#orchagent: :- removeLag: Failed to remove LAG PortChannel2001 lid:2000000000716 Apr 8 12:07:03.213774 sonic WARNING swss#orchagent: :- meta_generic_validation_remove: object 0x2000000000716 reference count is 1, can't remove Apr 8 12:07:03.213774 sonic ERR swss#orchagent: :- removeLag: Failed to remove LAG PortChannel2001 lid:2000000000716 Apr 8 12:07:04.149346 sonic WARNING swss#orchagent: :- meta_generic_validation_remove: object 0x2000000000716 reference count is 1, can't remove Apr 8 12:07:04.149346 sonic ERR swss#orchagent: :- removeLag: Failed to remove LAG PortChannel2001 lid:2000000000716 Apr 8 12:07:04.213695 sonic WARNING swss#orchagent: :- meta_generic_validation_remove: object 0x2000000000716 reference count is 1, can't remove Apr 8 12:07:04.213695 sonic ERR swss#orchagent: :- removeLag: Failed to remove LAG PortChannel2001 lid:2000000000716
What I did When the mirror refers to port, increase the number of port RefCount.