fib: midchain adjacency optimisations 65/26265/14
authorNeale Ranns <nranns@cisco.com>
Tue, 31 Mar 2020 13:21:29 +0000 (09:21 -0400)
committerDamjan Marion <dmarion@me.com>
Mon, 4 May 2020 17:09:34 +0000 (17:09 +0000)
commit4ec36c5535849a4e456ed99b57968d54d5e03b62
tree47c807c525858db02f7d1e0e4df32b14441ed5c8
parentb723ccf95ffd8581be15e0752eac2c5f7233b340
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 <nranns@cisco.com>
28 files changed:
src/plugins/dpdk/ipsec/esp_encrypt.c
src/plugins/nsh/nsh-md2-ioam/md2_ioam_transit.c
src/vnet/CMakeLists.txt
src/vnet/adj/adj.c
src/vnet/adj/adj.h
src/vnet/adj/adj_delegate.c
src/vnet/adj/adj_delegate.h
src/vnet/adj/adj_dp.h [new file with mode: 0644]
src/vnet/adj/adj_internal.h
src/vnet/adj/adj_l2.c
src/vnet/adj/adj_midchain.c
src/vnet/adj/adj_midchain.h
src/vnet/adj/adj_nbr.c
src/vnet/adj/rewrite.c
src/vnet/adj/rewrite.h
src/vnet/config.c
src/vnet/config.h
src/vnet/feature/feature.c
src/vnet/feature/feature.h
src/vnet/ip/ip4_forward.c
src/vnet/ip/ip6_forward.c
src/vnet/ipip/ipip.c
src/vnet/ipsec/esp_encrypt.c
src/vnet/ipsec/ipsec.c
src/vnet/ipsec/ipsec.h
src/vnet/ipsec/ipsec_tun.c
src/vnet/tunnel/tunnel_dp.h
test/test_ipsec_tun_if_esp.py