sonic-net / sonic-platform-common

Python packages which provide a common interface to platform-specific hardware peripherals in SONiC
Other
45 stars 171 forks source link

[202311][CMIS] Add lane_mask parameter to set_loopback_mode() to enable setti… #499

Closed xinyulin closed 2 weeks ago

xinyulin commented 2 weeks ago

Description

This commit introduces two additional input parameters, lane_mask and enable, to the set_loopback_mode() function. By specifying lane_mask, users can enable or disable the loopback mode on individual lanes rather than applying it to the entire physical port

Motivation and Context

Previously, the set_loopback_mode() function affected all lanes of a physical port simultaneously, limiting flexibility. By adding the lane_mask parameter, this update allows callers to target specific lanes, thereby enabling more precise testing, debugging, and configuration of network equipment.

How Has This Been Tested?

Tested on Cisco 8111 with Credo C1 cable. Set host input loopback mode on logical port Ethernet80, the expected value of page 0x13, byte 0xB7= 0x0F image

Set media input loopback mode on logical port Ethernet84, the expected value of page 0x13, byte 0xB5= 0xF0 image

mihirpat1 commented 2 weeks ago

@yxieca Can you please help to cherry-pick this to 202311? @xinyulin has tested the changes on 202311 MSFT ADO - 28898451