Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions dockers/docker-fpm-frr/TS
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ function check_not_installed()
is_internal_route_map $route_map_name && continue
echo "$config" | egrep -q "^route-map $route_map_name permit 20$"
c=$((c+$?))
echo "$config" | egrep -q "^route-map $route_map_name deny 30$"
echo "$config" | egrep -q "^route-map $route_map_name permit 30$"
c=$((c+$?))
echo "$config" | egrep -q "^route-map $route_map_name deny 40$"
c=$((c+$?))
done
return $c
Expand All @@ -33,7 +35,10 @@ function check_installed()
echo "$config" | egrep -q "^route-map $route_map_name permit 20$"
c=$((c+$?))
e=$((e+1))
echo "$config" | egrep -q "^route-map $route_map_name deny 30$"
echo "$config" | egrep -q "^route-map $route_map_name permit 30$"
c=$((c+$?))
e=$((e+1))
echo "$config" | egrep -q "^route-map $route_map_name deny 40$"
c=$((c+$?))
e=$((e+1))
done
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,56 @@
!
{% from "common/functions.conf.j2" import get_ipv4_loopback_address %}
!
route-map FROM_BGP_INTERNAL_PEER_V4 permit 100
{% if CONFIG_DB__DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd' %}
route-map FROM_BGP_INTERNAL_PEER_V4 permit 1
set originator-id {{ get_ipv4_loopback_address(CONFIG_DB__LOOPBACK_INTERFACE, "Loopback4096") | ip }}
!
route-map TO_BGP_INTERNAL_PEER_V4 permit 100
route-map FROM_BGP_INTERNAL_PEER_V6 permit 1
set ipv6 next-hop prefer-global
on-match next
!
route-map FROM_BGP_INTERNAL_PEER_V6 permit 2
set originator-id {{ get_ipv4_loopback_address(CONFIG_DB__LOOPBACK_INTERFACE, "Loopback4096") | ip }}
{% elif CONFIG_DB__DEVICE_METADATA['localhost']['switch_type'] == 'chassis-packet' %}
bgp community-list standard DEVICE_INTERNAL_COMMUNITY permit {{ constants.bgp.internal_community }}
!
route-map FROM_BGP_INTERNAL_PEER_V4 permit 1
match community DEVICE_INTERNAL_COMMUNITY
set comm-list DEVICE_INTERNAL_COMMUNITY delete
set tag {{ constants.bgp.internal_community_match_tag }}
!
route-map FROM_BGP_INTERNAL_PEER_V6 permit 1
set ipv6 next-hop prefer-global
on-match next
!
route-map FROM_BGP_INTERNAL_PEER_V6 permit 100
route-map FROM_BGP_INTERNAL_PEER_V6 permit 2
match community DEVICE_INTERNAL_COMMUNITY
set comm-list DEVICE_INTERNAL_COMMUNITY delete
set tag {{ constants.bgp.internal_community_match_tag }}
!
route-map TO_BGP_INTERNAL_PEER_V6 permit 100
route-map TO_BGP_INTERNAL_PEER_V4 permit 1
match ip address prefix-list PL_LoopbackV4
set community {{ constants.bgp.internal_community }}
!
{% if CONFIG_DB__DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd' %}
route-map FROM_BGP_INTERNAL_PEER_V4 permit 2
set originator-id {{ get_ipv4_loopback_address(CONFIG_DB__LOOPBACK_INTERFACE, "Loopback4096") | ip }}
route-map TO_BGP_INTERNAL_PEER_V6 permit 2
match ipv6 address prefix-list PL_LoopbackV6
set community {{ constants.bgp.internal_community }}
!
{% else %}
route-map FROM_BGP_INTERNAL_PEER_V6 permit 1
set ipv6 next-hop prefer-global
on-match next
!
route-map FROM_BGP_INTERNAL_PEER_V6 permit 2
set originator-id {{ get_ipv4_loopback_address(CONFIG_DB__LOOPBACK_INTERFACE, "Loopback4096") | ip }}
{% endif %}
!
route-map FROM_BGP_INTERNAL_PEER_V4 permit 100
!
route-map FROM_BGP_INTERNAL_PEER_V6 permit 100
!
route-map TO_BGP_INTERNAL_PEER_V4 permit 100
!
route-map TO_BGP_INTERNAL_PEER_V6 permit 100
!
!
! end of template: bgpd/templates/internal/policies.conf.j2
!
Original file line number Diff line number Diff line change
@@ -1,17 +1,37 @@
!
! template: bgpd/templates/voq_chassis/policies.conf.j2
!
bgp community-list standard DEVICE_INTERNAL_COMMUNITY permit {{ constants.bgp.internal_community }}
!
route-map FROM_VOQ_CHASSIS_V4_PEER permit 1
match community DEVICE_INTERNAL_COMMUNITY
set comm-list DEVICE_INTERNAL_COMMUNITY delete
set tag {{ constants.bgp.internal_community_match_tag }}
!
route-map FROM_VOQ_CHASSIS_V4_PEER permit 100
!
route-map TO_VOQ_CHASSIS_V4_PEER permit 1
match ip address prefix-list PL_LoopbackV4
set community {{ constants.bgp.internal_community }}
!
route-map TO_VOQ_CHASSIS_V4_PEER permit 100
!
!
route-map FROM_VOQ_CHASSIS_V6_PEER permit 1
set ipv6 next-hop prefer-global
on-match next
!
route-map FROM_VOQ_CHASSIS_V6_PEER permit 2
match community DEVICE_INTERNAL_COMMUNITY
set comm-list DEVICE_INTERNAL_COMMUNITY delete
set tag {{ constants.bgp.internal_community_match_tag }}
!
route-map FROM_VOQ_CHASSIS_V6_PEER permit 100
!
route-map TO_VOQ_CHASSIS_V6_PEER permit 1
match ipv6 address prefix-list PL_LoopbackV6
set community {{ constants.bgp.internal_community }}
!
route-map TO_VOQ_CHASSIS_V6_PEER permit 100
!
! end of template: bgpd/templates/voq_chassis/policies.conf.j2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
route-map {{ route_map_name }} permit 20
match {{ ip_protocol }} address prefix-list PL_Loopback{{ ip_version }}
set community {{ constants.bgp.traffic_shift_community }}
route-map {{ route_map_name }} deny 30
route-map {{ route_map_name }} permit 30
match tag {{ constants.bgp.internal_community_match_tag }}
set community {{ constants.bgp.traffic_shift_community }}
route-map {{ route_map_name }} deny 40
!
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
no route-map {{ route_map_name }} permit 20
no route-map {{ route_map_name }} deny 30
no route-map {{ route_map_name }} permit 30
no route-map {{ route_map_name }} deny 40
!
2 changes: 2 additions & 0 deletions files/image_config/constants/constants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ constants:
"2" : 65433
bgp:
traffic_shift_community: 12345:12345
internal_community: 11111:11111
internal_community_match_tag: 1002
families:
- ipv4
- ipv6
Expand Down
2 changes: 1 addition & 1 deletion platform/broadcom/sai.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LIBSAIBCM_XGS_VERSION = 8.4.35.0
LIBSAIBCM_XGS_VERSION = 8.4.39.2
LIBSAIBCM_DNX_VERSION = 9.2.12.1
LIBSAIBCM_XGS_BRANCH_NAME = SAI_8.4.0_GA
LIBSAIBCM_DNX_BRANCH_NAME = SAI_9.2.0.3
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From 079ff1bb570dae96c4ca513e210c9856e9cc75b0 Mon Sep 17 00:00:00 2001
From: Saikrishna Arcot <sarcot@microsoft.com>
Date: Wed, 10 Jan 2024 23:30:17 -0800
Subject: [PATCH] Don't look up the ifindex for fallback

If sending a packet on the "fallback" interface, then don't try to get the
ifindex for that interface. There will never be an actual interface named
"fallback" in SONiC (at least, not one that we will want to use).

This might save 0.009-0.012 seconds per upstream server, and when there
are as many as 48 upstream servers, it can save about 0.4-0.5 seconds of
time. This then allows dhcrelay to process more packets.

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>

diff --git a/common/socket.c b/common/socket.c
index da9f501..e707a7f 100644
--- a/common/socket.c
+++ b/common/socket.c
@@ -767,7 +767,10 @@ ssize_t send_packet (interface, packet, raw, len, from, to, hto)
memcpy(&dst, to, sizeof(dst));
m.msg_name = &dst;
m.msg_namelen = sizeof(dst);
- ifindex = if_nametoindex(interface->name);
+ if (strcmp(interface->name, "fallback") != 0)
+ ifindex = if_nametoindex(interface->name);
+ else
+ ifindex = 0;

/*
* Set the data buffer we're sending. (Using this wacky
--
2.34.1

1 change: 1 addition & 0 deletions src/isc-dhcp/patch/series
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
0011-dhcp-relay-Prevent-Buffer-Overrun.patch
0012-add-option-si-to-support-using-src-intf-ip-in-relay.patch
0013-Fix-dhcrelay-agent-option-buffer-pointer-logic.patch
0016-Don-t-look-up-the-ifindex-for-fallback.patch
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@
route-map TO_BGP_PEER_V4 permit 20
match ip address prefix-list PL_LoopbackV4
set community 12345:12345
route-map TO_BGP_PEER_V4 deny 30
route-map TO_BGP_PEER_V4 permit 30
match tag 1001
set community 12345:12345
route-map TO_BGP_PEER_V4 deny 40
!
route-map TO_BGP_PEER_V6 permit 20
match ipv6 address prefix-list PL_LoopbackV6
set community 12345:12345
route-map TO_BGP_PEER_V6 deny 30
route-map TO_BGP_PEER_V6 permit 30
match tag 1001
set community 12345:12345
route-map TO_BGP_PEER_V6 deny 40
!

Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@


no route-map TO_BGP_PEER_V4 permit 20
no route-map TO_BGP_PEER_V4 deny 30
no route-map TO_BGP_PEER_V4 permit 30
no route-map TO_BGP_PEER_V4 deny 40
!
no route-map TO_BGP_PEER_V6 permit 20
no route-map TO_BGP_PEER_V6 deny 30
no route-map TO_BGP_PEER_V6 permit 30
no route-map TO_BGP_PEER_V6 deny 40
!

Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@
route-map TO_BGP_PEER_V4 permit 20
match ip address prefix-list PL_LoopbackV4
set community 12345:12345
route-map TO_BGP_PEER_V4 deny 30
route-map TO_BGP_PEER_V4 permit 30
match tag 1001
set community 12345:12345
route-map TO_BGP_PEER_V4 deny 40
!
route-map TO_BGP_PEER_V6 permit 20
match ipv6 address prefix-list PL_LoopbackV6
set community 12345:12345
route-map TO_BGP_PEER_V6 deny 30
route-map TO_BGP_PEER_V6 permit 30
match tag 1001
set community 12345:12345
route-map TO_BGP_PEER_V6 deny 40
!
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

no route-map TO_BGP_PEER_V4 permit 20
no route-map TO_BGP_PEER_V4 deny 30
no route-map TO_BGP_PEER_V4 permit 30
no route-map TO_BGP_PEER_V4 deny 40
!
no route-map TO_BGP_PEER_V6 permit 20
no route-map TO_BGP_PEER_V6 deny 30
no route-map TO_BGP_PEER_V6 permit 30
no route-map TO_BGP_PEER_V6 deny 40
!
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@
},
"CONFIG_DB__LOOPBACK_INTERFACE": {
"Loopback4096|10.10.10.10/32": {}
},
"constants": {
"bgp": {
"internal_community": "12345:556",
"internal_community_match_tag": "101"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"CONFIG_DB__DEVICE_METADATA": {
"localhost": {
"type": "SpineRouter",
"sub_role": "FrontEnd",
"switch_type": "chassis-packet"
}
},
"constants": {
"bgp": {
"internal_community": "12345:556",
"internal_community_match_tag": "101"
}
},
"loopback0_ipv4": "10.10.10.10/32"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{
"CONFIG_DB__DEVICE_METADATA": {
"localhost": {
"sub_role": "FrontkEnd"
"sub_role": "FrontEnd"
}
},
"constants": {
"bgp": {
"internal_community": "12345:556",
"internal_community_match_tag": "101"
}
},
"loopback0_ipv4": "10.10.10.10/32"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
!
! template: bgpd/templates/internal/policies.conf.j2
!
route-map FROM_BGP_INTERNAL_PEER_V4 permit 100
!
route-map TO_BGP_INTERNAL_PEER_V4 permit 100
route-map FROM_BGP_INTERNAL_PEER_V4 permit 1
set originator-id 10.10.10.10
!
route-map FROM_BGP_INTERNAL_PEER_V6 permit 1
set ipv6 next-hop prefer-global
on-match next
!
route-map FROM_BGP_INTERNAL_PEER_V6 permit 100
route-map FROM_BGP_INTERNAL_PEER_V6 permit 2
set originator-id 10.10.10.10
!
route-map TO_BGP_INTERNAL_PEER_V6 permit 100
route-map FROM_BGP_INTERNAL_PEER_V4 permit 100
!
route-map FROM_BGP_INTERNAL_PEER_V4 permit 2
set originator-id 10.10.10.10
route-map FROM_BGP_INTERNAL_PEER_V6 permit 100
!
route-map FROM_BGP_INTERNAL_PEER_V6 permit 2
set originator-id 10.10.10.10
route-map TO_BGP_INTERNAL_PEER_V4 permit 100
!
route-map TO_BGP_INTERNAL_PEER_V6 permit 100
!
! end of template: bgpd/templates/internal/policies.conf.j2
!
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
!
! template: bgpd/templates/internal/policies.conf.j2
!
bgp community-list standard DEVICE_INTERNAL_COMMUNITY permit 12345:556
!
route-map FROM_BGP_INTERNAL_PEER_V4 permit 1
match community DEVICE_INTERNAL_COMMUNITY
set comm-list DEVICE_INTERNAL_COMMUNITY delete
set tag 101
!
route-map FROM_BGP_INTERNAL_PEER_V6 permit 1
set ipv6 next-hop prefer-global
on-match next
!
route-map FROM_BGP_INTERNAL_PEER_V6 permit 2
match community DEVICE_INTERNAL_COMMUNITY
set comm-list DEVICE_INTERNAL_COMMUNITY delete
set tag 101
!
route-map TO_BGP_INTERNAL_PEER_V4 permit 1
match ip address prefix-list PL_LoopbackV4
set community 12345:556
!
route-map TO_BGP_INTERNAL_PEER_V6 permit 2
match ipv6 address prefix-list PL_LoopbackV6
set community 12345:556
!
route-map FROM_BGP_INTERNAL_PEER_V4 permit 100
!
route-map FROM_BGP_INTERNAL_PEER_V6 permit 100
!
route-map TO_BGP_INTERNAL_PEER_V4 permit 100
!
route-map TO_BGP_INTERNAL_PEER_V6 permit 100
!
! end of template: bgpd/templates/internal/policies.conf.j2
!
Loading