FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
memory_client.h
Go to the documentation of this file.
1 /*
2  *------------------------------------------------------------------
3  * Copyright (c) 2018 Cisco and/or its affiliates.
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *------------------------------------------------------------------
16  */
17 
18 #ifndef SRC_VLIBMEMORY_MEMORY_CLIENT_H_
19 #define SRC_VLIBMEMORY_MEMORY_CLIENT_H_
20 
22 #include <setjmp.h>
23 
24 /*
25  * Exported so folks can code a working custom rx_pthread function
26  */
27 typedef struct
28 {
32  pthread_t rx_thread_handle;
33  /* Plugin message base lookup scheme */
37 
40 
41 int vl_client_connect (const char *name, int ctx_quota, int input_queue_size);
42 void vl_client_send_disconnect (u8 do_cleanup);
43 int vl_client_disconnect (void);
44 int vl_client_api_map (const char *region_name);
45 void vl_client_api_unmap (void);
48 int vl_client_connect_to_vlib (const char *svm_name, const char *client_name,
49  int rx_queue_size);
50 int vl_client_connect_to_vlib_thread_fn (const char *svm_name,
51  const char *client_name,
52  int rx_queue_size,
53  void *(*)(void *), void *);
54 int vl_client_connect_to_vlib_no_rx_pthread (const char *svm_name,
55  const char *client_name,
56  int rx_queue_size);
57 int vl_client_connect_to_vlib_no_map (const char *svm_name,
58  const char *client_name,
59  int rx_queue_size);
60 int vl_client_connect_to_vlib_no_rx_pthread_no_map (const char *svm_name,
61  const char *client_name,
62  int rx_queue_size);
65 
68 {
70  return my_memory_client_main;
71 }
72 
73 always_inline void
75 {
77 }
78 
79 #endif /* SRC_VLIBMEMORY_MEMORY_CLIENT_H_ */
80 
81 /*
82  * fd.io coding-style-patch-verification: ON
83  *
84  * Local Variables:
85  * eval: (c-set-style "gnu")
86  * End:
87  */
vlibapi_set_memory_client_main
static void vlibapi_set_memory_client_main(memory_client_main_t *mm)
Definition: memory_client.h:74
vl_client_connect
int vl_client_connect(const char *name, int ctx_quota, int input_queue_size)
Definition: memory_client.c:161
memory_client_main_t::rx_thread_jmpbuf
jmp_buf rx_thread_jmpbuf
Definition: memory_client.h:31
name
string name[64]
Definition: fib.api:25
u16
unsigned short u16
Definition: types.h:57
vl_client_api_map
int vl_client_api_map(const char *region_name)
Definition: memory_client.c:378
vl_client_disconnect
int vl_client_disconnect(void)
Definition: memory_client.c:286
memory_client_main_t
Definition: memory_client.h:27
vl_client_send_disconnect
void vl_client_send_disconnect(u8 do_cleanup)
Definition: memory_client.c:265
memory_client_main
memory_client_main_t memory_client_main
Definition: memory_client.c:48
vlibapi_get_memory_client_main
static memory_client_main_t * vlibapi_get_memory_client_main(void)
Definition: memory_client.h:67
vl_client_install_client_message_handlers
void vl_client_install_client_message_handlers(void)
Definition: memory_client.c:363
vl_mem_client_is_connected
u8 vl_mem_client_is_connected(void)
Definition: memory_client.c:396
vl_client_disconnect_from_vlib_no_unmap
void vl_client_disconnect_from_vlib_no_unmap(void)
Definition: memory_client.c:536
memory_client_main_t::rx_thread_jmpbuf_valid
u8 rx_thread_jmpbuf_valid
Definition: memory_client.h:29
memory_client_main_t::first_msg_id_reply
u16 first_msg_id_reply
Definition: memory_client.h:35
always_inline
#define always_inline
Definition: rdma_mlx5dv.h:23
vl_client_disconnect_from_vlib
void vl_client_disconnect_from_vlib(void)
Definition: memory_client.c:530
ASSERT
#define ASSERT(truth)
Definition: error_bootstrap.h:69
memory_shared.h
vl_client_connect_to_vlib_no_rx_pthread
int vl_client_connect_to_vlib_no_rx_pthread(const char *svm_name, const char *client_name, int rx_queue_size)
Definition: memory_client.c:464
memory_client_main_t::first_msg_id_reply_ready
volatile u8 first_msg_id_reply_ready
Definition: memory_client.h:34
memory_client_main_t::rx_thread_handle
pthread_t rx_thread_handle
Definition: memory_client.h:32
u8
unsigned char u8
Definition: types.h:56
my_memory_client_main
__thread memory_client_main_t * my_memory_client_main
Definition: memory_client.c:49
vl_client_connect_to_vlib_no_rx_pthread_no_map
int vl_client_connect_to_vlib_no_rx_pthread_no_map(const char *svm_name, const char *client_name, int rx_queue_size)
Definition: memory_client.c:484
vl_client_connect_to_vlib
int vl_client_connect_to_vlib(const char *svm_name, const char *client_name, int rx_queue_size)
Definition: memory_client.c:455
vl_client_connect_to_vlib_no_map
int vl_client_connect_to_vlib_no_map(const char *svm_name, const char *client_name, int rx_queue_size)
Definition: memory_client.c:475
vl_client_connect_to_vlib_thread_fn
int vl_client_connect_to_vlib_thread_fn(const char *svm_name, const char *client_name, int rx_queue_size, void *(*)(void *), void *)
vl_client_api_unmap
void vl_client_api_unmap(void)
Definition: memory_client.c:390
memory_client_main_t::connected_to_vlib
u8 connected_to_vlib
Definition: memory_client.h:30