]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra,yang: Completely remove multicast mode from zebra
authorNathan Bahr <nbahr@atcorp.com>
Tue, 24 Sep 2024 20:13:35 +0000 (20:13 +0000)
committerNathan Bahr <nbahr@atcorp.com>
Thu, 12 Dec 2024 13:50:31 +0000 (13:50 +0000)
Multicast mode belongs in PIM, so removing it completely from zebra.
Modified `show (ip|ipv6) rpf ADDRESS` to always lookup from SAFI_MULTICAST.
This means this command is now specific to the multicast table and does
not necessarily reflect the PIM RPF lookup, but that should be implemented
in PIM instead.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
yang/frr-zebra.yang
zebra/zebra_nb.c
zebra/zebra_nb_config.c
zebra/zebra_router.c
zebra/zebra_router.h
zebra/zebra_vty.c

index f97a4cc129beb098f4b2726bc44354e216d7ddeb..a3c066c56c145a94f913f3d1e638cf57cf73ca55 100644 (file)
@@ -157,47 +157,6 @@ module frr-zebra {
       "Zebra interface type gre.";
   }
 
-  /*
-   * Multicast RPF mode configurable type
-   */
-
-  typedef mcast-rpf-lookup-mode {
-    type enumeration {
-      enum "none" {
-        value 0;
-        description
-          "No mode set.";
-      }
-      enum "mrib-only" {
-        value 1;
-        description
-          "Lookup in unicast RIB only.";
-      }
-      enum "urib-only" {
-        value 2;
-        description
-          "Lookup in multicast RIB only.";
-      }
-      enum "mrib-then-urib" {
-        value 3;
-        description
-          "Try multicast RIB first, fall back to unicast RIB.";
-      }
-      enum "lower-distance" {
-        value 4;
-        description
-          "Lookup both unicast and mcast, use entry with lower distance.";
-      }
-      enum "longer-prefix" {
-        value 5;
-        description
-          "Lookup both unicast and mcast, use entry with longer prefix.";
-      }
-    }
-    description
-      "Multicast RPF lookup behavior";
-  }
-
   // End of ip6-route
   /*
    * VxLAN Network Identifier type
@@ -2883,12 +2842,6 @@ module frr-zebra {
   container zebra {
     description
       "Data model for the Zebra daemon.";
-    leaf mcast-rpf-lookup {
-      type frr-zebra:mcast-rpf-lookup-mode;
-      default "mrib-then-urib";
-      description
-        "Multicast RPF lookup behavior.";
-    }
     leaf ip-forwarding {
       type boolean;
       description
index 0a7ed5db41f031890078225d7977add741e8d159..6b41993a95913697d5ac77e4c2070f7c7e91b9bb 100644 (file)
@@ -25,12 +25,6 @@ const struct frr_yang_module_info frr_zebra_info = {
        .name = "frr-zebra",
        .features = features,
        .nodes = {
-               {
-                       .xpath = "/frr-zebra:zebra/mcast-rpf-lookup",
-                       .cbs = {
-                               .modify = zebra_mcast_rpf_lookup_modify,
-                       }
-               },
                {
                        .xpath = "/frr-zebra:zebra/ip-forwarding",
                        .cbs = {
index 09c0091ec693bc7a89884938169fc46d1c992933..ec151360bd1ac5dad62a8895243e9c5ba7e680ba 100644 (file)
 #include "zebra/zebra_rnh.h"
 #include "zebra/table_manager.h"
 
-/*
- * XPath: /frr-zebra:zebra/mcast-rpf-lookup
- */
-int zebra_mcast_rpf_lookup_modify(struct nb_cb_modify_args *args)
-{
-       switch (args->event) {
-       case NB_EV_VALIDATE:
-       case NB_EV_PREPARE:
-       case NB_EV_ABORT:
-       case NB_EV_APPLY:
-               /* TODO: implement me. */
-               break;
-       }
-
-       return NB_OK;
-}
-
 /*
  * XPath: /frr-zebra:zebra/ip-forwarding
  */
