Remove unsed parameter from fib_table_entry_special_add() (only used in FIB tests... 80/6180/2
authorNeale Ranns <nranns@cisco.com>
Thu, 13 Apr 2017 07:44:52 +0000 (00:44 -0700)
committerNeale Ranns <nranns@cisco.com>
Thu, 13 Apr 2017 09:44:51 +0000 (02:44 -0700)
Change-Id: I962df9e162e4dfb6837a5ce79ea795d5ff2d7315
Signed-off-by: Neale Ranns <nranns@cisco.com>
18 files changed:
src/plugins/ila/ila.c
src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_ioam.c
src/plugins/lb/lb.c
src/vnet/dhcp/client.c
src/vnet/dhcp/dhcp4_proxy_node.c
src/vnet/fib/fib_bfd.c
src/vnet/fib/fib_path.c
src/vnet/fib/fib_table.c
src/vnet/fib/fib_table.h
src/vnet/fib/fib_test.c
src/vnet/fib/ip4_fib.c
src/vnet/fib/ip6_fib.c
src/vnet/gre/interface.c
src/vnet/ip/ip4_forward.c
src/vnet/ip/ip4_source_check.c
src/vnet/lisp-gpe/lisp_gpe_tunnel.c
src/vnet/map/map.c
src/vnet/vxlan/vxlan.c

index edbf301..fd56043 100644 (file)
@@ -736,8 +736,7 @@ ila_add_del_entry (ila_add_del_entry_args_t * args)
              fib_table_entry_special_add(0,
                                          &next_hop,
                                          FIB_SOURCE_RR,
-                                         FIB_ENTRY_FLAG_NONE,
-                                         ADJ_INDEX_INVALID);
+                                         FIB_ENTRY_FLAG_NONE);
          e->next_hop_child_index =
              fib_entry_child_add(e->next_hop_fib_entry_index,
                                  ila_fib_node_type,
index 88d7d20..cfc550c 100644 (file)
@@ -336,9 +336,7 @@ vxlan_gpe_enable_disable_ioam_for_dest (vlib_main_t * vm,
          t1->fib_entry_index =
            fib_table_entry_special_add (outer_fib_index,
                                         &tun_dst_pfx,
-                                        FIB_SOURCE_RR,
-                                        FIB_ENTRY_FLAG_NONE,
-                                        ADJ_INDEX_INVALID);
+                                        FIB_SOURCE_RR, FIB_ENTRY_FLAG_NONE);
          t1->sibling_index =
            fib_entry_child_add (t1->fib_entry_index,
                                 hm->fib_entry_type, t1 - hm->dst_tunnels);
index addc2a4..cc3f853 100644 (file)
@@ -510,8 +510,7 @@ next:
        fib_table_entry_special_add(0,
                                    &nh,
                                    FIB_SOURCE_RR,
-                                   FIB_ENTRY_FLAG_NONE,
-                                   ADJ_INDEX_INVALID);
+                                   FIB_ENTRY_FLAG_NONE);
     as->next_hop_child_index =
        fib_entry_child_add(as->next_hop_fib_entry_index,
                            lbm->fib_node_type,
index 29749a3..7c3f7f6 100644 (file)
@@ -781,8 +781,7 @@ int dhcp_client_add_del (dhcp_client_add_del_args_t * a)
                                      c->sw_if_index),
                                  &all_1s,
                                  FIB_SOURCE_DHCP,
