aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec
diff options
context:
space:
mode:
authorYulong Pei <yulong.pei@intel.com>2020-08-14 18:21:08 +0800
committerMatthew Smith <mgsmith@netgate.com>2020-09-02 13:09:10 +0000
commit2e84d665542cba52461a5abcac4e05b050ffe4ff (patch)
treec69fafc5d3fc326c376471b16f3cc98cbed7853e /src/vnet/ipsec
parent7d4a997ea1fa93c305873ee1156765adc062cb27 (diff)
ipsec: add ipsec set async mode api
Type: improvement Signed-off-by: Yulong Pei <yulong.pei@intel.com> Change-Id: I841f4407ed8c1a448e5102059fc79ae1f7d461de
Diffstat (limited to 'src/vnet/ipsec')
-rw-r--r--src/vnet/ipsec/ipsec.api12
-rw-r--r--src/vnet/ipsec/ipsec_api.c15
2 files changed, 26 insertions, 1 deletions
diff --git a/src/vnet/ipsec/ipsec.api b/src/vnet/ipsec/ipsec.api
index 16d210f69b9..52a16ede1aa 100644
--- a/src/vnet/ipsec/ipsec.api
+++ b/src/vnet/ipsec/ipsec.api
@@ -535,6 +535,18 @@ autoreply define ipsec_select_backend {
u8 index;
};
+
+/** \brief IPsec Set Async mode
+ @param client_index - opaque cookie to identify the sender
+ @param context - sender context, to match reply w/ request
+ @param async_enable - ipsec async mode on or off
+*/
+autoreply define ipsec_set_async_mode {
+ u32 client_index;
+ u32 context;
+ bool async_enable;
+};
+
/*
* Local Variables:
* eval: (c-set-style "gnu")
diff --git a/src/vnet/ipsec/ipsec_api.c b/src/vnet/ipsec/ipsec_api.c
index 667d9b2fd11..f623cced0c7 100644
--- a/src/vnet/ipsec/ipsec_api.c
+++ b/src/vnet/ipsec/ipsec_api.c
@@ -71,7 +71,8 @@ _(IPSEC_SELECT_BACKEND, ipsec_select_backend) \
_(IPSEC_BACKEND_DUMP, ipsec_backend_dump) \
_(IPSEC_TUNNEL_PROTECT_UPDATE, ipsec_tunnel_protect_update) \
_(IPSEC_TUNNEL_PROTECT_DEL, ipsec_tunnel_protect_del) \
-_(IPSEC_TUNNEL_PROTECT_DUMP, ipsec_tunnel_protect_dump)
+_(IPSEC_TUNNEL_PROTECT_DUMP, ipsec_tunnel_protect_dump) \
+_(IPSEC_SET_ASYNC_MODE, ipsec_set_async_mode)
static void
vl_api_ipsec_spd_add_del_t_handler (vl_api_ipsec_spd_add_del_t * mp)
@@ -1012,6 +1013,18 @@ done:
REPLY_MACRO (VL_API_IPSEC_SELECT_BACKEND_REPLY);
}
+static void
+vl_api_ipsec_set_async_mode_t_handler (vl_api_ipsec_set_async_mode_t * mp)
+{
+ vl_api_ipsec_set_async_mode_reply_t *rmp;
+ int rv = 0;
+
+ vnet_crypto_request_async_mode (mp->async_enable);
+ ipsec_set_async_mode (mp->async_enable);
+
+ REPLY_MACRO (VL_API_IPSEC_SET_ASYNC_MODE_REPLY);
+}
+
/*
* ipsec_api_hookup
* Add vpe's API message handlers to the table.