-
Notifications
You must be signed in to change notification settings - Fork 727
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
[chassis][multi-dut]changes to support fabric asic in gen-mg and chassis TestbedProcessing #3245
Conversation
This pull request introduces 8 alerts when merging 006f5ae65008d695ae0721919176daf57095a6a6 into 9a50ce4 - view on LGTM.com new alerts:
|
006f5ae
to
7be2fa2
Compare
This pull request introduces 8 alerts when merging 7be2fa2840a6cac225f7e498aff944a6b2f34b2a into a2a435c - view on LGTM.com new alerts:
|
7be2fa2
to
855381c
Compare
This pull request introduces 1 alert when merging 855381c45069f4ca73beda440104cf0418c2e3b4 into df0da30 - view on LGTM.com new alerts:
|
51ca10a
to
ecb8d83
Compare
afca295
to
14c18f3
Compare
@abdosi can you check this PR as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as comments
tests/common/testbed.py
Outdated
@@ -204,7 +204,7 @@ def write_line_break(self, data=None): | |||
explicit_start=True, Dumper=IncIndentDumper) | |||
|
|||
def get_testbed_type(self, topo_name): | |||
pattern = re.compile(r'^(t0|t1|ptf|fullmesh|dualtor)') | |||
pattern = re.compile(r'^(t0|t1|ptf|fullmesh|dualtor|t2)') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we restrict to VoQ based T2 device ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a non VoQ based T2 ?
how to determine if this is VoQ based T2 or not in testbed.py ?
cc729cb
to
5a9b97a
Compare
5a9b97a
to
0163bab
Compare
cda4e96
to
1e0663a
Compare
This pull request introduces 7 alerts when merging 1e0663a21aaee5e609a4df2c5726864816055243 into 03744ce - view on LGTM.com new alerts:
|
a8d0530
to
bbb6d2c
Compare
@SuvarnaMeenakshi - please take a look, thanks |
92f6658
to
3ac9b72
Compare
This pull request introduces 7 alerts when merging 3ac9b726612255b508c6a00b6ffb9d211d295cd2 into 27e39a9 - view on LGTM.com new alerts:
|
@saravanansv LGTM alert should be fixed. |
3ac9b72
to
704a123
Compare
hwsku: "{{ hwsku }}" | ||
num_fabric_asic: "{{ num_fabric_asics | default(0) }}" | ||
asics_host_pfx: "{{ asics_host_ip | default(None) }}" | ||
asics_host_pfx6: "{{ asics_host_ipv6 | default(None) }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do these variables get their value?
num_fabric_asics
asics_host_ip
asics_host_ipv6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are coming from testbed.yaml -> lab -> config_sonic_basedon_testbed.yml
ansible/library/fabric_info.py
Outdated
key = "ASIC%d" % asic_id | ||
data = { 'asicname': key, | ||
'ip_prefix': asics_host_pfx % asic_id, | ||
'ip6_prefix': asics_host_pfx6 % asic_id } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assumes that variables like asics_host_pfx
and asics_host_pfx6
must be a string template. I assume it is like: 10.1.0.%s/32
In the template, %s
will be replaced with asic_id which is an integer between 0
and num_fabric_asic
.
In the example output:
ansible_facts{
fabric_info: [{'asicname': 'ASIC0', 'ip_prefix': '10.1.0.33/32', 'ip6_prefix': 'FC00:1::33/128'},
{'asicname': 'ASIC1', 'ip_prefix': '10.1.0.34/32', 'ip6_prefix': 'FC00:1::34/128'}]
}
It seems that there is no way to generate the IP addresses in the example based on a provided prefix and an integer asic ID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asics_host_pfx is '10.1.0.%d/32'.
do you want more comments in fabric_info ? or add a sample chassis-dut case to testbed-new.yml ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated to comments with sample arguments that can be passed for asics_host_pfx/asics_host_pfxv6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are two issues here:
- The sample in comments does not match the actual behavior of test code.
- Does generating ip_prefix for each ASIC based on asic_id and string template matches the behavior of how the actual ASIC ip_prefix is generated? Is the actual ASIC ip_prefix generated from a base IP plus asic_id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding 2., yes the generated ip_prefix, asicname with asic_id does work well in the testings so far.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you fix issue 2?
Probably the better way is to add asic_id to a base IP to generate ASIC IP?
704a123
to
6051144
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add BGPRouterDeclaration for the remote linecards in minigraph_cpg.j2. Other than that, looks good.
|
||
if card_type != 'supervisor': | ||
entry += "\tstart_switchid=" + str( start_switchid ) | ||
if num_asic is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per SAI VoQ switch proposal (https://github.com/opencomputeproject/SAI/blob/master/doc/VoQ/SAI-Proposal-VoQ-Switch.md#212-sai_switch_attr_switch_id) the switch_id needs to consider number of cores per chip(asic) as well as skip indexes.
https://github.com/opencomputeproject/SAI/blob/master/doc/VoQ/SAI-Proposal-VoQ-Switch.md#16-guideline-for-numbering-switches describes naming the switch ids.
One way to solve this would be to change the name from 'start_switchid' to be 'switchid' and have it be specified in the yml file. To support, multi-asic linecards, this could be a list.
For a single asic:
switchid=[6]
For 3 asic linecard:
switchid=[6,8,10]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right now the inputs are
- start_switchid
- default assumption that num_cores is 1
Apart from these two inputs, num_asics can also be an input to TestbedProcessing so that, it can generate the 6,8,10
So that we can make the math done by the TestbedProcessing instead of passing as inputing a list with manual calculations
print("\t\t" + host + " asics_host_ipv6 not found") | ||
|
||
try: #get voq_inband_ip | ||
voq_inband_ip = dev.get("voq_inband_ip") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To support multi-asic linecards, it might be helpful to make 'voq_inband_ip', 'voq_inband_ipv6' and 'voq_inband_port' a list with values per asic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it can either be list like you suggested or
just pass voq_inband_ip: "1.1.1.%d/24" % ( switchid ) where switchid iterates from start_switchid till num_asics
eca7822
to
a2afad3
Compare
a2afad3
to
b0470b7
Compare
I am OK with this PR except one issue. In the |
b0470b7
to
a916ba9
Compare
Addressed this by using ipaddress module in python to do the ipaddr-str to int conversion |
a916ba9
to
a9542c4
Compare
…band, iBGP-peers 1. Support chassis, multi-duts scenarios in TestbedProcessing. When testbed.yaml file contains card_type=Linecard or card_type=supervisor, TestbedProcessing will add that to lab, veos inventory files. When dut is multi-dut, TestbedProcessing will convert the dut type list to string. makeMain needs to publish supported_vm_types=[...] into main.yml 2. Support fabric_info generation in fabric_info.py when the num_asic > 0 and card_type is supervisor. 3. Use the fabric_info in minigraph templates to generated the fabric asic info. Also added SubRole=fabric, switch_type=fabric in DeviceMetadata for each fabric asic 4. Use variable name card_type instead of type in ansible, dut_utils.py and minigraph templates to be more explicit 5. allow t2 as a topo in testbed.py Linecard gen-minigraph related changes: 1. support adding inband data in LC's minigraph. VoqInbandInterfaces fields come from testbed.yaml (fields voq_inband_intf, voq_inband_type, voq_inband_ip) to lab/veos inventory files to minigraph. Data flows from testbed.yaml (fields voq_inband_intf, voq_inband_type, voq_inband_ip) to lab/veos inventory files to minigraph. 2. System ports Data flows from a. port_config.ini (new fileds required are: numVoq, coreId, corePortId), (existing fields: name, speed) b. switchId = running asic_id count across all linecards in the chassis c. systemPortId = running systemport count across all linecards in the chassis Each dut adds its own system-ports to its own ansible_facts. config_sonic_basedon_testbed.yml loops through all duts system-ports to create all_sysports d. added changes to port_alias to generate system ports for Recirc ports as well e. hostname comes from config_sonic_basedon_testbed.yml, asicname created in port_alias from asic_id when looping through num_asics 3. DeviceProperty <a:DeviceProperty> <a:Name>SwitchType</a:Name> <a:Reference i:nil="true"/> <a:Value>voq</a:Value> </a:DeviceProperty> <a:DeviceProperty> <a:Name>MaxCores</a:Name> <a:Reference i:nil="true"/> <a:Value>16</a:Value> </a:DeviceProperty> <a:DeviceProperty> <a:Name>SwitchId</a:Name> <a:Reference i:nil="true"/> <a:Value>0</a:Value> </a:DeviceProperty> a. switch type, maxcores are directly from testbed.yaml to inventory files to minigraph b. start_switchid is calculated for each linecard and set into inventory files from TestbedProcessing.py based on num_asics from previous linecards 4. iBGP peers iBGP sessions are setup between inband-ipaddress on all linecards a. take all voq_inband_ip to form a list all_inbands in ansible/config_sonic_basedon_testbed.yml b. minigraph_cpg iterates through all_inbands and configures a BGPSession, BGPPeer between the voq_inband_ip and all other addresses in all_inbands
a9542c4
to
c7dc0fd
Compare
Hi @wangxin - could you please help with merge asap, other test PR have dependency on this. |
@abdosi part of addressing this review comment, the import ipaddress got added |
…3746) What is the motivation for this PR? Support for generating minigraph for multi-asic linecards in a VoQ chassis is missing. Also, for multi-asic linecards we needed to add support for Loopback4096 interfaces, such that they can be used as the router-id for the iBGP connectivity. How did you do it? Support for minigraph generation for single asic linecards and supervisor card was done as part of PR #3245. This introduced several fields into the ansible inventory required for VoQ chassis linecard. However, for multi-asic linecards these fields in the inventory (from TestbedProcessing.py) are converted to lists instead of a single value. The fields changed are: switchids - instead of start_switchid voq_inband_ip voq_inband_ipv6 voq_inband_intf We also added the following fields to support Loopback4096 interfaces on the asics of a multi-asic linecard. loopback4096_ip loopback4096_ipv6 The minigraph templates were modified to use generate asic level metadata for all asics in a linecard. We added minigraph_dpg_voq_asic.j2 template to generate asic DPG definitions for multi-asic linecards. Also modified test_bgp_facts to include BGP_VOQ_CHASSIS_NEIGHBOR's in its checking of all bgp neighbors. How did you verify/test it? Generated minigraphs for single asic and multi-asic linecards and supervisor cards and validated configs generated using 'config load_minigraph' command in SONiC.
…band, iBGP-peers (sonic-net#3245) 1. Support chassis, multi-duts scenarios in TestbedProcessing. When testbed.yaml file contains card_type=Linecard or card_type=supervisor, TestbedProcessing will add that to lab, veos inventory files. When dut is multi-dut, TestbedProcessing will convert the dut type list to string. makeMain needs to publish supported_vm_types=[...] into main.yml 2. Support fabric_info generation in fabric_info.py when the num_asic > 0 and card_type is supervisor. 3. Use the fabric_info in minigraph templates to generated the fabric asic info. Also added SubRole=fabric, switch_type=fabric in DeviceMetadata for each fabric asic 4. Use variable name card_type instead of type in ansible, dut_utils.py and minigraph templates to be more explicit 5. allow t2 as a topo in testbed.py Linecard gen-minigraph related changes: 1. support adding inband data in LC's minigraph. VoqInbandInterfaces fields come from testbed.yaml (fields voq_inband_intf, voq_inband_type, voq_inband_ip) to lab/veos inventory files to minigraph. Data flows from testbed.yaml (fields voq_inband_intf, voq_inband_type, voq_inband_ip) to lab/veos inventory files to minigraph. 2. System ports Data flows from a. port_config.ini (new fileds required are: numVoq, coreId, corePortId), (existing fields: name, speed) b. switchId = running asic_id count across all linecards in the chassis c. systemPortId = running systemport count across all linecards in the chassis Each dut adds its own system-ports to its own ansible_facts. config_sonic_basedon_testbed.yml loops through all duts system-ports to create all_sysports d. added changes to port_alias to generate system ports for Recirc ports as well e. hostname comes from config_sonic_basedon_testbed.yml, asicname created in port_alias from asic_id when looping through num_asics 3. DeviceProperty <a:DeviceProperty> <a:Name>SwitchType</a:Name> <a:Reference i:nil="true"/> <a:Value>voq</a:Value> </a:DeviceProperty> <a:DeviceProperty> <a:Name>MaxCores</a:Name> <a:Reference i:nil="true"/> <a:Value>16</a:Value> </a:DeviceProperty> <a:DeviceProperty> <a:Name>SwitchId</a:Name> <a:Reference i:nil="true"/> <a:Value>0</a:Value> </a:DeviceProperty> a. switch type, maxcores are directly from testbed.yaml to inventory files to minigraph b. start_switchid is calculated for each linecard and set into inventory files from TestbedProcessing.py based on num_asics from previous linecards 4. iBGP peers iBGP sessions are setup between inband-ipaddress on all linecards a. take all voq_inband_ip to form a list all_inbands in ansible/config_sonic_basedon_testbed.yml b. minigraph_cpg iterates through all_inbands and configures a BGPSession, BGPPeer between the voq_inband_ip and all other addresses in all_inbands
…onic-net#3746) What is the motivation for this PR? Support for generating minigraph for multi-asic linecards in a VoQ chassis is missing. Also, for multi-asic linecards we needed to add support for Loopback4096 interfaces, such that they can be used as the router-id for the iBGP connectivity. How did you do it? Support for minigraph generation for single asic linecards and supervisor card was done as part of PR sonic-net#3245. This introduced several fields into the ansible inventory required for VoQ chassis linecard. However, for multi-asic linecards these fields in the inventory (from TestbedProcessing.py) are converted to lists instead of a single value. The fields changed are: switchids - instead of start_switchid voq_inband_ip voq_inband_ipv6 voq_inband_intf We also added the following fields to support Loopback4096 interfaces on the asics of a multi-asic linecard. loopback4096_ip loopback4096_ipv6 The minigraph templates were modified to use generate asic level metadata for all asics in a linecard. We added minigraph_dpg_voq_asic.j2 template to generate asic DPG definitions for multi-asic linecards. Also modified test_bgp_facts to include BGP_VOQ_CHASSIS_NEIGHBOR's in its checking of all bgp neighbors. How did you verify/test it? Generated minigraphs for single asic and multi-asic linecards and supervisor cards and validated configs generated using 'config load_minigraph' command in SONiC.
When testbed.yaml file contains cardtype=Linecard or cardtype=supervisor,
TestbedProcessing will add that to lab, veos inventory files.
When dut is multi-dut, TestbedProcessing will convert the dut type list to string.
Description of PR
Summary:
Fixes # (issue)
Type of change
Approach
What is the motivation for this PR?
How did you do it?
How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation