You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[systemd/systemd-sonic-generator]: Systemd midplane network service of Smart Switch (#18178)
Why I did it
Add systemd network service of Smart Switch for configuring the midplane network.
How I did it
Add related systemd services and networkd configuration
According to paltform.json, the systemd-sonic-generator will install required services.
The changes are based on the HLD: sonic-net/SONiC#1534 and sonic-net/SONiC#1586
How to verify it
Check Azp that no failure to the existing testcases
Check NPU scenario:
2.1 Start a KVM and add the NPU platform.json as following
echo '{"DPUS":{"dpu0":{}, "dpu1":{}}}' | sudo tee /usr/share/sonic/device/x86_64-kvm_x86_64-r0/platform.json
2.2 You should get two specific database containers for DPU
admin@vlab-01:~$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4455f7ab611c docker-database:latest "/usr/local/bin/dock…" 5 minutes ago Up 5 minutes databasedpu0
8e983b5beb27 docker-database:latest "/usr/local/bin/dock…" 5 minutes ago Up 5 minutes databasedpu1
2.3 Check the expected service midplane-network-npu.service is enabled but the midplane-network-dpu.service is disabled
admin@vlab-01:~$ sudo systemctl list-unit-files '*midplane*'
UNIT FILE STATE PRESET
midplane-network-dpu.service disabled enabled
midplane-network-npu.service enabled-runtime enabled
2.4 Check the bridge-midplane has been created.
admin@vlab-01:~$ sudo brctl show
bridge name bridge id STP enabled interfaces
...
bridge-midplane 8000.76c5a51a18f6 no dummy-midplane
2.5 If we create two mock dpu interfaces, they should be added into the bridge-midplane automatically
admin@vlab-01:~$ sudo ip link add dpu0 type veth peer dpu1
admin@vlab-01:~$ sudo brctl show
bridge name bridge id STP enabled interfaces
...
bridge-midplane 8000.76c5a51a18f6 no dpu0 dpu1 dummy-midplane
Check DPU scenario:
3.1 Start a KVM and add the DPU platform.json as following
echo '{"DPU":{}}' | sudo tee /usr/share/sonic/device/x86_64-kvm_x86_64-r0/platform.json
3.2 Check the expected service midplane-network-dpu.service is enabled but the midplane-network-npu.service is disabled
admin@vlab-01:~$ sudo systemctl list-unit-files '*midplane*'
UNIT FILE STATE PRESET
midplane-network-dpu.service disabled enabled
midplane-network-npu.service enabled-runtime enabled
3.3 The database service should be started after(waiting for) midplane-network-dpu.service with a 10mins delay
admin@vlab-01:~$ uptime
16:08:21 up 29 min, 1 user, load average: 0.01, 0.08, 0.12
admin@vlab-01:~$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
...
ae5195283cd6 docker-database:latest "/usr/local/bin/dock…" 35 minutes ago Up 18 minutes database
29min-18min≈10mins (Because in the KVM, we don't have an exact eth0-midplane interface and its DHCP provider)
Signed-off-by: Ze Gan <[email protected]>
# According to the issue: https://github.com/systemd/systemd/issues/19106, To disable ManageForeignRoutingPolicyRules to avoid the ip rules being deleted by systemd-networkd
664
+
sudo sed -i 's/#ManageForeignRoutingPolicyRules=yes/ManageForeignRoutingPolicyRules=no/g'$FILESYSTEM_ROOT/etc/systemd/networkd.conf
# The systemd-networkd requires that the bridge interface(bridge-midplane) has at least one member interface, otherwise the IP address will not be configured.
2
+
# This dummy interface will be added into the bridge-midplane as a member to guarantee the IP address configuration correctly.
0 commit comments