-                                 FIB_ENTRY_FLAG_LOCAL,
-                                 ADJ_INDEX_INVALID);
+                                 FIB_ENTRY_FLAG_LOCAL);
 
      /*
        * enable the interface to RX IPv4 packets
index 1c84881..26e1e65 100644 (file)
@@ -807,8 +807,7 @@ dhcp4_proxy_set_server (ip46_address_t *addr,
           fib_table_entry_special_add(rx_fib_index,
                                       &all_1s,
                                       FIB_SOURCE_DHCP,
-                                      FIB_ENTRY_FLAG_LOCAL,
-                                      ADJ_INDEX_INVALID);
+                                      FIB_ENTRY_FLAG_LOCAL);
           fib_table_lock (rx_fib_index, FIB_PROTOCOL_IP4);
       }
   }
index e5affb8..734ee8c 100644 (file)
@@ -109,8 +109,7 @@ fib_bfd_notify (bfd_listen_event_e event,
             fei = fib_table_entry_special_add(key->fib_index,
                                               &pfx,
                                               FIB_SOURCE_RR,
-                                              FIB_ENTRY_FLAG_NONE,
-                                              ADJ_INDEX_INVALID);
+                                              FIB_ENTRY_FLAG_NONE);
             fib_entry_lock(fei);
 
             fed = fib_entry_delegate_find_or_add(fib_entry_get(fei),
index cd7d927..70c8790 100644 (file)
@@ -1621,8 +1621,7 @@ fib_path_resolve (fib_node_index_t path_index)
        fei = fib_table_entry_special_add(path->recursive.fp_tbl_id,
                                          &pfx,
                                          FIB_SOURCE_RR,
-                                         FIB_ENTRY_FLAG_NONE,
-                                         ADJ_INDEX_INVALID);
+                                         FIB_ENTRY_FLAG_NONE);
 
        path = fib_path_get(path_index);
        path->fp_via_fib = fei;
index b31f35e..0938ce9 100644 (file)
@@ -371,23 +371,12 @@ fib_node_index_t
 fib_table_entry_special_add (u32 fib_index,
                             const fib_prefix_t *prefix,
                             fib_source_t source,
-                            fib_entry_flag_t flags,
-                            adj_index_t adj_index)
+                            fib_entry_flag_t flags)
 {
     fib_node_index_t fib_entry_index;
     dpo_id_t tmp_dpo = DPO_INVALID;
 
-    if (ADJ_INDEX_INVALID != adj_index)
-    {
-        dpo_set(&tmp_dpo,
-                DPO_ADJACENCY,
-                FIB_PROTOCOL_MAX,
-                adj_index);
-    }
-    else
-    {
-        dpo_copy(&tmp_dpo, drop_dpo_get(fib_proto_to_dpo(prefix->fp_proto)));
-    }
+    dpo_copy(&tmp_dpo, drop_dpo_get(fib_proto_to_dpo(prefix->fp_proto)));
  
     fib_entry_index = fib_table_entry_special_dpo_add(fib_index, prefix, source,
                                                       flags, &tmp_dpo);
index b310aea..f24d28b 100644 (file)
@@ -126,14 +126,16 @@ extern fib_node_index_t fib_table_get_less_specific(u32 fib_index,
 
 /**
  * @brief
- *  Add a 'special' entry to the FIB that links to the adj passed
+ *  Add a 'special' entry to the FIB.
  *  A special entry is an entry that the FIB is not expect to resolve
  *  via the usual mechanisms (i.e. recurisve or neighbour adj DB lookup).
- *  Instead the client/source provides the adj to link to.
+ *  Instead the will link to a DPO valid for the source and/or the flags.
  *  This add is reference counting per-source. So n 'removes' are required
  *  for n 'adds', if the entry is no longer required.
+ *  If the source needs to provide non-default forwarding use:
+ *  fib_table_entry_special_dpo_add()
  *
 * @param fib_index
+ * @param fib_index
  *  The index of the FIB
  *
  * @param prefix
@@ -145,17 +147,13 @@ extern fib_node_index_t fib_table_get_less_specific(u32 fib_index,
  * @param flags
  *  Flags for the entry.
  *
- * @param adj_index
- *  The adjacency to link to.
- *
  * @return
  *  the index of the fib_entry_t that is created (or exists already).
  */
 extern fib_node_index_t fib_table_entry_special_add(u32 fib_index,
                                                    const fib_prefix_t *prefix,
                                                    fib_source_t source,
-                                                   fib_entry_flag_t flags,
-                                                   adj_index_t adj_index);
+                                                   fib_entry_flag_t flags);
 
 /**
  * @brief
index e4a8a70..c58dc5a 100644 (file)
@@ -1378,8 +1378,8 @@ fib_test_v4 (void)
             fib_entry_pool_size());
 
     /*
-     * An EXCLUSIVE route; one where the user (me) provides the exclusive
-     * adjacency through which the route will resovle
+     * An special route; one where the user (me) provides the
+     * adjacency through which the route will resovle by setting the flags
      */
     fib_prefix_t ex_pfx = {
        .fp_len = 32,
@@ -1393,11 +1393,12 @@ fib_test_v4 (void)
     fib_table_entry_special_add(fib_index,
                                &ex_pfx,
                                FIB_SOURCE_SPECIAL,
-                               FIB_ENTRY_FLAG_EXCLUSIVE,
-                               locked_ai);
+                               FIB_ENTRY_FLAG_LOCAL);
     fei = fib_table_lookup_exact_match(fib_index, &ex_pfx);
