From 4ec36c5535849a4e456ed99b57968d54d5e03b62 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Tue, 31 Mar 2020 09:21:29 -0400 Subject: fib: midchain adjacency optimisations Type: improvement - inline some common encap fixup functions into the midchain rewrite node so we don't incur the cost of the virtual function call - change the copy 'guess' from ethernet_header (which will never happen) to an ip4 header - add adj-midchain-tx to multiarch sources - don't run adj-midchain-tx as a feature, instead put this node as the adj's next and at the end of the feature arc. - cache the feature arc config index (to save the cache miss going to fetch it) - don't check if features are enabled when taking the arc (since we know they are) the last two changes will also benefit normal adjacencies taking the arc (i.e. for NAT, ACLs, etc) for IPSec: - don't run esp_encrypt as a feature, instead when required insert this node into the adj's next and into the end of the feature arc. this implies that encrypt is always 'the last feature' run, which is symmetric with decrypt always being the first. - esp_encrpyt for tunnels has adj-midchain-tx as next node Change-Id: Ida0af56a704302cf2d7797ded5f118a781e8acb7 Signed-off-by: Neale Ranns --- src/vnet/adj/adj_midchain.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/vnet/adj/adj_midchain.h') diff --git a/src/vnet/adj/adj_midchain.h b/src/vnet/adj/adj_midchain.h index 1f5deaecd95..5fb0ee8efb3 100644 --- a/src/vnet/adj/adj_midchain.h +++ b/src/vnet/adj/adj_midchain.h @@ -50,6 +50,27 @@ extern void adj_nbr_midchain_update_rewrite(adj_index_t adj_index, adj_flags_t flags, u8 *rewrite); +/** + * @brief + * Return the adjacency's next node to its default value + * + * @param adj_index + * The index of the neighbour adjacency. + */ +extern void adj_nbr_midchain_reset_next_node(adj_index_t adj_index); + +/** + * @brief + * Update the VLIB node to which packets are sent post processing + * + * @param adj_index + * The index of the neighbour adjacency. + * + * @param node node-index to send to + */ +extern void adj_nbr_midchain_update_next_node(adj_index_t adj_index, + u32 node_index); + /** * @brief * [re]stack a midchain. 'Stacking' is the act of forming parent-child @@ -139,4 +160,6 @@ extern void adj_midchain_delegate_restack(adj_index_t ai); */ extern void adj_midchain_delegate_unstack(adj_index_t ai); +extern u8 adj_is_midchain (adj_index_t ai); + #endif -- cgit 1.2.3-korg