[Mellanox][VXLAN] add params to vxlan.json file in order to configure VXLAN src port range feature (#9658)

- Why I did it
Remove obsolete parameter that enables static VXLAN src port range
provide functionality no generate json config file according to appropriate parameter in config_db
Done for
SN3800:
• Mellanox-SN3800-D28C50
• Mellanox-SN3800-C64
• Mellanox-SN3800-D28C49S1 (New 10G SKU)

SN2700:
• Mellanox-SN2700-D48C8

- How I did it
Remove SAI_VXLAN_SRCPORT_RANGE_ENABLE=1 from appropriate sai.profile files
Created vxlan.json file and added few params that depends on DEVICE_METADATA.localhost.vxlan_port_range

- How to verify it
File /etc/swss/config.d/vxlan.json should be generated inside swss docker when it restart
[
    {
        "SWITCH_TABLE:switch": {
            "vxlan_src": "0xFF00",
            "vxlan_mask": "8"
        },
        "OP": "SET"
    }
]
Signed-off-by: Andriy Yurkiv <ayurkiv@nvidia.com>
This commit is contained in:
Andriy Yurkiv 2022-01-31 15:57:30 +02:00 committed by GitHub
parent a0df351869
commit cb3b9416a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 14 additions and 6 deletions

View File

@ -1,4 +1,3 @@
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2700_48x50g_8x100g.xml
SAI_VXLAN_SRCPORT_RANGE_ENABLE=1
SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps
SAI_DUMP_STORE_AMOUNT=10

View File

@ -1,4 +1,3 @@
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800.xml
SAI_VXLAN_SRCPORT_RANGE_ENABLE=1
SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps
SAI_DUMP_STORE_AMOUNT=10

View File

@ -1,4 +1,3 @@
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800_1x10g_28x50g_49x100g.xml
SAI_VXLAN_SRCPORT_RANGE_ENABLE=1
SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps
SAI_DUMP_STORE_AMOUNT=10

View File

@ -1,4 +1,3 @@
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800_28x50g_52x100g.xml
SAI_VXLAN_SRCPORT_RANGE_ENABLE=1
SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps
SAI_DUMP_STORE_AMOUNT=10

View File

@ -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 \

View File

@ -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

View File

@ -0,0 +1,11 @@
[
{
"SWITCH_TABLE:switch": {
{% if DEVICE_METADATA.localhost.vxlan_port_range == 'enable' %}
"vxlan_sport": "0xFF00",
"vxlan_mask": "8"
{% endif %}
},
"OP": "SET"
}
]

View File

@ -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