index 4022c1a26fc61747cc8fcebc3610874b9d9dc230..ae2910af410a863d6f5a9162c40ec616166256d7 100644 (file)
@@ -23,7 +23,6 @@ DEFINE_MTYPE_STATIC(ZEBRA, ZEBRA_RT_TABLE, "Zebra VRF table");
 
 struct zebra_router zrouter = {
        .multipath_num = MULTIPATH_NUM,
-       .ipv4_multicast_mode = MCAST_NO_CONFIG,
 };
 
 static inline int
@@ -221,19 +220,6 @@ uint32_t zebra_router_get_next_sequence(void)
                                           memory_order_relaxed);
 }
 
-void multicast_mode_ipv4_set(enum multicast_mode mode)
-{
-       if (IS_ZEBRA_DEBUG_RIB)
-               zlog_debug("%s: multicast lookup mode set (%d)", __func__,
-                          mode);
-       zrouter.ipv4_multicast_mode = mode;
-}
-
-enum multicast_mode multicast_mode_ipv4_get(void)
-{
-       return zrouter.ipv4_multicast_mode;
-}
-
 void zebra_router_terminate(void)
 {
        struct zebra_router_table *zrt, *tmp;
index a637c3214e067a1b5991b4b6a365f8886e53ba3a..28c4cf0790d73892f115cd9986509ac07af7b390 100644 (file)
@@ -34,17 +34,6 @@ RB_HEAD(zebra_router_table_head, zebra_router_table);
 RB_PROTOTYPE(zebra_router_table_head, zebra_router_table,
             zebra_router_table_entry, zebra_router_table_entry_compare)
 
-/* RPF lookup behaviour */
-enum multicast_mode {
-       MCAST_NO_CONFIG = 0,  /* MIX_MRIB_FIRST, but no show in config write */
-       MCAST_MRIB_ONLY,      /* MRIB only */
-       MCAST_URIB_ONLY,      /* URIB only */
-       MCAST_MIX_MRIB_FIRST, /* MRIB, if nothing at all then URIB */
-       MCAST_MIX_DISTANCE,   /* MRIB & URIB, lower distance wins */
-       MCAST_MIX_PFXLEN,     /* MRIB & URIB, longer prefix wins */
-                             /* on equal value, MRIB wins for last 2 */
-};
-
 /* An interface can be error-disabled if a protocol (such as EVPN or
  * VRRP) detects a problem with keeping it operationally-up.
  * If any of the protodown bits are set protodown-on is programmed
@@ -187,9 +176,6 @@ struct zebra_router {
 
        uint32_t multipath_num;
 
-       /* RPF Lookup behavior */
-       enum multicast_mode ipv4_multicast_mode;
-
        /*
         * zebra start time and time of sweeping RIB of old routes
         */
@@ -287,10 +273,6 @@ static inline struct zebra_vrf *zebra_vrf_get_evpn(void)
                                : zebra_vrf_lookup_by_id(VRF_DEFAULT);
 }
 
-extern void multicast_mode_ipv4_set(enum multicast_mode mode);
-
-extern enum multicast_mode multicast_mode_ipv4_get(void);
-
 extern bool zebra_router_notify_on_ack(void);
 
 static inline void zebra_router_set_supports_nhgs(bool support)
index b65097e725b4a897f62042b455c4c4707a1fbcb3..da003d212e16d321e76045b2f17d08ae2ac6b15d 100644 (file)
@@ -88,56 +88,6 @@ static void show_ip_route_nht_dump(struct vty *vty,
                                   const struct route_entry *re,
                                   unsigned int num);
 