-    FIB_TEST((ai == fib_entry_get_adj(fei)),
-            "Exclusive route links to user adj");
+    dpo = fib_entry_contribute_ip_forwarding(fei);
+    dpo = load_balance_get_bucket(dpo->dpoi_index, 0);
+    FIB_TEST((DPO_RECEIVE == dpo->dpoi_type),
+            "local interface adj is local");
 
     fib_table_entry_special_remove(fib_index,
                                   &ex_pfx,
@@ -3675,8 +3676,7 @@ fib_test_v4 (void)
     fei = fib_table_entry_special_add(fib_index,
                                      &pfx_4_1_1_1_s_32,
                                      FIB_SOURCE_URPF_EXEMPT,
-                                     FIB_ENTRY_FLAG_DROP,
-                                     ADJ_INDEX_INVALID);
+                                     FIB_ENTRY_FLAG_DROP);
     dpo = fib_entry_contribute_ip_forwarding(fei);
     FIB_TEST(load_balance_is_drop(dpo),
             "uRPF exempt 4.1.1.1/32 DROP");
index b03186e..8e92d85 100644 (file)
@@ -149,8 +149,7 @@ ip4_create_fib_with_table_id (u32 table_id)
        fib_table_entry_special_add(fib_table->ft_index,
                                    &prefix,
                                    ip4_specials[ii].ift_source,
-                                   ip4_specials[ii].ift_flag,
-                                   ADJ_INDEX_INVALID);
+                                   ip4_specials[ii].ift_flag);
     }
 
     return (fib_table->ft_index);
