summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip_test.c
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2024-04-16 09:36:05 +0200
committerNeale Ranns <neale@graphiant.com>2024-07-12 03:09:22 +0000
commitff570d3d07ebe07a5107b44d50c54fc4a57359dc (patch)
treee09554d6adf9e79b5d9abc7b9357509db20d8641 /src/vnet/ip/ip_test.c
parentcaaa63322307b28bc8cf9796f642d9a068722ba5 (diff)
fib: make mfib optional
In some cases we do not need multicast support. Making it optional helps scaling to high number of VRFs, by reducing the control plane operations and memory consumption. Type: improvement Change-Id: Ib34ed3fe2806e2f4624981da4e4a3c49c69f70be Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/vnet/ip/ip_test.c')
-rw-r--r--src/vnet/ip/ip_test.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/vnet/ip/ip_test.c b/src/vnet/ip/ip_test.c
index 727afba67f4..0d1c71063ae 100644
--- a/src/vnet/ip/ip_test.c
+++ b/src/vnet/ip/ip_test.c
@@ -464,6 +464,60 @@ api_ip_table_add_del (vat_main_t *vam)
}
static int
+api_ip_table_add_del_v2 (vat_main_t *vam)
+{
+ unformat_input_t *i = vam->input;
+ vl_api_ip_table_add_del_v2_t *mp;
+ u8 create_mfib = 1;
+ u32 table_id = ~0;
+ u8 is_ipv6 = 0;
+ u8 is_add = 1;
+ int ret = 0;
+
+ /* Parse args required to build the message */
+ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (i, "ipv6"))
+ is_ipv6 = 1;
+ else if (unformat (i, "del"))
+ is_add = 0;
+ else if (unformat (i, "add"))
+ is_add = 1;
+ else if (unformat (i, "table %d", &table_id))
+ ;
+ else if (unformat (i, "no-mfib"))
+ create_mfib = 0;
+ else
+ {
+ clib_warning ("parse error '%U'", format_unformat_error, i);
+ return -99;
+ }
+ }
+
+ if (~0 == table_id)
+ {
+ errmsg ("missing table-ID");
+ return -99;
+ }
+
+ /* Construct the API message */
+ M (IP_TABLE_ADD_DEL_V2, mp);
+
+ mp->table.table_id = ntohl (table_id);
+ mp->table.is_ip6 = is_ipv6;
+ mp->is_add = is_add;
+ mp->create_mfib = create_mfib;
+
+ /* send it... */
+ S (mp);
+
+ /* Wait for a reply... */
+ W (ret);
+
+ return ret;
+}
+
+static int
api_ip_table_replace_begin (vat_main_t *vam)
{
unformat_input_t *i = vam->input;