mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 06:53:03 +00:00
zebra: add knob to accept lower seq in evpn
Add a knob to accept lower seq number in evpn updates from BGP in Zebra. Note: Knob is enabled by default Signed-off-by: Stephen Worley <sworley@nvidia.com>
This commit is contained in:
parent
9daf964bc8
commit
7d99ad7f93
@ -1597,6 +1597,7 @@ static inline bool zebra_evpn_mac_is_bgp_seq_ok(struct zebra_evpn *zevpn,
|
|||||||
bool sync)
|
bool sync)
|
||||||
{
|
{
|
||||||
char ipbuf[INET6_ADDRSTRLEN];
|
char ipbuf[INET6_ADDRSTRLEN];
|
||||||
|
char mac_buf[MAC_BUF_SIZE];
|
||||||
uint32_t tmp_seq;
|
uint32_t tmp_seq;
|
||||||
const char *n_type;
|
const char *n_type;
|
||||||
|
|
||||||
@ -1611,19 +1612,14 @@ static inline bool zebra_evpn_mac_is_bgp_seq_ok(struct zebra_evpn *zevpn,
|
|||||||
if (seq < tmp_seq) {
|
if (seq < tmp_seq) {
|
||||||
/* if the mac was never advertised to bgp we must accept
|
/* if the mac was never advertised to bgp we must accept
|
||||||
* whatever sequence number bgp sends
|
* whatever sequence number bgp sends
|
||||||
* XXX - check with Vivek
|
|
||||||
*/
|
*/
|
||||||
if (CHECK_FLAG(mac->flags, ZEBRA_MAC_LOCAL)
|
if (zebra_vxlan_accept_bgp_seq()) {
|
||||||
&& !zebra_evpn_mac_is_ready_for_bgp(mac->flags)) {
|
if (IS_ZEBRA_DEBUG_EVPN_MH_MAC ||
|
||||||
if (IS_ZEBRA_DEBUG_EVPN_MH_MAC
|
IS_ZEBRA_DEBUG_VXLAN) {
|
||||||
|| IS_ZEBRA_DEBUG_VXLAN) {
|
|
||||||
char mac_buf[MAC_BUF_SIZE];
|
|
||||||
|
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s-macip accept vni %u %s-mac %pEA%s%s lower seq %u f %s",
|
"%s-macip accept vni %u %s-mac %pEA%s%s lower seq %u f %s",
|
||||||
sync ? "sync" : "rem", zevpn->vni,
|
sync ? "sync" : "rem", zevpn->vni,
|
||||||
n_type,
|
n_type, &mac->macaddr,
|
||||||
&mac->macaddr,
|
|
||||||
ipa_len ? " IP " : "",
|
ipa_len ? " IP " : "",
|
||||||
ipa_len ? ipaddr2str(ipaddr, ipbuf,
|
ipa_len ? ipaddr2str(ipaddr, ipbuf,
|
||||||
sizeof(ipbuf))
|
sizeof(ipbuf))
|
||||||
@ -1637,8 +1633,6 @@ static inline bool zebra_evpn_mac_is_bgp_seq_ok(struct zebra_evpn *zevpn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (IS_ZEBRA_DEBUG_EVPN_MH_MAC || IS_ZEBRA_DEBUG_VXLAN) {
|
if (IS_ZEBRA_DEBUG_EVPN_MH_MAC || IS_ZEBRA_DEBUG_VXLAN) {
|
||||||
char mac_buf[MAC_BUF_SIZE];
|
|
||||||
|
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s-macip ignore vni %u %s-mac %pEA%s%s as existing has higher seq %u f %s",
|
"%s-macip ignore vni %u %s-mac %pEA%s%s as existing has higher seq %u f %s",
|
||||||
sync ? "sync" : "rem", zevpn->vni, n_type,
|
sync ? "sync" : "rem", zevpn->vni, n_type,
|
||||||
@ -1651,6 +1645,7 @@ static inline bool zebra_evpn_mac_is_bgp_seq_ok(struct zebra_evpn *zevpn,
|
|||||||
zebra_evpn_zebra_mac_flag_dump(
|
zebra_evpn_zebra_mac_flag_dump(
|
||||||
mac, mac_buf, sizeof(mac_buf)));
|
mac, mac_buf, sizeof(mac_buf)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -513,10 +513,8 @@ bool zebra_evpn_neigh_is_bgp_seq_ok(struct zebra_evpn *zevpn,
|
|||||||
if (seq < tmp_seq) {
|
if (seq < tmp_seq) {
|
||||||
/* if the neigh was never advertised to bgp we must accept
|
/* if the neigh was never advertised to bgp we must accept
|
||||||
* whatever sequence number bgp sends
|
* whatever sequence number bgp sends
|
||||||
* XXX - check with Vivek
|
|
||||||
*/
|
*/
|
||||||
if (CHECK_FLAG(n->flags, ZEBRA_NEIGH_LOCAL)
|
if (zebra_vxlan_accept_bgp_seq()) {
|
||||||
&& !zebra_evpn_neigh_is_ready_for_bgp(n)) {
|
|
||||||
if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH
|
if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH
|
||||||
|| IS_ZEBRA_DEBUG_VXLAN)
|
|| IS_ZEBRA_DEBUG_VXLAN)
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
|
@ -3740,6 +3740,27 @@ DEFPY (clear_evpn_dup_addr,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFPY_HIDDEN (evpn_accept_bgp_seq,
|
||||||
|
evpn_accept_bgp_seq_cmd,
|
||||||
|
"evpn accept-bgp-seq",
|
||||||
|
"EVPN\n"
|
||||||
|
"Accept all sequence numbers from BGP\n")
|
||||||
|
{
|
||||||
|
zebra_vxlan_set_accept_bgp_seq(true);
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFPY_HIDDEN (no_evpn_accept_bgp_seq,
|
||||||
|
no_evpn_accept_bgp_seq_cmd,
|
||||||
|
"no evpn accept-bgp-seq",
|
||||||
|
NO_STR
|
||||||
|
"EVPN\n"
|
||||||
|
"Accept all sequence numbers from BGP\n")
|
||||||
|
{
|
||||||
|
zebra_vxlan_set_accept_bgp_seq(false);
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
/* Static ip route configuration write function. */
|
/* Static ip route configuration write function. */
|
||||||
static int zebra_ip_config(struct vty *vty)
|
static int zebra_ip_config(struct vty *vty)
|
||||||
{
|
{
|
||||||
@ -3945,6 +3966,9 @@ static int config_write_protocol(struct vty *vty)
|
|||||||
|
|
||||||
zebra_pbr_config_write(vty);
|
zebra_pbr_config_write(vty);
|
||||||
|
|
||||||
|
if (!zebra_vxlan_accept_bgp_seq())
|
||||||
|
vty_out(vty, "no evpn accept-bgp-seq\n");
|
||||||
|
|
||||||
/* Include nexthop-group config */
|
/* Include nexthop-group config */
|
||||||
if (!zebra_nhg_kernel_nexthops_enabled())
|
if (!zebra_nhg_kernel_nexthops_enabled())
|
||||||
vty_out(vty, "no zebra nexthop kernel enable\n");
|
vty_out(vty, "no zebra nexthop kernel enable\n");
|
||||||
@ -4582,6 +4606,8 @@ void zebra_vty_init(void)
|
|||||||
install_element(VIEW_NODE, &show_evpn_neigh_vni_dad_cmd);
|
install_element(VIEW_NODE, &show_evpn_neigh_vni_dad_cmd);
|
||||||
install_element(VIEW_NODE, &show_evpn_neigh_vni_all_dad_cmd);
|
install_element(VIEW_NODE, &show_evpn_neigh_vni_all_dad_cmd);
|
||||||
install_element(ENABLE_NODE, &clear_evpn_dup_addr_cmd);
|
install_element(ENABLE_NODE, &clear_evpn_dup_addr_cmd);
|
||||||
|
install_element(CONFIG_NODE, &evpn_accept_bgp_seq_cmd);
|
||||||
|
install_element(CONFIG_NODE, &no_evpn_accept_bgp_seq_cmd);
|
||||||
|
|
||||||
install_element(VIEW_NODE, &show_neigh_cmd);
|
install_element(VIEW_NODE, &show_neigh_cmd);
|
||||||
|
|
||||||
|
@ -69,6 +69,9 @@ DEFINE_HOOK(zebra_rmac_update,
|
|||||||
const char *reason),
|
const char *reason),
|
||||||
(rmac, zl3vni, delete, reason));
|
(rmac, zl3vni, delete, reason));
|
||||||
|
|
||||||
|
/* config knobs */
|
||||||
|
static bool accept_bgp_seq = true;
|
||||||
|
|
||||||
/* static function declarations */
|
/* static function declarations */
|
||||||
static void zevpn_print_neigh_hash_all_evpn(struct hash_bucket *bucket,
|
static void zevpn_print_neigh_hash_all_evpn(struct hash_bucket *bucket,
|
||||||
void **args);
|
void **args);
|
||||||
@ -6284,6 +6287,17 @@ extern void zebra_vxlan_handle_result(struct zebra_dplane_ctx *ctx)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Config knob for accepting lower sequence numbers */
|
||||||
|
void zebra_vxlan_set_accept_bgp_seq(bool set)
|
||||||
|
{
|
||||||
|
accept_bgp_seq = set;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool zebra_vxlan_accept_bgp_seq(void)
|
||||||
|
{
|
||||||
|
return accept_bgp_seq;
|
||||||
|
}
|
||||||
|
|
||||||
/* Cleanup BGP EVPN configuration upon client disconnect */
|
/* Cleanup BGP EVPN configuration upon client disconnect */
|
||||||
extern void zebra_evpn_init(void)
|
extern void zebra_evpn_init(void)
|
||||||
{
|
{
|
||||||
|
@ -225,6 +225,9 @@ extern int zebra_vxlan_dp_network_mac_del(struct interface *ifp,
|
|||||||
struct ethaddr *macaddr,
|
struct ethaddr *macaddr,
|
||||||
vlanid_t vid);
|
vlanid_t vid);
|
||||||
|
|
||||||
|
extern void zebra_vxlan_set_accept_bgp_seq(bool set);
|
||||||
|
extern bool zebra_vxlan_accept_bgp_seq(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user