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

Summary:New smartswitch DPU config template #16201

Merged
merged 11 commits into from
Jan 22, 2025
10 changes: 10 additions & 0 deletions ansible/config_sonic_basedon_testbed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,16 @@
shell: bash "/etc/sonic/apply_clet.sh"
when: stat_result.stat.exists is defined and stat_result.stat.exists

- block:
nnelluri-cisco marked this conversation as resolved.
Show resolved Hide resolved
- name: create dpu config file for SONiC device
template: src=templates/dpu_config.j2
dest=/etc/sonic/dpu_config.json
become: true

- name: active dpu config
become: true
shell: sonic-cfggen -j /etc/sonic/dpu_config.json -w

- block:
- name: create isis config file for SONiC device
template: src=templates/isis_config.j2
Expand Down
40 changes: 40 additions & 0 deletions ansible/lab
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,43 @@ sonic_cisco_vs:
hwsku: cisco-8101-p4-32x100-vs
ansible_host: 10.250.0.125
ansible_hostv6: fec0::ffff:afa:13

sonic_cisco_smartswitch:
vars:
hwsku: Cisco-8102-28FH-DPU-O-T1
dpu_username: admin
iface_speed: 400000
num_asics: 1
plt_reboot_dict:
acl/test_acl.py::TestAclWithReboot:
timeout: 540
wait: 660

midplane_network:
bridge_name: "bridge-midplane"
bridge_address: "169.254.200.254/24"

device_metadata:
localhost:
subtype: "SmartSwitch"

feature:
dhcp_server:
auto_restart: "enabled"
state: "enabled"
dhcp_relay:
auto_restart: "enabled"
state: "enabled"

mid_plane_bridge:
global:
bridge: "bridge-midplane"
ip_prefix: "169.254.200.254/24"

dhcp_server_ipv4:
bridge-midplane:
gateway: "169.254.200.254"
lease_time: "600000000"
mode: "PORT"
netmask: "255.255.255.0"
state: "enabled"
80 changes: 80 additions & 0 deletions ansible/templates/dpu_config.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"CHASSIS_MODULE": {
{% for dpu in range(8) -%}
"DPU{{ dpu }}": {
"admin_status": "up"
}{% if not loop.last %},{% endif %}
{%- endfor %}

},
"midplane_network": {
"bridge_name": "{{ midplane_network.bridge_name }}",
"bridge_address": "{{ midplane_network.bridge_address }}"
},
"DEVICE_METADATA": {
"localhost": {
"subtype": "{{ device_metadata.localhost.subtype }}"
}
},
"FEATURE": {
"dhcp_server": {
"auto_restart": "{{ feature.dhcp_server.auto_restart }}",
"state": "{{ feature.dhcp_server.state }}"
},
"dhcp_relay": {
"auto_restart": "{{ feature.dhcp_relay.auto_restart }}",
"state": "{{ feature.dhcp_relay.state }}"
}
},
"MID_PLANE_BRIDGE": {
"GLOBAL": {
"bridge": "{{ mid_plane_bridge.global.bridge }}",
"ip_prefix": "{{ mid_plane_bridge.global.ip_prefix }}"
}
},
"DHCP_SERVER_IPV4": {
"{{ midplane_network.bridge_name }}": {
"gateway": "{{ dhcp_server_ipv4[midplane_network.bridge_name].gateway }}",
"lease_time": "{{ dhcp_server_ipv4[midplane_network.bridge_name].lease_time }}",
"mode": "{{ dhcp_server_ipv4[midplane_network.bridge_name].mode }}",
"netmask": "{{ dhcp_server_ipv4[midplane_network.bridge_name].netmask }}",
"state": "{{ dhcp_server_ipv4[midplane_network.bridge_name].state }}"

}
},
"DHCP_SERVER_IPV4_PORT": {
{% for dpu in range(8) -%}
"{{ midplane_network.bridge_name }}|dpu{{ dpu }}": {
"ips": [
"{{ '169.254.200.' ~ dpu }}"
]
}{% if not loop.last %},{% endif %}
{%- endfor %}

},
"DPUS": {
{% for dpu in range(8) -%}
"dpu{{ dpu }}": {
"midplane_interface": "dpu{{ dpu }}"
}{% if not loop.last %},{% endif %}
{%- endfor %}

},
"INTERFACE": {
{% for i in range(8) -%}
"Ethernet-BP{{ i }}": {},
"Ethernet-BP{{ i }}|18.{{ i }}.202.0/31": {}{% if not loop.last %},
{% endif %}
{%- endfor %}

},
"PORT": {
{% for dpu in range(8) -%}
"Ethernet-BP{{ dpu }}": {
"admin_status": "up"
}{% if not loop.last %},{% endif %}
{%- endfor %}

}

}
Loading