-DEFUN (ip_multicast_mode,
-       ip_multicast_mode_cmd,
-       "ip multicast rpf-lookup-mode <urib-only|mrib-only|mrib-then-urib|lower-distance|longer-prefix>",
-       IP_STR
-       "Multicast options\n"
-       "RPF lookup behavior\n"
-       "Lookup in unicast RIB only\n"
-       "Lookup in multicast RIB only\n"
-       "Try multicast RIB first, fall back to unicast RIB\n"
-       "Lookup both, use entry with lower distance\n"
-       "Lookup both, use entry with longer prefix\n")
-{
-       char *mode = argv[3]->text;
-
-       if (strmatch(mode, "urib-only"))
-               multicast_mode_ipv4_set(MCAST_URIB_ONLY);
-       else if (strmatch(mode, "mrib-only"))
-               multicast_mode_ipv4_set(MCAST_MRIB_ONLY);
-       else if (strmatch(mode, "mrib-then-urib"))
-               multicast_mode_ipv4_set(MCAST_MIX_MRIB_FIRST);
-       else if (strmatch(mode, "lower-distance"))
-               multicast_mode_ipv4_set(MCAST_MIX_DISTANCE);
-       else if (strmatch(mode, "longer-prefix"))
-               multicast_mode_ipv4_set(MCAST_MIX_PFXLEN);
-       else {
-               vty_out(vty, "Invalid mode specified\n");
-               return CMD_WARNING_CONFIG_FAILED;
-       }
-
-       return CMD_SUCCESS;
-}
-
-DEFUN (no_ip_multicast_mode,
-       no_ip_multicast_mode_cmd,
-       "no ip multicast rpf-lookup-mode [<urib-only|mrib-only|mrib-then-urib|lower-distance|longer-prefix>]",
-       NO_STR
-       IP_STR
-       "Multicast options\n"
-       "RPF lookup behavior\n"
-       "Lookup in unicast RIB only\n"
-       "Lookup in multicast RIB only\n"
-       "Try multicast RIB first, fall back to unicast RIB\n"
-       "Lookup both, use entry with lower distance\n"
-       "Lookup both, use entry with longer prefix\n")
-{
-       multicast_mode_ipv4_set(MCAST_NO_CONFIG);
-       return CMD_SUCCESS;
-}
-
-
 DEFPY (show_ip_rpf,
        show_ip_rpf_cmd,
        "show [ip$ip|ipv6$ipv6] rpf [json]",
@@ -168,8 +118,7 @@ DEFPY (show_ip_rpf_addr,
        struct route_node *rn;
        struct route_entry *re;
 
-       re = rib_match_multicast(AFI_IP, VRF_DEFAULT, (union g_addr *)&address,
-                                &rn);
+       re = rib_match(AFI_IP, SAFI_MULTICAST, VRF_DEFAULT, (union g_addr *)&address, &rn);
 
        if (re)
                vty_show_ip_route_detail(vty, rn, 1, false, false);
@@ -190,8 +139,7 @@ DEFPY (show_ipv6_rpf_addr,
        struct route_node *rn;
        struct route_entry *re;
 
-       re = rib_match_multicast(AFI_IP6, VRF_DEFAULT, (union g_addr *)&address,
-                                &rn);
+       re = rib_match(AFI_IP6, SAFI_MULTICAST, VRF_DEFAULT, (union g_addr *)&address, &rn);
 
        if (re)
                vty_show_ip_route_detail(vty, rn, 1, false, false);
@@ -3757,22 +3705,6 @@ static int config_write_protocol(struct vty *vty)
                vty_out(vty, "zebra zapi-packets %u\n",
                        zrouter.packets_to_process);
 
-       enum multicast_mode ipv4_multicast_mode = multicast_mode_ipv4_get();
-
-       if (ipv4_multicast_mode != MCAST_NO_CONFIG)
-               vty_out(vty, "ip multicast rpf-lookup-mode %s\n",
-                       ipv4_multicast_mode == MCAST_URIB_ONLY
-                               ? "urib-only"
-                               : ipv4_multicast_mode == MCAST_MRIB_ONLY
-                                         ? "mrib-only"
-                                         : ipv4_multicast_mode
-                                                           == MCAST_MIX_MRIB_FIRST
-                                                   ? "mrib-then-urib"
-                                                   : ipv4_multicast_mode
-                                                                     == MCAST_MIX_DISTANCE
-                                                             ? "lower-distance"
-                                                             : "longer-prefix");
-
        /* Include dataplane info */
        dplane_config_write_helper(vty);
 
@@ -4356,9 +4288,6 @@ void zebra_vty_init(void)
        install_element(CONFIG_NODE, &allow_external_route_update_cmd);
        install_element(CONFIG_NODE, &no_allow_external_route_update_cmd);
 
-       install_element(CONFIG_NODE, &ip_multicast_mode_cmd);
-       install_element(CONFIG_NODE, &no_ip_multicast_mode_cmd);
-
        install_element(CONFIG_NODE, &zebra_nexthop_group_keep_cmd);
        install_element(CONFIG_NODE, &ip_zebra_import_table_distance_cmd);
        install_element(CONFIG_NODE, &no_ip_zebra_import_table_cmd);