summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorPaul Atkins <patkins@graphiant.com>2021-10-12 14:32:11 +0100
committerNeale Ranns <neale@graphiant.com>2021-10-21 16:40:11 +0000
commit8e2b1b129815d3e631aa425ed37899c78ea24e65 (patch)
tree4df9608750ec288c2b0723467ff68528e62e8e9b /src/plugins
parentbfa86084af0e4d0cc8ad8ccbeafe999b748a990e (diff)
fib: respect mfib entry flags on create with paths
When an mfib entry was created with both paths and entry_flags then the entry flags were being ignored. If there are no paths then the flags were passed into mfib_table_entry_update, but in the case where the entry didn't exist and there were paths and flags, the entry was created within mfib_table_entry_paths_update() which used a default of MFIB_ENTRY_FLAG_NONE. Pass the flags through into the mfib_table_entry_paths_update fn. All existing callers other than the create case will now pass in MFIB_ENTRY_FLAG_NONE. Type: fix Signed-off-by: Paul Atkins <patkins@graphiant.com> Change-Id: I256375ba2fa863a62a88474ce1ea6bf2accdd456
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/dhcp/dhcp6_proxy_node.c6
-rw-r--r--src/plugins/geneve/geneve.c11
-rw-r--r--src/plugins/gtpu/gtpu.c11
-rw-r--r--src/plugins/igmp/igmp.c21
-rw-r--r--src/plugins/igmp/igmp_proxy.c3
-rw-r--r--src/plugins/unittest/bier_test.c7
-rw-r--r--src/plugins/unittest/mfib_test.c147
-rw-r--r--src/plugins/vrrp/vrrp.c4
8 files changed, 88 insertions, 122 deletions
diff --git a/src/plugins/dhcp/dhcp6_proxy_node.c b/src/plugins/dhcp/dhcp6_proxy_node.c
index 1bc22226ff6..11207690969 100644
--- a/src/plugins/dhcp/dhcp6_proxy_node.c
+++ b/src/plugins/dhcp/dhcp6_proxy_node.c
@@ -927,9 +927,9 @@ dhcp6_proxy_set_server (ip46_address_t * addr,
if (dhcp_proxy_server_add (FIB_PROTOCOL_IP6, addr, src_addr,
rx_fib_index, server_table_id))
{
- mfib_table_entry_path_update (rx_fib_index,
- &all_dhcp_servers,
- MFIB_SOURCE_DHCP, &path_for_us);
+ mfib_table_entry_path_update (rx_fib_index, &all_dhcp_servers,
+ MFIB_SOURCE_DHCP, MFIB_ENTRY_FLAG_NONE,
+ &path_for_us);
/*
* Each interface that is enabled in this table, needs to be added
* as an accepting interface, but this is not easily doable in VPP.
diff --git a/src/plugins/geneve/geneve.c b/src/plugins/geneve/geneve.c
index 5bd612257a5..81c96c1c42e 100644
--- a/src/plugins/geneve/geneve.c
+++ b/src/plugins/geneve/geneve.c
@@ -524,15 +524,16 @@ int vnet_geneve_add_del_tunnel
* - the forwarding interface is for-us
* - the accepting interface is that from the API
*/
- mfib_table_entry_path_update (t->encap_fib_index,
- &mpfx, MFIB_SOURCE_GENEVE, &path);
+ mfib_table_entry_path_update (t->encap_fib_index, &mpfx,
+ MFIB_SOURCE_GENEVE,
+ MFIB_ENTRY_FLAG_NONE, &path);
path.frp_sw_if_index = a->mcast_sw_if_index;
path.frp_flags = FIB_ROUTE_PATH_FLAG_NONE;
path.frp_mitf_flags = MFIB_ITF_FLAG_ACCEPT;
- mfei = mfib_table_entry_path_update (t->encap_fib_index,
- &mpfx,
- MFIB_SOURCE_GENEVE, &path);
+ mfei = mfib_table_entry_path_update (
+ t->encap_fib_index, &mpfx, MFIB_SOURCE_GENEVE,
+ MFIB_ENTRY_FLAG_NONE, &path);
/*
* Create the mcast adjacency to send traffic to the group
diff --git a/src/plugins/gtpu/gtpu.c b/src/plugins/gtpu/gtpu.c
index 960454adf13..67c91dd131a 100644
--- a/src/plugins/gtpu/gtpu.c
+++ b/src/plugins/gtpu/gtpu.c
@@ -524,15 +524,16 @@ int vnet_gtpu_add_mod_del_tunnel
* - the forwarding interface is for-us
* - the accepting interface is that from the API
*/
- mfib_table_entry_path_update (t->encap_fib_index,
- &mpfx, MFIB_SOURCE_GTPU, &path);
+ mfib_table_entry_path_update (t->encap_fib_index, &mpfx,
+ MFIB_SOURCE_GTPU,
+ MFIB_ENTRY_FLAG_NONE, &path);
path.frp_sw_if_index = a->mcast_sw_if_index;
path.frp_flags = FIB_ROUTE_PATH_FLAG_NONE;
path.frp_mitf_flags = MFIB_ITF_FLAG_ACCEPT;
- mfei = mfib_table_entry_path_update (t->encap_fib_index,
- &mpfx,
- MFIB_SOURCE_GTPU, &path);
+ mfei = mfib_table_entry_path_update (
+ t->encap_fib_index, &mpfx, MFIB_SOURCE_GTPU,
+ MFIB_ENTRY_FLAG_NONE, &path);
/*
* Create the mcast adjacency to send traffic to the group
diff --git a/src/plugins/igmp/igmp.c b/src/plugins/igmp/igmp.c
index 1c686e39cf2..d66a013e3f9 100644
--- a/src/plugins/igmp/igmp.c
+++ b/src/plugins/igmp/igmp.c
@@ -408,18 +408,19 @@ igmp_enable_disable (u32 sw_if_index, u8 enable, igmp_mode_t mode)
{
/* first config in this FIB */
mfib_table_lock (mfib_index, FIB_PROTOCOL_IP4, MFIB_SOURCE_IGMP);
- mfib_table_entry_path_update (mfib_index,
- &mpfx_general_query,
- MFIB_SOURCE_IGMP, &for_us_path);
- mfib_table_entry_path_update (mfib_index,
- &mpfx_report,
- MFIB_SOURCE_IGMP, &for_us_path);
+ mfib_table_entry_path_update (mfib_index, &mpfx_general_query,
+ MFIB_SOURCE_IGMP,
+ MFIB_ENTRY_FLAG_NONE, &for_us_path);
+ mfib_table_entry_path_update (mfib_index, &mpfx_report,
+ MFIB_SOURCE_IGMP,
+ MFIB_ENTRY_FLAG_NONE, &for_us_path);
}
- mfib_table_entry_path_update (mfib_index,
- &mpfx_general_query,
- MFIB_SOURCE_IGMP, &via_itf_path);
+ mfib_table_entry_path_update (mfib_index, &mpfx_general_query,
+ MFIB_SOURCE_IGMP, MFIB_ENTRY_FLAG_NONE,
+ &via_itf_path);
mfib_table_entry_path_update (mfib_index, &mpfx_report,
- MFIB_SOURCE_IGMP, &via_itf_path);
+ MFIB_SOURCE_IGMP, MFIB_ENTRY_FLAG_NONE,
+ &via_itf_path);
}
}
else if (config && !enable)
diff --git a/src/plugins/igmp/igmp_proxy.c b/src/plugins/igmp/igmp_proxy.c
index 2167740fc8a..6d930ac791b 100644
--- a/src/plugins/igmp/igmp_proxy.c
+++ b/src/plugins/igmp/igmp_proxy.c
@@ -55,7 +55,8 @@ igmp_proxy_device_mfib_path_add_del (igmp_group_t * group, u8 add)
if (add)
mfib_table_entry_path_update (mfib_index, &mpfx_group_addr,
- MFIB_SOURCE_IGMP, &via_itf_path);
+ MFIB_SOURCE_IGMP, MFIB_ENTRY_FLAG_NONE,
+ &via_itf_path);
else
mfib_table_entry_path_remove (mfib_index, &mpfx_group_addr,
MFIB_SOURCE_IGMP, &via_itf_path);
diff --git a/src/plugins/unittest/bier_test.c b/src/plugins/unittest/bier_test.c
index f1f9e03f461..7f7439d8590 100644
--- a/src/plugins/unittest/bier_test.c
+++ b/src/plugins/unittest/bier_test.c
@@ -768,10 +768,9 @@ bier_test_mpls_imp (void)
.frp_flags = FIB_ROUTE_PATH_BIER_IMP,
.frp_mitf_flags = MFIB_ITF_FLAG_FORWARD,
};
- mfib_table_entry_path_update(0, // default table
- &pfx_1_1_1_1_c_239_1_1_1 ,
- MFIB_SOURCE_API,
- &path_via_bier_imp_1);
+ mfib_table_entry_path_update (0, // default table
+ &pfx_1_1_1_1_c_239_1_1_1, MFIB_SOURCE_API,
+ MFIB_ENTRY_FLAG_NONE, &path_via_bier_imp_1);
mfib_table_entry_delete(0,
&pfx_1_1_1_1_c_239_1_1_1 ,
MFIB_SOURCE_API);
diff --git a/src/plugins/unittest/mfib_test.c b/src/plugins/unittest/mfib_test.c
index 0faa20c0934..1fb4361e793 100644
--- a/src/plugins/unittest/mfib_test.c
+++ b/src/plugins/unittest/mfib_test.c
@@ -405,10 +405,8 @@ mfib_test_i (fib_protocol_t PROTO,
.frp_mitf_flags = MFIB_ITF_FLAG_ACCEPT,
};
- mfib_table_entry_path_update(fib_index,
- pfx_no_forward,
- MFIB_SOURCE_API,
- &path_via_if0);
+ mfib_table_entry_path_update (fib_index, pfx_no_forward, MFIB_SOURCE_API,
+ MFIB_ENTRY_FLAG_NONE, &path_via_if0);
mfei_no_f = mfib_table_lookup_exact_match(fib_index, pfx_no_forward);
MFIB_TEST(!mfib_test_entry(mfei_no_f,
@@ -456,18 +454,12 @@ mfib_test_i (fib_protocol_t PROTO,
/*
* An (S,G) with 1 accepting and 3 forwarding paths
*/
- mfib_table_entry_path_update(fib_index,
- pfx_s_g,
- MFIB_SOURCE_API,
- &path_via_if0);
- mfib_table_entry_path_update(fib_index,
- pfx_s_g,
- MFIB_SOURCE_API,
- &path_via_if1);
- mfib_table_entry_paths_update(fib_index,
- pfx_s_g,
- MFIB_SOURCE_API,
- two_paths);
+ mfib_table_entry_path_update (fib_index, pfx_s_g, MFIB_SOURCE_API,
+ MFIB_ENTRY_FLAG_NONE, &path_via_if0);
+ mfib_table_entry_path_update (fib_index, pfx_s_g, MFIB_SOURCE_API,
+ MFIB_ENTRY_FLAG_NONE, &path_via_if1);
+ mfib_table_entry_paths_update (fib_index, pfx_s_g, MFIB_SOURCE_API,
+ MFIB_ENTRY_FLAG_NONE, two_paths);
mfei_s_g = mfib_table_lookup_exact_match(fib_index, pfx_s_g);
@@ -496,14 +488,11 @@ mfib_test_i (fib_protocol_t PROTO,
* A (*,G), which the same G as the (S,G).
* different paths. test our LPM.
*/
- mfei_g_1 = mfib_table_entry_path_update(fib_index,
- pfx_star_g_1,
- MFIB_SOURCE_API,
- &path_via_if0);
- mfib_table_entry_path_update(fib_index,
- pfx_star_g_1,
- MFIB_SOURCE_API,
- &path_via_if1);
+ mfei_g_1 =
+ mfib_table_entry_path_update (fib_index, pfx_star_g_1, MFIB_SOURCE_API,
+ MFIB_ENTRY_FLAG_NONE, &path_via_if0);
+ mfib_table_entry_path_update (fib_index, pfx_star_g_1, MFIB_SOURCE_API,
+ MFIB_ENTRY_FLAG_NONE, &path_via_if1);
/*
* test we find the *,G and S,G via LPM and exact matches
@@ -566,14 +555,12 @@ mfib_test_i (fib_protocol_t PROTO,
* different paths. test our LPM.
*/
path_via_if2.frp_mitf_flags = MFIB_ITF_FLAG_ACCEPT;
- mfei_g_m = mfib_table_entry_path_update(fib_index,
- pfx_star_g_slash_m,
- MFIB_SOURCE_API,
- &path_via_if2);
- mfib_table_entry_path_update(fib_index,
- pfx_star_g_slash_m,
- MFIB_SOURCE_API,
- &path_via_if3);
+ mfei_g_m = mfib_table_entry_path_update (
+ fib_index, pfx_star_g_slash_m, MFIB_SOURCE_API, MFIB_ENTRY_FLAG_NONE,
+ &path_via_if2);
+ mfib_table_entry_path_update (fib_index, pfx_star_g_slash_m,
+ MFIB_SOURCE_API, MFIB_ENTRY_FLAG_NONE,
+ &path_via_if3);
/*
* test we find the (*,G/m), (*,G) and (S,G) via LPM and exact matches
@@ -647,10 +634,8 @@ mfib_test_i (fib_protocol_t PROTO,
.frp_mitf_flags = MFIB_ITF_FLAG_FORWARD,
};
- mfei = mfib_table_entry_path_update(fib_index,
- pfx_s_g,
- MFIB_SOURCE_API,
- &path_for_us);
+ mfei = mfib_table_entry_path_update (fib_index, pfx_s_g, MFIB_SOURCE_API,
+ MFIB_ENTRY_FLAG_NONE, &path_for_us);
MFIB_TEST(!mfib_test_entry(mfei,
MFIB_ENTRY_FLAG_NONE,
@@ -684,10 +669,8 @@ mfib_test_i (fib_protocol_t PROTO,
* - expect it to be removed from the replication set.
*/
path_via_if3.frp_mitf_flags = MFIB_ITF_FLAG_ACCEPT;
- mfib_table_entry_path_update(fib_index,
- pfx_s_g,
- MFIB_SOURCE_API,
- &path_via_if3);
+ mfib_table_entry_path_update (fib_index, pfx_s_g, MFIB_SOURCE_API,
+ MFIB_ENTRY_FLAG_NONE, &path_via_if3);
MFIB_TEST(!mfib_test_entry(mfei,
MFIB_ENTRY_FLAG_NONE,
@@ -711,10 +694,8 @@ mfib_test_i (fib_protocol_t PROTO,
path_via_if3.frp_mitf_flags = (MFIB_ITF_FLAG_FORWARD |
MFIB_ITF_FLAG_ACCEPT |
MFIB_ITF_FLAG_NEGATE_SIGNAL);
- mfib_table_entry_path_update(fib_index,
- pfx_s_g,
- MFIB_SOURCE_API,
- &path_via_if3);
+ mfib_table_entry_path_update (fib_index, pfx_s_g, MFIB_SOURCE_API,
+ MFIB_ENTRY_FLAG_NONE, &path_via_if3);
mfei = mfib_table_lookup_exact_match(fib_index,
pfx_s_g);
@@ -855,10 +836,9 @@ mfib_test_i (fib_protocol_t PROTO,
*/
path_via_if0.frp_mitf_flags = (MFIB_ITF_FLAG_ACCEPT |
MFIB_ITF_FLAG_NEGATE_SIGNAL);
- mfei_g_2 = mfib_table_entry_path_update(fib_index,
- pfx_star_g_2,
- MFIB_SOURCE_API,
- &path_via_if0);
+ mfei_g_2 =
+ mfib_table_entry_path_update (fib_index, pfx_star_g_2, MFIB_SOURCE_API,
+ MFIB_ENTRY_FLAG_NONE, &path_via_if0);
MFIB_TEST(!mfib_test_entry(mfei_g_2,
MFIB_ENTRY_FLAG_NONE,
0),
@@ -883,10 +863,9 @@ mfib_test_i (fib_protocol_t PROTO,
*/
path_via_if0.frp_mitf_flags = (MFIB_ITF_FLAG_ACCEPT |
MFIB_ITF_FLAG_NEGATE_SIGNAL);
- mfei_g_3 = mfib_table_entry_path_update(fib_index,
- pfx_star_g_3,
- MFIB_SOURCE_API,
- &path_via_if0);
+ mfei_g_3 =
+ mfib_table_entry_path_update (fib_index, pfx_star_g_3, MFIB_SOURCE_API,
+ MFIB_ENTRY_FLAG_NONE, &path_via_if0);
MFIB_TEST(!mfib_test_entry(mfei_g_3,
MFIB_ENTRY_FLAG_NONE,
0),
@@ -1065,14 +1044,12 @@ mfib_test_i (fib_protocol_t PROTO,
.frp_mitf_flags = MFIB_ITF_FLAG_FORWARD,
};
- mfei_g_1 = mfib_table_entry_path_update(fib_index,
- pfx_star_g_1,
- MFIB_SOURCE_API,
- &path_via_nbr1);
- mfei_g_1 = mfib_table_entry_path_update(fib_index,
- pfx_star_g_1,
- MFIB_SOURCE_API,
- &path_via_nbr2);
+ mfei_g_1 =
+ mfib_table_entry_path_update (fib_index, pfx_star_g_1, MFIB_SOURCE_API,
+ MFIB_ENTRY_FLAG_NONE, &path_via_nbr1);
+ mfei_g_1 =
+ mfib_table_entry_path_update (fib_index, pfx_star_g_1, MFIB_SOURCE_API,
+ MFIB_ENTRY_FLAG_NONE, &path_via_nbr2);
MFIB_TEST(!mfib_test_entry(mfei_g_1,
MFIB_ENTRY_FLAG_NONE,
2,
@@ -1231,10 +1208,8 @@ mfib_test_i (fib_protocol_t PROTO,
FIB_FORW_CHAIN_TYPE_MPLS_EOS,
&mldp_dpo);
- mfei = mfib_table_entry_path_update(fib_index,
- pfx_s_g,
- MFIB_SOURCE_API,
- &path_via_mldp);
+ mfei = mfib_table_entry_path_update (fib_index, pfx_s_g, MFIB_SOURCE_API,
+ MFIB_ENTRY_FLAG_NONE, &path_via_mldp);
MFIB_TEST(!mfib_test_entry(mfei,
MFIB_ENTRY_FLAG_NONE,
@@ -1246,10 +1221,8 @@ mfib_test_i (fib_protocol_t PROTO,
/*
* add a for-us path. this tests two types of non-attached paths on one entry
*/
- mfei = mfib_table_entry_path_update(fib_index,
- pfx_s_g,
- MFIB_SOURCE_API,
- &path_for_us);
+ mfei = mfib_table_entry_path_update (fib_index, pfx_s_g, MFIB_SOURCE_API,
+ MFIB_ENTRY_FLAG_NONE, &path_for_us);
MFIB_TEST(!mfib_test_entry(mfei,
MFIB_ENTRY_FLAG_NONE,
2,
@@ -1573,10 +1546,8 @@ mfib_test_rr_i (fib_protocol_t FPROTO,
/*
* Insert the less specific /28
*/
- mfib_table_entry_path_update(fib_index,
- pfx_cover,
- MFIB_SOURCE_API,
- &path_via_if1);
+ mfib_table_entry_path_update (fib_index, pfx_cover, MFIB_SOURCE_API,
+ MFIB_ENTRY_FLAG_NONE, &path_via_if1);
mfei_cover = mfib_table_lookup_exact_match(fib_index, pfx_cover);
@@ -1600,10 +1571,8 @@ mfib_test_rr_i (fib_protocol_t FPROTO,
/*
* add another path to the cover
*/
- mfib_table_entry_path_update(fib_index,
- pfx_cover,
- MFIB_SOURCE_API,
- &path_via_if2);
+ mfib_table_entry_path_update (fib_index, pfx_cover, MFIB_SOURCE_API,
+ MFIB_ENTRY_FLAG_NONE, &path_via_if2);
/*
* expect the /32 and /28 to be via both boths
@@ -1657,10 +1626,8 @@ mfib_test_rr_i (fib_protocol_t FPROTO,
/*
* add an accepting path to the cover
*/
- mfib_table_entry_path_update(fib_index,
- pfx_cover,
- MFIB_SOURCE_API,
- &path_via_if0);
+ mfib_table_entry_path_update (fib_index, pfx_cover, MFIB_SOURCE_API,
+ MFIB_ENTRY_FLAG_NONE, &path_via_if0);
/*
* expect the /32 and /28 to be via both boths
@@ -1695,10 +1662,8 @@ mfib_test_rr_i (fib_protocol_t FPROTO,
/*
* add a for-us path to the cover
*/
- mfib_table_entry_path_update(fib_index,
- pfx_cover,
- MFIB_SOURCE_API,
- &path_for_us);
+ mfib_table_entry_path_update (fib_index, pfx_cover, MFIB_SOURCE_API,
+ MFIB_ENTRY_FLAG_NONE, &path_for_us);
/*
* expect the /32 and /28 to be via all three paths
@@ -1766,10 +1731,9 @@ mfib_test_rr_i (fib_protocol_t FPROTO,
/*
* source the /32 with its own path
*/
- mfei_host1 = mfib_table_entry_path_update(fib_index,
- pfx_host1,
- MFIB_SOURCE_API,
- &path_via_if2);
+ mfei_host1 =
+ mfib_table_entry_path_update (fib_index, pfx_host1, MFIB_SOURCE_API,
+ MFIB_ENTRY_FLAG_NONE, &path_via_if2);
MFIB_TEST(!mfib_test_entry(mfei_host1,
MFIB_ENTRY_FLAG_NONE,
1,
@@ -1799,10 +1763,9 @@ mfib_test_rr_i (fib_protocol_t FPROTO,
/*
* add the RR back then remove the path and RR
*/
- mfei_host1 = mfib_table_entry_path_update(fib_index,
- pfx_host1,
- MFIB_SOURCE_API,
- &path_via_if2);
+ mfei_host1 =
+ mfib_table_entry_path_update (fib_index, pfx_host1, MFIB_SOURCE_API,
+ MFIB_ENTRY_FLAG_NONE, &path_via_if2);
MFIB_TEST(!mfib_test_entry(mfei_host1,
MFIB_ENTRY_FLAG_NONE,
1,
diff --git a/src/plugins/vrrp/vrrp.c b/src/plugins/vrrp/vrrp.c
index 5ee011cceb1..2f638624218 100644
--- a/src/plugins/vrrp/vrrp.c
+++ b/src/plugins/vrrp/vrrp.c
@@ -435,10 +435,10 @@ vrrp_intf_enable_disable_mcast (u8 enable, u32 sw_if_index, u8 is_ipv6)
/* If this is the first VR configured, add the local mcast routes */
if (n_vrs == 1)
mfib_table_entry_path_update (fib_index, vrrp_prefix, MFIB_SOURCE_API,
- &for_us);
+ MFIB_ENTRY_FLAG_NONE, &for_us);
mfib_table_entry_path_update (fib_index, vrrp_prefix, MFIB_SOURCE_API,
- &via_itf);
+ MFIB_ENTRY_FLAG_NONE, &via_itf);
intf->mcast_adj_index[! !is_ipv6] =
adj_mcast_add_or_lock (proto, link_type, sw_if_index);
}