index 0029714..d00f4c5 100644 (file)
@@ -35,8 +35,7 @@ vnet_ip6_fib_init (u32 fib_index)
     fib_table_entry_special_add(fib_index,
                                &pfx,
                                FIB_SOURCE_DEFAULT_ROUTE,
-                               FIB_ENTRY_FLAG_DROP,
-                               ADJ_INDEX_INVALID);
+                               FIB_ENTRY_FLAG_DROP);
 
     /*
      * all link local for us
@@ -47,8 +46,7 @@ vnet_ip6_fib_init (u32 fib_index)
     fib_table_entry_special_add(fib_index,
                                &pfx,
                                FIB_SOURCE_SPECIAL,
-                               FIB_ENTRY_FLAG_LOCAL,
-                               ADJ_INDEX_INVALID);
+                               FIB_ENTRY_FLAG_LOCAL);
 }
 
 static u32
index 91a3899..d574e59 100644 (file)
@@ -427,8 +427,7 @@ vnet_gre_tunnel_add (vnet_gre_add_del_tunnel_args_t *a,
       fib_table_entry_special_add(outer_fib_index,
                                   &t->tunnel_dst,
                                   FIB_SOURCE_RR,
-                                  FIB_ENTRY_FLAG_NONE,
-                                  ADJ_INDEX_INVALID);
+                                  FIB_ENTRY_FLAG_NONE);
   t->sibling_index =
       fib_entry_child_add(t->fib_entry_index,
                           FIB_NODE_TYPE_GRE_TUNNEL,
index e42b363..0f56203 100644 (file)
@@ -732,16 +732,14 @@ ip4_add_interface_routes (u32 sw_if_index,
                                     &net_pfx,
                                     FIB_SOURCE_INTERFACE,
                                     (FIB_ENTRY_FLAG_DROP |
-                                     FIB_ENTRY_FLAG_LOOSE_URPF_EXEMPT),
-                                    ADJ_INDEX_INVALID);
+                                     FIB_ENTRY_FLAG_LOOSE_URPF_EXEMPT));
       net_pfx.fp_addr.ip4.as_u32 |= ~im->fib_masks[pfx.fp_len];
       if (net_pfx.fp_addr.ip4.as_u32 != pfx.fp_addr.ip4.as_u32)
         fib_table_entry_special_add(fib_index,
                                     &net_pfx,
                                     FIB_SOURCE_INTERFACE,
                                     (FIB_ENTRY_FLAG_DROP |
-                                     FIB_ENTRY_FLAG_LOOSE_URPF_EXEMPT),
-                                    ADJ_INDEX_INVALID);
+                                     FIB_ENTRY_FLAG_LOOSE_URPF_EXEMPT));
     }
   else if (pfx.fp_len == 31)
     {
index 63b7594..17a1cb1 100644 (file)
@@ -509,7 +509,7 @@ ip_source_check_accept (vlib_main_t * vm,
       fib_table_entry_special_add (fib_index,
                                   &pfx,
                                   FIB_SOURCE_URPF_EXEMPT,
-                                  FIB_ENTRY_FLAG_DROP, ADJ_INDEX_INVALID);
+                                  FIB_ENTRY_FLAG_DROP);
     }
   else
     {
index 444bfe1..dd6c6fd 100644 (file)
@@ -179,8 +179,7 @@ lisp_gpe_tunnel_find_or_create_and_lock (const locator_pair_t * pair,
       lgt->fib_entry_index = fib_table_entry_special_add (rloc_fib_index,
                                                          &pfx,
                                                          FIB_SOURCE_RR,
-                                                         FIB_ENTRY_FLAG_NONE,
-                                                         ADJ_INDEX_INVALID);
+                                                         FIB_ENTRY_FLAG_NONE);
 
       hash_set_mem (lisp_gpe_tunnel_db, &lgt->key,
                    (lgt - lisp_gpe_tunnel_pool));
index 811a0ab..6a707df 100644 (file)
@@ -518,9 +518,7 @@ map_fib_resolve (map_main_pre_resolved_t * pr,
 
   pr->fei = fib_table_entry_special_add (0,    // default fib
                                         &pfx,
-                                        FIB_SOURCE_RR,
-                                        FIB_ENTRY_FLAG_NONE,
-                                        ADJ_INDEX_INVALID);
+                                        FIB_SOURCE_RR, FIB_ENTRY_FLAG_NONE);
   pr->sibling = fib_entry_child_add (pr->fei, FIB_NODE_TYPE_MAP_E, proto);
   map_stack (pr);
 }
index 61cb13c..1b3df2a 100644 (file)
@@ -486,7 +486,7 @@ int vnet_vxlan_add_del_tunnel
           vtep_addr_ref(&t->src);
           t->fib_entry_index = fib_table_entry_special_add
             (t->encap_fib_index, &tun_dst_pfx, FIB_SOURCE_RR,
-            FIB_ENTRY_FLAG_NONE, ADJ_INDEX_INVALID);
+            FIB_ENTRY_FLAG_NONE);
           t->sibling_index = fib_entry_child_add
             (t->fib_entry_index, FIB_NODE_TYPE_VXLAN_TUNNEL, t - vxm->tunnels);
           vxlan_tunnel_restack_dpo(t);