From efd9cf302ff6cbaf3c51e69bb9ea6c29e2325a10 Mon Sep 17 00:00:00 2001 From: Eyal Bari Date: Tue, 2 Oct 2018 12:23:06 +0300 Subject: vxlan:ip4 decap:remove access to tunnel object store local/remote addresses + vrf + vni in hash key store complete decap info in hash value (sw_if_index + next_index + error) this removes the need to access the tunnel object when matching both unicast and mcast. however for mcast handling it requires 3 hash lookups: * one failed unicast lookup (by src+dst addrs) * lookup by mcast(dst) addr . * unicast lookup (tunnel local ip as dst + pkt's src addr) where previously it needed 2: * lookup by src to find unicast tunnel + compare dst to local addr (failing for mcast) * lookup by mcast to find the mcast tunnel Change-Id: I7a3485d130a54194b8f7e2df0431258db36eceeb Signed-off-by: Eyal Bari --- src/vnet/vxlan/vxlan.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/vnet/vxlan/vxlan.h') diff --git a/src/vnet/vxlan/vxlan.h b/src/vnet/vxlan/vxlan.h index 7399b19e387..73052278a48 100644 --- a/src/vnet/vxlan/vxlan.h +++ b/src/vnet/vxlan/vxlan.h @@ -59,6 +59,24 @@ typedef clib_bihash_kv_16_8_t vxlan4_tunnel_key_t; */ typedef clib_bihash_kv_24_8_t vxlan6_tunnel_key_t; +typedef union +{ + struct + { + u32 sw_if_index; /* unicast - input interface / mcast - stats interface */ + union + { + struct /* unicast action */ + { + u16 next_index; + u8 error; + }; + ip4_address_t local_ip; /* used as dst ip for mcast pkts to assign them to unicast tunnel */ + }; + }; + u64 as_u64; +} vxlan_decap_info_t; + typedef struct { /* Required for pool_get_aligned */ -- cgit 1.2.3-korg