From 37e30239278b3c56b27ddd1f623095482bb4a714 Mon Sep 17 00:00:00 2001 From: Liping Xu <108326363+lipxu@users.noreply.github.com> Date: Tue, 15 Jul 2025 12:15:33 +0800 Subject: [PATCH 1/6] [202411][frr]: Force disable next hop group support (#23292) [202411][frr]: Force disable next hop group support Signed-off-by: Liping Xu --- dockers/docker-fpm-frr/docker_init.sh | 4 ++++ dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 | 2 ++ platform/vs/docker-sonic-vs/frr/zebra.conf | 3 +-- src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf | 2 ++ .../tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf | 2 ++ .../tests/sample_output/py2/t2-chassis-fe-zebra.conf | 2 ++ .../tests/sample_output/py2/zebra_frr.conf | 2 ++ .../tests/sample_output/py2/zebra_frr_dualtor.conf | 2 ++ .../tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf | 2 ++ .../tests/sample_output/py3/t2-chassis-fe-zebra.conf | 2 ++ .../tests/sample_output/py3/zebra_frr.conf | 2 ++ .../tests/sample_output/py3/zebra_frr_dualtor.conf | 2 ++ 12 files changed, 25 insertions(+), 2 deletions(-) diff --git a/dockers/docker-fpm-frr/docker_init.sh b/dockers/docker-fpm-frr/docker_init.sh index 94107846c7a..3d550247890 100755 --- a/dockers/docker-fpm-frr/docker_init.sh +++ b/dockers/docker-fpm-frr/docker_init.sh @@ -49,6 +49,10 @@ write_default_zebra_config() echo "no fpm use-next-hop-groups" >> $FILE_NAME echo "fpm address 127.0.0.1" >> $FILE_NAME } + + grep -q '^no zebra nexthop kernel enable' $FILE_NAME || { + echo "no zebra nexthop kernel enable" >> $FILE_NAME + } } if [[ ! -z "$NAMESPACE_ID" ]]; then diff --git a/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 b/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 index 759cd2f8c38..128bc9c5870 100644 --- a/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 +++ b/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 @@ -7,6 +7,8 @@ {% endblock banner %} ! {% block fpm %} +! Force disable next hop group support +no zebra nexthop kernel enable {% if ( ('localhost' in DEVICE_METADATA) and ('nexthop_group' in DEVICE_METADATA['localhost']) and (DEVICE_METADATA['localhost']['nexthop_group'] == 'enabled') ) %} ! enable next hop group support diff --git a/platform/vs/docker-sonic-vs/frr/zebra.conf b/platform/vs/docker-sonic-vs/frr/zebra.conf index 695d339cdeb..9e3bd42315d 100644 --- a/platform/vs/docker-sonic-vs/frr/zebra.conf +++ b/platform/vs/docker-sonic-vs/frr/zebra.conf @@ -1,5 +1,4 @@ +no zebra nexthop kernel enable no fpm use-next-hop-groups - fpm address 127.0.0.1 zebra nexthop-group keep 1 - diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf index c22fa8c7f93..23ef6d096b1 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf @@ -4,6 +4,8 @@ ! file: zebra.conf ! ! +! Force disable next hop group support +no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf index 0761e4b2049..042f3ed16e3 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf @@ -4,6 +4,8 @@ ! file: zebra.conf ! ! +! Force disable next hop group support +no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf index ad04eacbc8c..5eea029e8f8 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf @@ -4,6 +4,8 @@ ! file: zebra.conf ! ! +! Force disable next hop group support +no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf b/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf index 129a98e3c23..01a101daa54 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf @@ -4,6 +4,8 @@ ! file: zebra.conf ! ! +! Force disable next hop group support +no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/zebra_frr_dualtor.conf b/src/sonic-config-engine/tests/sample_output/py2/zebra_frr_dualtor.conf index a6cf1c42b07..e7898516bd5 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/zebra_frr_dualtor.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/zebra_frr_dualtor.conf @@ -4,6 +4,8 @@ ! file: zebra.conf ! ! +! Force disable next hop group support +no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf index a238f3362ad..38e73e3ef29 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf @@ -4,6 +4,8 @@ ! file: zebra.conf ! ! +! Force disable next hop group support +no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf index 55576c57349..d59b436e152 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf @@ -4,6 +4,8 @@ ! file: zebra.conf ! ! +! Force disable next hop group support +no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf b/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf index dadb8972345..866d20a86ee 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf @@ -4,6 +4,8 @@ ! file: zebra.conf ! ! +! Force disable next hop group support +no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/zebra_frr_dualtor.conf b/src/sonic-config-engine/tests/sample_output/py3/zebra_frr_dualtor.conf index 3bdb18fbc56..9885089b08a 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/zebra_frr_dualtor.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/zebra_frr_dualtor.conf @@ -4,6 +4,8 @@ ! file: zebra.conf ! ! +! Force disable next hop group support +no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! From a70f3de27fe38e74cced44f1e0f2dae01b2fcf46 Mon Sep 17 00:00:00 2001 From: Liping Xu Date: Mon, 4 Aug 2025 09:45:18 +0000 Subject: [PATCH 2/6] update Signed-off-by: Liping Xu --- dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 b/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 index 128bc9c5870..53ca9919158 100644 --- a/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 +++ b/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 @@ -6,9 +6,18 @@ ! {% endblock banner %} ! -{% block fpm %} +{% block zebra_nexthop %} +{% if (('localhost' in DEVICE_METADATA) and ('zebra_nexthop' in DEVICE_METADATA['localhost']) and + (DEVICE_METADATA['localhost']['zebra_nexthop'] == 'enabled')) %} ! Force disable next hop group support +zebra nexthop kernel enable +{% else %} no zebra nexthop kernel enable +{% endif %} +! +{% endblock zebra_nexthop %} +! +{% block fpm %} {% if ( ('localhost' in DEVICE_METADATA) and ('nexthop_group' in DEVICE_METADATA['localhost']) and (DEVICE_METADATA['localhost']['nexthop_group'] == 'enabled') ) %} ! enable next hop group support From 84d9c56cffe39faaa3fe6e9f798b2f9d6bf1a752 Mon Sep 17 00:00:00 2001 From: Liping Xu Date: Tue, 5 Aug 2025 09:45:57 +0000 Subject: [PATCH 3/6] update Signed-off-by: Liping Xu --- dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 b/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 index 53ca9919158..36432752e29 100644 --- a/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 +++ b/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 @@ -9,12 +9,11 @@ {% block zebra_nexthop %} {% if (('localhost' in DEVICE_METADATA) and ('zebra_nexthop' in DEVICE_METADATA['localhost']) and (DEVICE_METADATA['localhost']['zebra_nexthop'] == 'enabled')) %} -! Force disable next hop group support zebra nexthop kernel enable {% else %} +! Force disable next hop group support no zebra nexthop kernel enable {% endif %} -! {% endblock zebra_nexthop %} ! {% block fpm %} From 4a9eb1de79a256905028cc18a390f306e311b975 Mon Sep 17 00:00:00 2001 From: Liping Xu Date: Wed, 6 Aug 2025 08:47:54 +0000 Subject: [PATCH 4/6] update Signed-off-by: Liping Xu --- src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf | 1 + .../tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf | 1 + .../tests/sample_output/py2/t2-chassis-fe-zebra.conf | 1 + src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf | 1 + .../tests/sample_output/py2/zebra_frr_dualtor.conf | 1 + .../tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf | 1 + .../tests/sample_output/py3/t2-chassis-fe-zebra.conf | 1 + src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf | 1 + .../tests/sample_output/py3/zebra_frr_dualtor.conf | 1 + 9 files changed, 9 insertions(+) diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf index 23ef6d096b1..db6d35f20eb 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf @@ -6,6 +6,7 @@ ! ! Force disable next hop group support no zebra nexthop kernel enable +! ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf index 042f3ed16e3..8c29a8289a3 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf @@ -6,6 +6,7 @@ ! ! Force disable next hop group support no zebra nexthop kernel enable +! ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf index 5eea029e8f8..03e18a4a519 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf @@ -6,6 +6,7 @@ ! ! Force disable next hop group support no zebra nexthop kernel enable +! ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf b/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf index 01a101daa54..a4c50cf6796 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf @@ -6,6 +6,7 @@ ! ! Force disable next hop group support no zebra nexthop kernel enable +! ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/zebra_frr_dualtor.conf b/src/sonic-config-engine/tests/sample_output/py2/zebra_frr_dualtor.conf index e7898516bd5..c8bc3658420 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/zebra_frr_dualtor.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/zebra_frr_dualtor.conf @@ -6,6 +6,7 @@ ! ! Force disable next hop group support no zebra nexthop kernel enable +! ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf index 38e73e3ef29..f047976b5a3 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf @@ -6,6 +6,7 @@ ! ! Force disable next hop group support no zebra nexthop kernel enable +! ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf index d59b436e152..91aa73b8369 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf @@ -6,6 +6,7 @@ ! ! Force disable next hop group support no zebra nexthop kernel enable +! ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf b/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf index 866d20a86ee..7db3d3f42d3 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf @@ -6,6 +6,7 @@ ! ! Force disable next hop group support no zebra nexthop kernel enable +! ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/zebra_frr_dualtor.conf b/src/sonic-config-engine/tests/sample_output/py3/zebra_frr_dualtor.conf index 9885089b08a..584b761905a 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/zebra_frr_dualtor.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/zebra_frr_dualtor.conf @@ -6,6 +6,7 @@ ! ! Force disable next hop group support no zebra nexthop kernel enable +! ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! From a1f623225722f77b7419e05ca9cc56a05799e371 Mon Sep 17 00:00:00 2001 From: Liping Xu Date: Thu, 7 Aug 2025 03:23:54 +0000 Subject: [PATCH 5/6] update metadata Signed-off-by: Liping Xu --- src/sonic-yang-models/tests/files/sample_config_db.json | 3 ++- .../tests/yang_model_tests/tests/device_metadata.json | 3 +++ .../yang_model_tests/tests_config/device_metadata.json | 9 +++++++++ .../yang-models/sonic-device_metadata.yang | 9 +++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index c17c04f5053..9398a4d5ae3 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -413,7 +413,8 @@ "bgp_router_id": "8.8.8.8", "chassis_hostname": "str-sonic-chassis-1", "slice_type": "AZNG_Production", - "nexthop_group": "disabled" + "nexthop_group": "disabled", + "zebra_nexthop": "disabled" } }, "VLAN": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json index 834e5b505fb..901a4e1e2fe 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json @@ -251,6 +251,9 @@ "DEVICE_METADATA_VALID_NEXTHOP_GROUP": { "desc": "Verifying nexthop_group configuration." }, + "DEVICE_METADATA_VALID_ZEBRA_NEXTHOP": { + "desc": "Verifying valid zebra_nexthop configuration." + }, "DEVICE_METADATA_VALID_T2_GROUP_ASNS": { "desc": "Verifying valid t2_group_asns." }, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json index 91f48fde88c..8338d2b7a1a 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json @@ -804,5 +804,14 @@ } } } + }, + "DEVICE_METADATA_VALID_ZEBRA_NEXTHOP": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "zebra_nexthop": "disabled" + } + } + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang index be66b73248a..73346b9178b 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang @@ -335,6 +335,15 @@ module sonic-device_metadata { type stypes:boolean_type; default "false"; } + + leaf zebra_nexthop { + description "Enable or disable next hop group support. This value only takes effect during boot time"; + type enumeration { + enum enabled; + enum disabled; + } + default disabled; + } } /* end of container localhost */ } From 995d268eccaaffbecff8ef89479071dd7e9826f1 Mon Sep 17 00:00:00 2001 From: Liping Xu Date: Mon, 22 Dec 2025 00:19:03 +0000 Subject: [PATCH 6/6] remove default set in docker init Signed-off-by: Liping Xu --- dockers/docker-fpm-frr/docker_init.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dockers/docker-fpm-frr/docker_init.sh b/dockers/docker-fpm-frr/docker_init.sh index 3d550247890..94107846c7a 100755 --- a/dockers/docker-fpm-frr/docker_init.sh +++ b/dockers/docker-fpm-frr/docker_init.sh @@ -49,10 +49,6 @@ write_default_zebra_config() echo "no fpm use-next-hop-groups" >> $FILE_NAME echo "fpm address 127.0.0.1" >> $FILE_NAME } - - grep -q '^no zebra nexthop kernel enable' $FILE_NAME || { - echo "no zebra nexthop kernel enable" >> $FILE_NAME - } } if [[ ! -z "$NAMESPACE_ID" ]]; then