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
[common]: Fix of get_port_map #3643
Conversation
*Fix get_port_map due to deprecation of plugins/getportmap.py Signed-off-by: Vladyslav Morokhovych <vladyslavx.morokhovych@intel.com>
This pull request introduces 1 alert when merging cbfafb1 into 4309468 - view on LGTM.com new alerts:
|
@vmorokhx Can you fix the LTM alert |
@wangxin LGTM unused import alert fixed. |
I see no reason to revert, |
config_facts ansible module gives port_index_map in each asic starting with index 0. Code from config_facts ansible module:
So, it is not getting the 'port index' defined in platform.json / portconfig.ini, For example, for asic1 with starting port Ethernet18 (first port in the asic1), the port_index_map would be:
With the old method - this was:
|
@arlakshm we believe this breaks multi-asic tests. Could you please review and help get this reverted or propose how we can resolve this? |
…3897) What is the motivation for this PR? The change done in PR #3643 to use the get_port_map, does not work for multi-ASIC platforms. The existing logic in config_facts gives the same index for ports on different ASICs. The PR is a fix for this problem. get_port_map will use the port index present in the config_db. How did you do it? Change in config_facts to get the port index from config_db if its available. If the index is not present use the exisiting lofic to generate the index How did you verify/test it? run the test platform_tests/rest_reload_config.py to verify Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <arlakshm@microsoft.com>
Summary: Patch with fix for get_port_map in interface_utils.py According to Porting Guide (https://github.com/Azure/SONiC/wiki/Porting-Guide): plugins/getportmap.py and port_config.ini are deprecated, but was used in `get_port_map`. What is the motivation for this PR? Deprecation of: * plugins/getportmap.py * port_config.ini ( In favor of the use of platform.json and hwsku.json ) How did you do it? Change get_port_map in interface_utils.py. Switched from using getportmap.py and port_config.ini to retrieving port mapping from config_facts depending on asic How did you verify/test it? Run sfp tests, test_reboot.py, test_sequential_restart.py on t0, t0-64-32 and t1 Signed-off-by: Vladyslav Morokhovych <vladyslavx.morokhovych@intel.com>
…onic-net#3897) What is the motivation for this PR? The change done in PR sonic-net#3643 to use the get_port_map, does not work for multi-ASIC platforms. The existing logic in config_facts gives the same index for ports on different ASICs. The PR is a fix for this problem. get_port_map will use the port index present in the config_db. How did you do it? Change in config_facts to get the port index from config_db if its available. If the index is not present use the exisiting lofic to generate the index How did you verify/test it? run the test platform_tests/rest_reload_config.py to verify Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <arlakshm@microsoft.com>
Signed-off-by: Vladyslav Morokhovych vladyslavx.morokhovych@intel.com
Description of PR
Summary:
Patch with fix for
get_port_map
ininterface_utils.py
According to Porting Guide:
plugins/getportmap.py
andport_config.ini
are deprecated, but was used inget_port_map
Type of change
Back port request
Approach
What is the motivation for this PR?
Deprecation of
How did you do it?
Change
get_port_map
ininterface_utils.py
Switched from using
getportmap.py
andport_config.ini
to retrieving port mapping from
config_facts
depending on asicHow did you verify/test it?
Run
sfp
tests,test_reboot.py
,test_sequential_restart.py
on t0, t0-64-32 and t1Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation