From 8171bfefc87bfa0ae4fd4bc80007debcf248493a Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Thu, 9 Sep 2021 11:03:22 -0700 Subject: [PATCH] Enhancing vs support to mock based on platform (#8685) --- platform/vs/docker-sonic-vs/start.sh | 4 ++++ src/sonic-device-data/Makefile | 1 + src/sonic-device-data/src/sai_mlnx.vs_profile | 5 +++++ 3 files changed, 10 insertions(+) create mode 100644 src/sonic-device-data/src/sai_mlnx.vs_profile diff --git a/platform/vs/docker-sonic-vs/start.sh b/platform/vs/docker-sonic-vs/start.sh index 2d771a3cc6fd..93c9cf479d69 100755 --- a/platform/vs/docker-sonic-vs/start.sh +++ b/platform/vs/docker-sonic-vs/start.sh @@ -53,6 +53,10 @@ else fi sonic-cfggen -t /usr/share/sonic/templates/copp_cfg.j2 > /etc/sonic/copp_cfg.json +if [ "$fake_platform" == "mellanox" ]; then + cp /usr/share/sonic/hwsku/sai_mlnx.profile /usr/share/sonic/hwsku/sai.profile +fi + mkdir -p /etc/swss/config.d/ rm -f /var/run/rsyslogd.pid diff --git a/src/sonic-device-data/Makefile b/src/sonic-device-data/Makefile index 3de98ef84b42..2077e98f3e98 100644 --- a/src/sonic-device-data/Makefile +++ b/src/sonic-device-data/Makefile @@ -18,6 +18,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : for d in `find -L ../../../device -maxdepth 3 -mindepth 3 -type d | grep -vE "(plugins|led-code)"`; do \ cp -Lr $$d device/x86_64-kvm_x86_64-r0/ ; \ cp ./sai.vs_profile device/x86_64-kvm_x86_64-r0/$$(basename $$d)/sai.profile; \ + cp ./sai_mlnx.vs_profile device/x86_64-kvm_x86_64-r0/$$(basename $$d)/sai_mlnx.profile; \ grep -v ^# device/x86_64-kvm_x86_64-r0/$$(basename $$d)/port_config.ini | awk '{i=i+1;print "eth"i":"$$2}' > device/x86_64-kvm_x86_64-r0/$$(basename $$d)/lanemap.ini cp ./pai.vs_profile device/x86_64-kvm_x86_64-r0/$$(basename $$d)/pai.profile; \ grep -v ^# device/x86_64-kvm_x86_64-r0/$$(basename $$d)/port_config.ini | awk '{i=i+1;print "eth"i":"$$2}' > device/x86_64-kvm_x86_64-r0/$$(basename $$d)/lanemap.ini diff --git a/src/sonic-device-data/src/sai_mlnx.vs_profile b/src/sonic-device-data/src/sai_mlnx.vs_profile new file mode 100644 index 000000000000..7b54438c4130 --- /dev/null +++ b/src/sonic-device-data/src/sai_mlnx.vs_profile @@ -0,0 +1,5 @@ +SAI_VS_SWITCH_TYPE=SAI_VS_SWITCH_TYPE_MLNX2700 +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