aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/ipsec_if.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2019-03-26 13:16:42 +0100
committerDamjan Marion <dmarion@me.com>2019-03-27 12:40:18 +0000
commitd709cbcb1ef80633af657c5427608831e5bbd919 (patch)
treecb389257174014b546e32cb3a6ab15df781703d8 /src/vnet/ipsec/ipsec_if.c
parentfbf278adc2fa5ffd1671fb9f91eb03d6d0dc5a9e (diff)
ipsec: compress ipsec_sa_t so data used by dataplane code fits in cacheline
Change-Id: I81ecdf9fdcfcb017117b47dc031f93208e004d7c Signed-off-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ipsec/ipsec_if.c')
-rw-r--r--src/vnet/ipsec/ipsec_if.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/vnet/ipsec/ipsec_if.c b/src/vnet/ipsec/ipsec_if.c
index bf3460423fb..b1c05346dd0 100644
--- a/src/vnet/ipsec/ipsec_if.c
+++ b/src/vnet/ipsec/ipsec_if.c
@@ -466,7 +466,7 @@ ipsec_add_del_ipsec_gre_tunnel (vnet_main_t * vnm,
osa = p[0];
sa = pool_elt_at_index (im->sad, p[0]);
- if (sa->is_tunnel)
+ if (ipsec_sa_is_set_IS_TUNNEL (sa))
{
key.remote_ip = sa->tunnel_dst_addr.ip4.as_u32;
key.spi = clib_host_to_net_u32 (sa->spi);
@@ -599,13 +599,14 @@ ipsec_set_interface_sa (vnet_main_t * vnm, u32 hw_if_index, u32 sa_id,
old_sa_index = t->input_sa_index;
old_sa = pool_elt_at_index (im->sad, old_sa_index);
- if (sa->is_tunnel_ip6 ^ old_sa->is_tunnel_ip6)
+ if (ipsec_sa_is_set_IS_TUNNEL_V6 (sa) ^
+ ipsec_sa_is_set_IS_TUNNEL_V6 (old_sa))
{
clib_warning ("IPsec interface SA endpoints type can't be changed");
return VNET_API_ERROR_INVALID_VALUE;
}
- if (sa->is_tunnel_ip6)
+ if (ipsec_sa_is_set_IS_TUNNEL_V6 (sa))
{
ipsec6_tunnel_key_t key;
@@ -651,7 +652,8 @@ ipsec_set_interface_sa (vnet_main_t * vnm, u32 hw_if_index, u32 sa_id,
old_sa_index = t->output_sa_index;
old_sa = pool_elt_at_index (im->sad, old_sa_index);
- if (sa->is_tunnel_ip6 ^ old_sa->is_tunnel_ip6)
+ if (ipsec_sa_is_set_IS_TUNNEL_V6 (sa) ^
+ ipsec_sa_is_set_IS_TUNNEL_V6 (old_sa))
{
clib_warning ("IPsec interface SA endpoints type can't be changed");
return VNET_API_ERROR_INVALID_VALUE;