X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fvxlan-gbp%2Fvxlan_gbp.h;h=c422d54af4c15f2f15c6825efaa23f2c45bb57d8;hb=07bbaef593939e9d03ba131e03296587472514ce;hp=6dc62256a414f164bdbb1f0028e888d0b703dbd1;hpb=8da9fc659badc016e409f772673002f021c0cc4a;p=vpp.git diff --git a/src/vnet/vxlan-gbp/vxlan_gbp.h b/src/vnet/vxlan-gbp/vxlan_gbp.h index 6dc62256a41..c422d54af4c 100644 --- a/src/vnet/vxlan-gbp/vxlan_gbp.h +++ b/src/vnet/vxlan-gbp/vxlan_gbp.h @@ -127,12 +127,13 @@ typedef struct u32 dev_instance; /* Real device instance in tunnel vector */ u32 user_instance; /* Instance name being shown to user */ - vnet_declare_rewrite (VLIB_BUFFER_PRE_DATA_SIZE); + + VNET_DECLARE_REWRITE; } vxlan_gbp_tunnel_t; #define foreach_vxlan_gbp_input_next \ _(DROP, "error-drop") \ - _(NO_TUNNEL, "error-punt") \ + _(PUNT, "punt-dispatch") \ _(L2_INPUT, "l2-input") \ _(IP4_INPUT, "ip4-input") \ _(IP6_INPUT, "ip6-input") @@ -189,6 +190,11 @@ typedef struct /* Record used instances */ uword *instance_used; + + /** + * Punt reasons for no such tunnel + */ + vlib_punt_reason_t punt_no_such_tunnel[FIB_PROTOCOL_IP_MAX]; } vxlan_gbp_main_t; extern vxlan_gbp_main_t vxlan_gbp_main; @@ -221,6 +227,17 @@ int vnet_vxlan_gbp_tunnel_del (u32 sw_if_indexp); void vnet_int_vxlan_gbp_bypass_mode (u32 sw_if_index, u8 is_ip6, u8 is_enable); +always_inline u32 +vxlan_gbp_tunnel_by_sw_if_index (u32 sw_if_index) +{ + vxlan_gbp_main_t *vxm = &vxlan_gbp_main; + + if (sw_if_index >= vec_len (vxm->tunnel_index_by_sw_if_index)) + return ~0; + + return (vxm->tunnel_index_by_sw_if_index[sw_if_index]); +} + #endif /* included_vnet_vxlan_gbp_h */ /*