From 85921af8b1b30134b78936133392af0e083becec Mon Sep 17 00:00:00 2001 From: Stephen Sun <5379172+stephenxs@users.noreply.github.com> Date: Wed, 8 Feb 2023 04:55:53 +0800 Subject: [PATCH] [Mellanox] Enable DSCP remapping by using SAI attribute (#1188) * Enable DSCP remapping by using SAI attribute Signed-off-by: Stephen Sun * Remove space at the end of line Signed-off-by: Stephen Sun --------- Signed-off-by: Stephen Sun --- syncd/scripts/syncd_init_common.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/syncd/scripts/syncd_init_common.sh b/syncd/scripts/syncd_init_common.sh index 38f18ccc5..78135c22a 100644 --- a/syncd/scripts/syncd_init_common.sh +++ b/syncd/scripts/syncd_init_common.sh @@ -195,6 +195,10 @@ config_syncd_mlnx() # Read MAC address MAC_ADDRESS="$(echo $SYNCD_VARS | jq -r '.mac')" + # Read dual ToR and DSCP remapping information + DUAL_TOR="$(echo $SYNCD_VARS | jq -r '.dual_tor')" + DSCP_REMAPPING="$(echo $SYNCD_VARS | jq -r '.dscp_remapping')" + # Make default sai.profile if [[ -f $HWSKU_DIR/sai.profile.j2 ]]; then export RESOURCE_TYPE="$(echo $SYNCD_VARS | jq -r '.resource_type')" @@ -207,6 +211,10 @@ config_syncd_mlnx() echo "DEVICE_MAC_ADDRESS=$MAC_ADDRESS" >> /tmp/sai.profile echo "SAI_WARM_BOOT_WRITE_FILE=/var/warmboot/" >> /tmp/sai.profile + if [[ "$DUAL_TOR" == "enable" ]] && [[ "$DSCP_REMAPPING" == "enable" ]]; then + echo "SAI_DSCP_REMAPPING_ENABLED=1" >> /tmp/sai.profile + fi + SDK_DUMP_PATH=`cat /tmp/sai.profile|grep "SAI_DUMP_STORE_PATH"|cut -d = -f2` if [ ! -d "$SDK_DUMP_PATH" ]; then mkdir -p "$SDK_DUMP_PATH"