diff options
author | Neale Ranns <nranns@cisco.com> | 2016-10-08 13:03:40 +0100 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2016-10-14 13:50:39 +0000 |
commit | b80c536e34b610ca77cd84448754e4bd9c46cf68 (patch) | |
tree | d7a868cdd657a3a54ff9eef76bfe3e7e4678e6d3 /vnet/vnet/adj/adj_internal.h | |
parent | 3ae1a91430a341cd9ca96023e4fb619efe7cac7e (diff) |
FIB2.0: Adjacency complete pull model (VPP-487)
Change the adjacency completion model to pull not push.
A complete adjacency has a rewirte string, an incomplete one does not. the re-write string for a peer comes either from a discovery protocol (i.e. ARP/ND) or can be directly derived from the link type (i.e. GRE tunnels). Which method it is, is interface type specific.
For each packet type sent on a link to a peer there is a corresponding adjacency. For example, if there is a peer 10.0.0.1 on Eth0 and we need to send to it IPv4 and MPLS packets, there will be two adjacencies; one for the IPv4 and one for the MPLS packets. The adjacencies are thus distinguished by the packets the carry, this is known as the adjacency's 'link-type'. It is not an L3 packet type, since the adjacency can have a link type of Ethernet (for L2 over GRE).
The discovery protocols are not aware of all the link types required - only the FIB is. the FIB will create adjacencies as and when they are required, and it is thus then desirable to 'pull' from the discovery protocol the re-write required. The alternative (that we have now) is that the discovery protocol pushes (i.e. creates) adjacencies for each link type - this creates more adjacencies than we need.
To pull, FIB now requests from the interface-type to 'complete' the adjacency. The interface can then delegate to the discovery protocol (on ethernet links) or directly build the re-write (i.e on GRE).
Change-Id: I61451789ae03f26b1012d8d6524007b769b6c6ee
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'vnet/vnet/adj/adj_internal.h')
-rw-r--r-- | vnet/vnet/adj/adj_internal.h | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/vnet/vnet/adj/adj_internal.h b/vnet/vnet/adj/adj_internal.h index 25a477ad007..f882bff84c0 100644 --- a/vnet/vnet/adj/adj_internal.h +++ b/vnet/vnet/adj/adj_internal.h @@ -41,21 +41,21 @@ #define ADJ_DBG(_e, _fmt, _args...) #endif -static inline vlib_node_registration_t* +static inline u32 adj_get_rewrite_node (fib_link_t linkt) { switch (linkt) { case FIB_LINK_IP4: - return (&ip4_rewrite_node); + return (ip4_rewrite_node.index); case FIB_LINK_IP6: - return (&ip6_rewrite_node); + return (ip6_rewrite_node.index); case FIB_LINK_MPLS: - return (&mpls_output_node); + return (mpls_output_node.index); case FIB_LINK_ETHERNET: - return (&adj_l2_rewrite_node); + return (adj_l2_rewrite_node.index); } ASSERT(0); - return (NULL); + return (0); } static inline vnet_l3_packet_type_t @@ -75,17 +75,17 @@ adj_fib_link_2_vnet (fib_link_t linkt) return (0); } -static inline vnet_l3_packet_type_t +static inline vnet_link_t adj_fib_proto_2_nd (fib_protocol_t fp) { switch (fp) { case FIB_PROTOCOL_IP4: - return (VNET_L3_PACKET_TYPE_ARP); + return (VNET_LINK_ARP); case FIB_PROTOCOL_IP6: - return (VNET_L3_PACKET_TYPE_IP6); + return (VNET_LINK_IP6); case FIB_PROTOCOL_MPLS: - return (VNET_L3_PACKET_TYPE_MPLS_UNICAST); + return (VNET_LINK_MPLS); } return (0); } @@ -100,6 +100,12 @@ adj_get_index (ip_adjacency_t *adj) return (adj - adj_pool); } +extern void adj_nbr_update_rewrite_internal (ip_adjacency_t *adj, + adj_nbr_rewrite_flag_t flags, + u32 complete_next_index, + u32 next_index, + u8 *rewrite); + extern ip_adjacency_t * adj_alloc(fib_protocol_t proto); extern void adj_nbr_remove(fib_protocol_t nh_proto, |