Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[platform/test_sfp]Operate SFP only once for split ports when resetting or setting LPM #1338

Merged
merged 3 commits into from
Jan 19, 2020
Merged

[platform/test_sfp]Operate SFP only once for split ports when resetting or setting LPM #1338

merged 3 commits into from
Jan 19, 2020

Conversation

stephenxs
Copy link
Contributor

@stephenxs stephenxs commented Jan 17, 2020

Description of PR

Summary:
Fixes # (issue)
For split ports, only operate them once when testing reset and low power mode.

Type of change

  • [] Bug fix
  • [] Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

How did you do it?

  1. introduce a snippet of script which retrieves port mapping from DUT
  2. get_port_map:
  • for the first time being called, it copies the script to the DUT, executes it on DUT and then parses the result to construct the port mapping. It also saves the map for future use
  • for the following time being called, it just returns the saved map.
  1. when reset/set LPM for SFP modules, it uses the following logic to avoid repeating operating the physical SFP modules offering split ports:
    operated_phy_set = {}
    for each logical port
        phyport = port_mapping[logical]
        if phyport in operated_phy_set,
            skip
        else
            operate the SFP
            add phyport to operated_phy_set

How did you verify/test it?

run test_sfp

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

2100.split.extracted.2.txt
2700.split.extract.txt
3800.split.extract.txt
2010.split.extract.txt
2100.split.extract.txt

@stephenxs stephenxs changed the title Operate sfp only once [platform/test_sfp]Operate SFP only once for split ports when resetting or setting LPM Jan 18, 2020
@stephenxs stephenxs marked this pull request as ready for review January 18, 2020 03:57
@liat-grozovik liat-grozovik merged commit 08c3915 into sonic-net:master Jan 19, 2020
@stephenxs stephenxs deleted the operate_sfp_only_once branch January 26, 2020 07:54
noaOrMlnx pushed a commit to noaOrMlnx/sonic-mgmt that referenced this pull request Jan 30, 2020
…ng or setting LPM (sonic-net#1338)

* [sfp]operating the logical interfaces sharing a physical interface only once

* [sfp]add teardown, beautify and optimize code

* [sfp]fix comments
lguohan pushed a commit that referenced this pull request Feb 11, 2020
operate SFP only once for split ports when resetting or setting LPM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants