diff options
27 files changed, 90 insertions, 109 deletions
diff --git a/src/plugins/arping/arping_test.c b/src/plugins/arping/arping_test.c index 9001b7098a7..ac4349d20d2 100644 --- a/src/plugins/arping/arping_test.c +++ b/src/plugins/arping/arping_test.c @@ -26,12 +26,12 @@ #define __plugin_msg_base arping_test_main.msg_id_base #include <vlibapi/vat_helper_macros.h> +#include <vlibmemory/vlib.api_types.h> /* declare message IDs */ #include <vnet/format_fns.h> #include <arping/arping.api_enum.h> #include <arping/arping.api_types.h> -#include <vpp/api/vpe.api_types.h> #include <vnet/ip/ip_types_api.h> typedef struct diff --git a/src/plugins/geneve/geneve_test.c b/src/plugins/geneve/geneve_test.c index ad6d3296ef6..2eb3821173e 100644 --- a/src/plugins/geneve/geneve_test.c +++ b/src/plugins/geneve/geneve_test.c @@ -26,7 +26,7 @@ #include <vnet/format_fns.h> #include <geneve/geneve.api_enum.h> #include <geneve/geneve.api_types.h> -#include <vpp/api/vpe.api_types.h> +#include <vlibmemory/vlib.api_types.h> typedef struct { diff --git a/src/plugins/ikev2/ikev2_test.c b/src/plugins/ikev2/ikev2_test.c index b63778ed103..9f572813565 100644 --- a/src/plugins/ikev2/ikev2_test.c +++ b/src/plugins/ikev2/ikev2_test.c @@ -32,7 +32,7 @@ #include <vnet/format_fns.h> #include <ikev2/ikev2.api_enum.h> #include <ikev2/ikev2.api_types.h> -#include <vpp/api/vpe.api_types.h> +#include <vlibmemory/vlib.api_types.h> #define vl_endianfun /* define message structures */ #include <plugins/ikev2/ikev2.api.h> diff --git a/src/plugins/l2tp/l2tp_test.c b/src/plugins/l2tp/l2tp_test.c index 87abf5d0a2a..fef6121943b 100644 --- a/src/plugins/l2tp/l2tp_test.c +++ b/src/plugins/l2tp/l2tp_test.c @@ -26,7 +26,7 @@ /* define message IDs */ #include <l2tp/l2tp.api_enum.h> #include <l2tp/l2tp.api_types.h> -#include <vpp/api/vpe.api_types.h> +#include <vlibmemory/vlib.api_types.h> typedef struct { diff --git a/src/plugins/lacp/lacp_test.c b/src/plugins/lacp/lacp_test.c index 3a5e6351693..e5078520fd3 100644 --- a/src/plugins/lacp/lacp_test.c +++ b/src/plugins/lacp/lacp_test.c @@ -31,7 +31,7 @@ #include <vnet/format_fns.h> #include <lacp/lacp.api_enum.h> #include <lacp/lacp.api_types.h> -#include <vpp/api/vpe.api_types.h> +#include <vlibmemory/vlib.api_types.h> typedef struct { diff --git a/src/plugins/lisp/lisp-cp/lisp_cp_test.c b/src/plugins/lisp/lisp-cp/lisp_cp_test.c index c0284d301a7..0ab41802207 100644 --- a/src/plugins/lisp/lisp-cp/lisp_cp_test.c +++ b/src/plugins/lisp/lisp-cp/lisp_cp_test.c @@ -26,7 +26,7 @@ /* define message IDs */ #include <lisp/lisp-cp/lisp.api_enum.h> #include <lisp/lisp-cp/lisp.api_types.h> -#include <vpp/api/vpe.api_types.h> +#include <vlibmemory/vlib.api_types.h> typedef struct { diff --git a/src/plugins/lisp/lisp-cp/one_test.c b/src/plugins/lisp/lisp-cp/one_test.c index 6966122b2b5..7ca1f31e6dc 100644 --- a/src/plugins/lisp/lisp-cp/one_test.c +++ b/src/plugins/lisp/lisp-cp/one_test.c @@ -26,7 +26,7 @@ /* define message IDs */ #include <lisp/lisp-cp/one.api_enum.h> #include <lisp/lisp-cp/one.api_types.h> -#include <vpp/api/vpe.api_types.h> +#include <vlibmemory/vlib.api_types.h> typedef struct { diff --git a/src/plugins/lisp/lisp-gpe/lisp_gpe_test.c b/src/plugins/lisp/lisp-gpe/lisp_gpe_test.c index 54f7713162a..6f40e6458f0 100644 --- a/src/plugins/lisp/lisp-gpe/lisp_gpe_test.c +++ b/src/plugins/lisp/lisp-gpe/lisp_gpe_test.c @@ -26,7 +26,7 @@ /* define message IDs */ #include <lisp/lisp-gpe/lisp_gpe.api_enum.h> #include <lisp/lisp-gpe/lisp_gpe.api_types.h> -#include <vpp/api/vpe.api_types.h> +#include <vlibmemory/vlib.api_types.h> typedef struct { diff --git a/src/plugins/memif/memif_test.c b/src/plugins/memif/memif_test.c index 1ec6703d135..98c9354a95e 100644 --- a/src/plugins/memif/memif_test.c +++ b/src/plugins/memif/memif_test.c @@ -33,8 +33,7 @@ #include <vnet/format_fns.h> #include <memif/memif.api_enum.h> #include <memif/memif.api_types.h> -#include <vpp/api/vpe.api_types.h> -//#include <vnet/ethernet/ethernet_types.api_types.h> +#include <vlibmemory/vlib.api_types.h> typedef struct { diff --git a/src/plugins/stn/stn_test.c b/src/plugins/stn/stn_test.c index c7514cf77c5..2499ba7b6ec 100644 --- a/src/plugins/stn/stn_test.c +++ b/src/plugins/stn/stn_test.c @@ -23,9 +23,9 @@ #include <vlibapi/vat_helper_macros.h> /* Declare message IDs */ -#include <vpp/api/vpe.api_types.h> #include <stn/stn.api_enum.h> #include <stn/stn.api_types.h> +#include <vlibmemory/vlib.api_types.h> typedef struct { diff --git a/src/plugins/tracedump/graph_test.c b/src/plugins/tracedump/graph_test.c index 79e1df61c5f..37dfbcdcaa0 100644 --- a/src/plugins/tracedump/graph_test.c +++ b/src/plugins/tracedump/graph_test.c @@ -27,7 +27,7 @@ #include <vnet/format_fns.h> #include <tracedump/graph.api_enum.h> #include <tracedump/graph.api_types.h> -#include <vpp/api/vpe.api_types.h> +#include <vlibmemory/vlib.api_types.h> typedef struct { diff --git a/src/plugins/vmxnet3/vmxnet3_test.c b/src/plugins/vmxnet3/vmxnet3_test.c index 6fa9373486c..9b73c09d03c 100644 --- a/src/plugins/vmxnet3/vmxnet3_test.c +++ b/src/plugins/vmxnet3/vmxnet3_test.c @@ -34,7 +34,7 @@ /* declare message IDs */ #include <vmxnet3/vmxnet3.api_enum.h> #include <vmxnet3/vmxnet3.api_types.h> -#include <vpp/api/vpe.api_types.h> +#include <vlibmemory/vlib.api_types.h> typedef struct { diff --git a/src/plugins/vrrp/vrrp_test.c b/src/plugins/vrrp/vrrp_test.c index 199f5417f1a..194e6adfc42 100644 --- a/src/plugins/vrrp/vrrp_test.c +++ b/src/plugins/vrrp/vrrp_test.c @@ -19,8 +19,7 @@ uword unformat_sw_if_index (unformat_input_t * input, va_list * args); #include <vnet/format_fns.h> #include <vrrp/vrrp.api_enum.h> #include <vrrp/vrrp.api_types.h> -#include <vpp/api/vpe.api_types.h> - +#include <vlibmemory/vlib.api_types.h> typedef struct { diff --git a/src/tools/vppapigen/vppapigen_c.py b/src/tools/vppapigen/vppapigen_c.py index 2d526c151b7..db684adb06d 100644 --- a/src/tools/vppapigen/vppapigen_c.py +++ b/src/tools/vppapigen/vppapigen_c.py @@ -1682,8 +1682,8 @@ def generate_c_test2_boilerplate(services, defines, module, stream): #define vl_typedefs /* define message structures */ #include <vlibmemory/vl_memory_api_h.h> -#include <vpp/api/vpe_types.api.h> -#include <vpp/api/vpe.api.h> +#include <vlibmemory/vlib.api_types.h> +#include <vlibmemory/vlib.api.h> #undef vl_typedefs #include "{module}.api_enum.h" diff --git a/src/vat/api_format.c b/src/vat/api_format.c index 8f23d773d99..33e5a275551 100644 --- a/src/vat/api_format.c +++ b/src/vat/api_format.c @@ -620,49 +620,6 @@ static void vl_api_show_version_reply_t_handler_json #define vl_api_bridge_domain_details_t_endian vl_noop_handler #define vl_api_bridge_domain_details_t_print vl_noop_handler -static void vl_api_control_ping_reply_t_handler - (vl_api_control_ping_reply_t * mp) -{ - vat_main_t *vam = &vat_main; - i32 retval = ntohl (mp->retval); - if (vam->async_mode) - { - vam->async_errors += (retval < 0); - } - else - { - vam->retval = retval; - vam->result_ready = 1; - } - if (vam->socket_client_main) - vam->socket_client_main->control_pings_outstanding--; -} - -static void vl_api_control_ping_reply_t_handler_json - (vl_api_control_ping_reply_t * mp) -{ - vat_main_t *vam = &vat_main; - i32 retval = ntohl (mp->retval); - - if (VAT_JSON_NONE != vam->json_tree.type) - { - vat_json_print (vam->ofp, &vam->json_tree); - vat_json_free (&vam->json_tree); - vam->json_tree.type = VAT_JSON_NONE; - } - else - { - /* just print [] */ - vat_json_init_array (&vam->json_tree); - vat_json_print (vam->ofp, &vam->json_tree); - vam->json_tree.type = VAT_JSON_NONE; - } - - vam->retval = retval; - vam->result_ready = 1; -} - - static void vl_api_get_first_msg_id_reply_t_handler (vl_api_get_first_msg_id_reply_t * mp) { @@ -778,7 +735,6 @@ foreach_standard_reply_retval_handler; #define foreach_vpe_api_reply_msg \ _ (GET_FIRST_MSG_ID_REPLY, get_first_msg_id_reply) \ - _ (CONTROL_PING_REPLY, control_ping_reply) \ _ (SHOW_VERSION_REPLY, show_version_reply) \ #define foreach_standalone_reply_msg \ diff --git a/src/vat2/vat2_helpers.h b/src/vat2/vat2_helpers.h index 929c012485f..beb2a787659 100644 --- a/src/vat2/vat2_helpers.h +++ b/src/vat2/vat2_helpers.h @@ -16,9 +16,11 @@ #ifndef included_vat2_helpers_h #define included_vat2_helpers_h +#include <vlibmemory/vlib.api_types.h> + /* For control ping */ #define vl_endianfun -#include <vpp/api/vpe.api.h> +#include <vlibmemory/vlib.api.h> #undef vl_endianfun static inline void diff --git a/src/vlibmemory/vlib.api b/src/vlibmemory/vlib.api index 5e8ba47ba7d..c017fc7919a 100644 --- a/src/vlibmemory/vlib.api +++ b/src/vlibmemory/vlib.api @@ -243,6 +243,30 @@ define get_f64_increment_by_one_reply f64 f64_value; }; +/** \brief Control ping from client to api server request + @param client_index - opaque cookie to identify the sender + @param context - sender context, to match reply w/ request +*/ +define control_ping +{ + u32 client_index; + u32 context; +}; + +/** \brief Control ping from the client to the server response + @param client_index - opaque cookie to identify the sender + @param context - sender context, to match reply w/ request + @param retval - return code for the request + @param vpe_pid - the pid of the vpe, returned by the server +*/ +define control_ping_reply +{ + u32 context; + i32 retval; + u32 client_index; + u32 vpe_pid; +}; + /* * Local Variables: * eval: (c-set-style "gnu") diff --git a/src/vlibmemory/vlib_api.c b/src/vlibmemory/vlib_api.c index e5d77eb5bf6..0d9444619af 100644 --- a/src/vlibmemory/vlib_api.c +++ b/src/vlibmemory/vlib_api.c @@ -329,6 +329,16 @@ vl_api_get_f64_increment_by_one_t_handler ( })); } +static void +vl_api_control_ping_t_handler (vl_api_control_ping_t *mp) +{ + vl_api_control_ping_reply_t *rmp; + int rv = 0; + + REPLY_MACRO2 (VL_API_CONTROL_PING_REPLY, + ({ rmp->vpe_pid = ntohl (getpid ()); })); +} + #include <vlibmemory/vlib.api.c> static clib_error_t * vlib_apis_hookup (vlib_main_t *vm) @@ -341,6 +351,8 @@ vlib_apis_hookup (vlib_main_t *vm) msg_id_base = setup_message_id_table (); am->is_mp_safe[VL_API_GET_NODE_GRAPH] = 1; + am->is_mp_safe[VL_API_CONTROL_PING] = 1; + am->is_mp_safe[VL_API_CONTROL_PING_REPLY] = 1; return 0; } diff --git a/src/vlibmemory/vlibapi_test.c b/src/vlibmemory/vlibapi_test.c index 820096ab80d..c91cd7942f9 100644 --- a/src/vlibmemory/vlibapi_test.c +++ b/src/vlibmemory/vlibapi_test.c @@ -449,6 +449,31 @@ api_get_node_graph (vat_main_t *vam) return ret; } +static void +vl_api_control_ping_reply_t_handler (vl_api_control_ping_reply_t *mp) +{ + vat_main_t *vam = &vat_main; + i32 retval = ntohl (mp->retval); + if (vam->async_mode) + { + vam->async_errors += (retval < 0); + } + else + { + vam->retval = retval; + vam->result_ready = 1; + } + if (vam->socket_client_main) + vam->socket_client_main->control_pings_outstanding--; +} + +static int +api_control_ping (vat_main_t *vam) +{ + // not yet implemented + return -1; +} + #define VL_API_LOCAL_SETUP_MESSAGE_ID_TABLE local_setup_message_id_table static void local_setup_message_id_table (vat_main_t *vam) diff --git a/src/vnet/arp/arp_test.c b/src/vnet/arp/arp_test.c index b92fa06f9f6..9eaea91c709 100644 --- a/src/vnet/arp/arp_test.c +++ b/src/vnet/arp/arp_test.c @@ -43,7 +43,7 @@ uword unformat_sw_if_index (unformat_input_t * input, va_list * args); /* Declare message IDs */ #include <vnet/arp/arp.api_enum.h> #include <vnet/arp/arp.api_types.h> -#include <vpp/api/vpe.api_types.h> +#include <vlibmemory/vlib.api_types.h> static int api_proxy_arp_dump (vat_main_t * vam) diff --git a/src/vnet/ip/ip_test.c b/src/vnet/ip/ip_test.c index 81a84c12a3b..3ba38d3470e 100644 --- a/src/vnet/ip/ip_test.c +++ b/src/vnet/ip/ip_test.c @@ -30,6 +30,7 @@ #include <vnet/format_fns.h> #include <vnet/ip/ip.api_enum.h> #include <vnet/ip/ip.api_types.h> +#include <vlibmemory/vlib.api_types.h> #define vl_endianfun /* define message structures */ #include <vnet/ip/ip.api.h> diff --git a/src/vnet/ip6-nd/ip6_nd_test.c b/src/vnet/ip6-nd/ip6_nd_test.c index 99f869a5a1d..933029d7593 100644 --- a/src/vnet/ip6-nd/ip6_nd_test.c +++ b/src/vnet/ip6-nd/ip6_nd_test.c @@ -25,7 +25,7 @@ /* define message IDs */ #include <ip6-nd/ip6_nd.api_enum.h> #include <ip6-nd/ip6_nd.api_types.h> -#include <vpp/api/vpe.api_types.h> +#include <vlibmemory/vlib.api_types.h> typedef struct { diff --git a/src/vpp-api/client/test.c b/src/vpp-api/client/test.c index 9bfed996e1b..4e98dc03a14 100644 --- a/src/vpp-api/client/test.c +++ b/src/vpp-api/client/test.c @@ -37,6 +37,9 @@ #include "vppapiclient.h" #include "stat_client.h" +#include <vlibmemory/vlib.api_enum.h> +#include <vlibmemory/vlib.api_types.h> + #define vl_typedefs /* define message structures */ #include <vpp/api/vpe_all_api_h.h> #undef vl_typedefs diff --git a/src/vpp-api/vapi/vapi.c b/src/vpp-api/vapi/vapi.c index ec87e7b7b72..1bd8e5bdd9f 100644 --- a/src/vpp-api/vapi/vapi.c +++ b/src/vpp-api/vapi/vapi.c @@ -31,6 +31,7 @@ #include <vlibapi/api_common.h> #include <vlibmemory/memory_client.h> +#include <vapi/vlib.api.vapi.h> #include <vapi/memclnt.api.vapi.h> /* we need to use control pings for some stuff and because we're forced to put @@ -40,7 +41,7 @@ vapi_msg_id_t vapi_msg_id_control_ping = 0; vapi_msg_id_t vapi_msg_id_control_ping_reply = 0; DEFINE_VAPI_MSG_IDS_MEMCLNT_API_JSON; -DEFINE_VAPI_MSG_IDS_VPE_API_JSON; +DEFINE_VAPI_MSG_IDS_VLIB_API_JSON; struct { diff --git a/src/vpp-api/vapi/vapi_c_gen.py b/src/vpp-api/vapi/vapi_c_gen.py index f0a284ccbc1..eacfab41555 100755 --- a/src/vpp-api/vapi/vapi_c_gen.py +++ b/src/vpp-api/vapi/vapi_c_gen.py @@ -705,12 +705,12 @@ def gen_json_unified_header(parser, logger, j, io, name): print("#ifdef __cplusplus") print("extern \"C\" {") print("#endif") - if name == "vpe.api.vapi.h": + if name == "vlib.api.vapi.h": print("") print("static inline vapi_error_e vapi_send_with_control_ping " "(vapi_ctx_t ctx, void * msg, u32 context);") else: - print("#include <vapi/vpe.api.vapi.h>") + print("#include <vapi/vlib.api.vapi.h>") print("") for m in parser.messages_by_json[j].values(): print("extern vapi_msg_id_t %s;" % m.get_msg_id_name()) @@ -737,7 +737,7 @@ def gen_json_unified_header(parser, logger, j, io, name): print("") - if name == "vpe.api.vapi.h": + if name == "vlib.api.vapi.h": print("%s" % vapi_send_with_control_ping) print("") diff --git a/src/vpp/api/api.c b/src/vpp/api/api.c index 5477ec949ae..70dfd1f8271 100644 --- a/src/vpp/api/api.c +++ b/src/vpp/api/api.c @@ -77,7 +77,6 @@ #include <vlibapi/api_helper_macros.h> #define foreach_vpe_api_msg \ - _ (CONTROL_PING, control_ping) \ _ (SHOW_VERSION, show_version) \ _ (SHOW_VPE_SYSTEM_TIME, show_vpe_system_time) \ _ (LOG_DUMP, log_dump) @@ -116,20 +115,6 @@ memclnt_delete_callback (u32 client_index) VL_MSG_API_REAPER_FUNCTION (memclnt_delete_callback); static void -vl_api_control_ping_t_handler (vl_api_control_ping_t * mp) -{ - vl_api_control_ping_reply_t *rmp; - int rv = 0; - - /* *INDENT-OFF* */ - REPLY_MACRO2(VL_API_CONTROL_PING_REPLY, - ({ - rmp->vpe_pid = ntohl (getpid()); - })); - /* *INDENT-ON* */ -} - -static void vl_api_show_version_t_handler (vl_api_show_version_t * mp) { vl_api_show_version_reply_t *rmp; @@ -293,8 +278,6 @@ vpe_api_hookup (vlib_main_t * vm) /* * Thread-safe API messages */ - am->is_mp_safe[VL_API_CONTROL_PING] = 1; - am->is_mp_safe[VL_API_CONTROL_PING_REPLY] = 1; am->is_mp_safe[VL_API_IP_ROUTE_ADD_DEL] = 1; /* diff --git a/src/vpp/api/vpe.api b/src/vpp/api/vpe.api index 3c4c0214ad5..5976f3d99a9 100644 --- a/src/vpp/api/vpe.api +++ b/src/vpp/api/vpe.api @@ -53,30 +53,6 @@ import "vpp/api/vpe_types.api"; * flow APIs: see .../vnet/vnet/flow/{flow.api, flow_api.c} */ -/** \brief Control ping from client to api server request - @param client_index - opaque cookie to identify the sender - @param context - sender context, to match reply w/ request -*/ -define control_ping -{ - u32 client_index; - u32 context; -}; - -/** \brief Control ping from the client to the server response - @param client_index - opaque cookie to identify the sender - @param context - sender context, to match reply w/ request - @param retval - return code for the request - @param vpe_pid - the pid of the vpe, returned by the server -*/ -define control_ping_reply -{ - u32 context; - i32 retval; - u32 client_index; - u32 vpe_pid; -}; - /** \brief show version @param client_index - opaque cookie to identify the sender @param context - sender context, to match reply w/ request |