[docker-sonic-vs]: dd NPU SKU for docker-sonic-vs (#15604)

Define a generic 2-port NPU SKU for docker-sonic-vs to 
enable DASH vstests to pass on azure pipelines

Work item tracking
Microsoft ADO 24375371:

How I did it
Define a generic 2-port NPU hwsku that is used only for DASH-specific vstests.

Signed-off-by: Prabhat Aravind <paravind@microsoft.com>
This commit is contained in:
prabhataravind 2023-06-27 14:10:53 -07:00 committed by GitHub
parent bf5b72a356
commit d4de62d155
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 3 deletions

View File

@ -0,0 +1,5 @@
SAI_VS_SWITCH_TYPE=SAI_VS_SWITCH_TYPE_NPU
SAI_VS_HOSTIF_USE_TAP_DEVICE=true
SAI_VS_INTERFACE_LANE_MAP_FILE=/usr/share/sonic/hwsku/lanemap.ini
SAI_VS_CORE_PORT_INDEX_MAP_FILE=/usr/share/sonic/hwsku/coreportindexmap.ini
SAI_VS_INTERFACE_FABRIC_LANE_MAP_FILE=/usr/share/sonic/hwsku/fabriclanemap.ini

View File

@ -147,6 +147,7 @@ COPY ["zero_profiles.json", "/etc/sonic"]
COPY ["buffermgrd.sh", "/usr/bin/"]
COPY ["platform.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/"]
COPY ["platform-npu-2p.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/"]
COPY ["hwsku.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/Force10-S6000/"]
COPY ["hwsku.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/brcm_gearbox_vs/"]
COPY ["hwsku.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/Mellanox-SN2700/"]

View File

@ -0,0 +1,23 @@
{
"interfaces": {
"Ethernet0": {
"index": "1,1,1,1",
"lanes": "0,1,2,3",
"breakout_modes": {
"1x100G": ["etp1"],
"1x100G[50G,40G,25G,10G]": ["etp1"],
"2x50G[25G,10G]": ["etp1a", "etp1b"],
"4x10G[25G]": ["etp1a", "etp1b", "etp1c", "etp1d"]
}
},
"Ethernet4": {
"index": "2,2,2,2",
"lanes": "4,5,6,7",
"breakout_modes": {
"1x100G": ["etp2"],
"1x100G[50G,40G,25G,10G]": ["etp2"],
"2x50G[25G,10G]": ["etp2a", "etp2b"]
}
}
}
}

View File

@ -8,6 +8,11 @@
ln -sf /usr/share/sonic/device/$PLATFORM /usr/share/sonic/platform
ln -sf /usr/share/sonic/device/$PLATFORM/$HWSKU /usr/share/sonic/hwsku
PLATFORM_CONF=platform.json
if [[ $HWSKU == "NPU-2P" ]]; then
PLATFORM_CONF=platform-npu-2p.json
fi
pushd /usr/share/sonic/hwsku
# filter available front panel ports in lanemap.ini
@ -45,9 +50,14 @@ if [ -f /etc/sonic/config_db.json ]; then
mv /tmp/config_db.json /etc/sonic/config_db.json
else
# generate and merge buffers configuration into config file
sonic-cfggen -k $HWSKU -p /usr/share/sonic/device/$PLATFORM/platform.json -t /usr/share/sonic/hwsku/buffers.json.j2 > /tmp/buffers.json
sonic-cfggen -j /etc/sonic/init_cfg.json -t /usr/share/sonic/hwsku/qos.json.j2 > /tmp/qos.json
sonic-cfggen -p /usr/share/sonic/device/$PLATFORM/platform.json -k $HWSKU --print-data > /tmp/ports.json
if [ -f /usr/share/sonic/hwsku/buffers.json.j2 ]; then
sonic-cfggen -k $HWSKU -p /usr/share/sonic/device/$PLATFORM/$PLATFORM_CONF -t /usr/share/sonic/hwsku/buffers.json.j2 > /tmp/buffers.json
fi
if [ -f /usr/share/sonic/hwsku/qos.json.j2 ]; then
sonic-cfggen -j /etc/sonic/init_cfg.json -t /usr/share/sonic/hwsku/qos.json.j2 > /tmp/qos.json
fi
sonic-cfggen -p /usr/share/sonic/device/$PLATFORM/$PLATFORM_CONF -k $HWSKU --print-data > /tmp/ports.json
# change admin_status from up to down; Test cases dependent
sed -i "s/up/down/g" /tmp/ports.json
sonic-cfggen -j /etc/sonic/init_cfg.json -j /tmp/buffers.json -j /tmp/qos.json -j /tmp/ports.json --print-data > /etc/sonic/config_db.json
@ -56,6 +66,8 @@ sonic-cfggen -t /usr/share/sonic/templates/copp_cfg.j2 > /etc/sonic/copp_cfg.jso
if [ "$HWSKU" == "Mellanox-SN2700" ]; then
cp /usr/share/sonic/hwsku/sai_mlnx.profile /usr/share/sonic/hwsku/sai.profile
elif [ "$HWSKU" == "NPU" ]; then
cp /usr/share/sonic/hwsku/sai_npu.profile /usr/share/sonic/hwsku/sai.profile
fi
mkdir -p /etc/swss/config.d/