From ad4c33cc58a2704a4721f94d7202a449f0efbfac Mon Sep 17 00:00:00 2001 From: Andriy Yurkiv Date: Wed, 8 Dec 2021 18:33:10 +0000 Subject: [PATCH] [Mellanox][VXLAN] add params to vxlan.json file in order to configure VXLAN src port range feature Signed-off-by: Andriy Yurkiv --- dockers/docker-orchagent/docker-init.sh | 1 + dockers/docker-orchagent/swssconfig.sh | 2 +- dockers/docker-orchagent/vxlan.json.j2 | 11 +++++++++++ rules/sonic-config.dep | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 dockers/docker-orchagent/vxlan.json.j2 diff --git a/dockers/docker-orchagent/docker-init.sh b/dockers/docker-orchagent/docker-init.sh index 86070ff24db9..da5a9463281d 100755 --- a/dockers/docker-orchagent/docker-init.sh +++ b/dockers/docker-orchagent/docker-init.sh @@ -8,6 +8,7 @@ CFGGEN_PARAMS=" \ -d \ -y /etc/sonic/constants.yml \ -t /usr/share/sonic/templates/switch.json.j2,/etc/swss/config.d/switch.json \ + -t /usr/share/sonic/templates/vxlan.json.j2,/etc/swss/config.d/vxlan.json \ -t /usr/share/sonic/templates/ipinip.json.j2,/etc/swss/config.d/ipinip.json \ -t /usr/share/sonic/templates/ports.json.j2,/etc/swss/config.d/ports.json \ -t /usr/share/sonic/templates/vlan_vars.j2 \ diff --git a/dockers/docker-orchagent/swssconfig.sh b/dockers/docker-orchagent/swssconfig.sh index 929e70769a69..701d44ca8a3c 100755 --- a/dockers/docker-orchagent/swssconfig.sh +++ b/dockers/docker-orchagent/swssconfig.sh @@ -58,7 +58,7 @@ if [[ "$SYSTEM_WARM_START" == "true" ]] || [[ "$SWSS_WARM_START" == "true" ]]; t exit 0 fi -SWSSCONFIG_ARGS="ipinip.json ports.json switch.json " +SWSSCONFIG_ARGS="ipinip.json ports.json switch.json vxlan.json" for file in $SWSSCONFIG_ARGS; do swssconfig /etc/swss/config.d/$file diff --git a/dockers/docker-orchagent/vxlan.json.j2 b/dockers/docker-orchagent/vxlan.json.j2 new file mode 100644 index 000000000000..f0b73467326c --- /dev/null +++ b/dockers/docker-orchagent/vxlan.json.j2 @@ -0,0 +1,11 @@ +[ + { + "SWITCH_TABLE:switch": { +{% if DEVICE_METADATA.localhost.vxlan_port_range == 'enable' %} + "vxlan_sport": "0xFF00", + "vxlan_mask": "8" +{% endif %} + }, + "OP": "SET" + } +] diff --git a/rules/sonic-config.dep b/rules/sonic-config.dep index 05a02a6027ac..ded91f7a6e89 100644 --- a/rules/sonic-config.dep +++ b/rules/sonic-config.dep @@ -4,7 +4,7 @@ SPATH := $($(SONIC_CONFIG_ENGINE_PY3)_SRC_PATH) DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-config.mk rules/sonic-config.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) DEP_FILES += $(shell git ls-files $(SPATH)) -DEP_FILES += files/image_config/interfaces/interfaces.j2 dockers/docker-orchagent/ports.json.j2 dockers/docker-dhcp-relay/wait_for_intf.sh.j2 dockers/docker-dhcp-relay/docker-dhcp-relay.supervisord.conf.j2 dockers/docker-lldp/lldpd.conf.j2 dockers/docker-orchagent/ipinip.json.j2 $(wildcard device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/*.j2 device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/*.j2) files/build_templates/qos_config.j2 dockers/docker-orchagent/switch.json.j2 files/image_config/constants/constants.yml +DEP_FILES += files/image_config/interfaces/interfaces.j2 dockers/docker-orchagent/ports.json.j2 dockers/docker-dhcp-relay/wait_for_intf.sh.j2 dockers/docker-dhcp-relay/docker-dhcp-relay.supervisord.conf.j2 dockers/docker-lldp/lldpd.conf.j2 dockers/docker-orchagent/ipinip.json.j2 $(wildcard device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/*.j2 device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/*.j2) files/build_templates/qos_config.j2 dockers/docker-orchagent/switch.json.j2 dockers/docker-orchagent/vxlan.json.j2 files/image_config/constants/constants.yml ifeq ($(ENABLE_PY2_MODULES), y) $(SONIC_CONFIG_ENGINE_PY2)_CACHE_MODE := GIT_CONTENT_SHA