From 7026441c83382530c0a2329b7ea15a0c48e6d0bb 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 3b109af80..32a672590 100644 --- a/syncd/scripts/syncd_init_common.sh +++ b/syncd/scripts/syncd_init_common.sh @@ -199,6 +199,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')" @@ -211,6 +215,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"