summaryrefslogtreecommitdiffstats
path: root/src/vlibmemory
AgeCommit message (Expand)AuthorFilesLines
2019-12-11vcl: separate binary api connections per thread workerFlorin Coras1-4/+27
2019-12-11api: Use vl_msg_push/pop_heapNathan Skrzypczak3-55/+26
2019-12-10api: pass api and client main to rx threadFlorin Coras2-1/+28
2019-12-10api: multiple connections per processDave Barach8-88/+105
2019-12-09api: fix sock reg passing on read eventFlorin Coras3-26/+24
2019-12-07vlib: use explicit types in apiOle Troan1-1/+1
2019-12-06api: avoid swapping vlib_rp before barrier syncFlorin Coras3-61/+46
2019-12-06api: fix free socket process argsFlorin Coras1-0/+1
2019-12-06api: multiple socket connections per single processFlorin Coras2-31/+164
2019-11-27misc: add address sanitizer heap instrumentationBenoît Ganne3-5/+27
2019-11-18api: configurable binary api client rx pthread fcnDave Barach2-19/+39
2019-11-07api: fix dead client scan heap issueNathan Skrzypczak1-0/+4
2019-10-25dhcp: fix crash on unicast renewal sendNeale Ranns1-0/+1
2019-10-09api: comment, simplify and fix api socket readVratko Polak1-48/+80
2019-10-08api: add bapi thread handle to api main structure.IJsbrand Wijnands1-1/+9
2019-10-02vlib: improve summary vector-rate statisticsDave Barach1-1/+1
2019-09-30api: fix use-after-freeBenoît Ganne1-3/+3
2019-09-16api: autogenerate api trace print/endianOle Troan1-1/+2
2019-09-04api: memclnt api use string type.Ole Troan1-6/+6
2019-08-27api: revert use string type for strings in memclnt.apiOle Troan6-35/+28
2019-08-27api: use string type for strings in memclnt.apiOle Troan6-28/+35
2019-08-20vppapigen: remove support for legacy typedefsPaul Vinciguerra1-1/+1
2019-08-08api: vppapitrace JSON/API trace converterOle Troan3-56/+38
2019-08-08api: api socket respect unix runtime directoryOle Troan2-20/+12
2019-08-02vppinfra: Expose function setting __os_thread_indexNathan Skrzypczak1-20/+1
2019-07-24api: Disable tracing of memclnt_keepalive messagesDave Barach1-6/+11
2019-07-16api: enable binary API event logging in vatDave Barach1-1/+22
2019-07-03api: remove garbage from sockclnt_create replyVratko Polak3-2/+25
2019-06-14api: add mp-safe/barrier-sync indication to elogsDave Barach1-0/+1
2019-06-12infra: fix minor memory leak in "api trace..."Dave Barach1-5/+8
2019-05-16init / exit function orderingDave Barach3-10/+7
2019-05-09bapi: separate init shm reply from fd exchangeFlorin Coras1-1/+17
2019-04-23API: Python and Unix domain socket improvementOle Troan2-4/+2
2019-04-16API: Handle pthread cond signal case where signal is missed.Ole Troan1-2/+2
2019-04-10API: Fix shared memory only action handlers.Ole Troan2-1/+1
2019-04-05make the output of "show api dump file <filename> compare-current" doxygen-fr...Andrew Yourtchenko1-5/+9
2019-04-05vlib: fix "foo_msg" and "foo_msg_reply" in API message table triggering the "...Andrew Yourtchenko1-2/+2
2019-03-21api trace: cli bug fixezkexma1-2/+2
2019-03-07vlibmemory: coverity woesSteven Luong1-1/+1
2019-02-26VPP-1574: minimize RPC barrier sync callsDave Barach1-3/+20
2019-02-21API: client does not set root permissions on shm segmentNeale Ranns1-4/+2
2019-02-05sock api: allow to start client with no rx_threadTomasz Kulasek4-4/+33
2019-01-23Initialize gc_mark_timestamp to zero to avoid garbage values.Brian Nesbitt1-0/+1
2019-01-05socket API: Use pool index instead of handle in sock_delete handlerOle Troan1-1/+1
2019-01-02Fixes for buliding for 32bit targets:David Johnson1-4/+4
2018-12-31binary api clients: wait for vpp to startDave Barach1-0/+29
2018-12-22bapi/vat: fix socket transport for vatFlorin Coras1-2/+9
2018-12-05bapi: add options to have vpp cleanup client registrationFlorin Coras4-20/+28
2018-12-03vcl: handle worker process exitFlorin Coras2-7/+15
2018-12-01Delete shared memory segment files when vpp startsDave Barach1-0/+22
>); vlib_buffer_advance (b0, -adj0->rewrite_header.data_bytes); vnet_rewrite_one_header (adj0[0], ip0, sizeof (ethernet_header_t)); vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next, n_left_to_next, bi0, 0); } vlib_put_next_frame (vm, node, next_index, n_left_to_next); } return frame->n_vectors; } always_inline uword punt_test_pg0_ip4 (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { return (punt_test_fwd (vm, node, frame, FIB_PROTOCOL_IP4, SW_IF_INDEX_PG0)); } always_inline uword punt_test_pg1_ip4 (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { return (punt_test_fwd (vm, node, frame, FIB_PROTOCOL_IP4, SW_IF_INDEX_PG1)); } always_inline uword punt_test_pg0_ip6 (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { return (punt_test_fwd (vm, node, frame, FIB_PROTOCOL_IP6, SW_IF_INDEX_PG0)); } always_inline uword punt_test_pg1_ip6 (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { return (punt_test_fwd (vm, node, frame, FIB_PROTOCOL_IP6, SW_IF_INDEX_PG1)); } /* *INDENT-OFF* */ VLIB_REGISTER_NODE (punt_test_pg0_ip4_node) = { .function = punt_test_pg0_ip4, .name = "punt-test-pg0-ip4", .vector_size = sizeof (u32), .format_trace = format_punt_trace, }; VLIB_REGISTER_NODE (punt_test_pg1_ip4_node) = { .function = punt_test_pg1_ip4, .name = "punt-test-pg1-ip4", .vector_size = sizeof (u32), .format_trace = format_punt_trace, }; VLIB_REGISTER_NODE (punt_test_pg0_ip6_node) = { .function = punt_test_pg0_ip6, .name = "punt-test-pg0-ip6", .vector_size = sizeof (u32), .format_trace = format_punt_trace, }; VLIB_REGISTER_NODE (punt_test_pg1_ip6_node) = { .function = punt_test_pg1_ip6, .name = "punt-test-pg1-ip6", .vector_size = sizeof (u32), .format_trace = format_punt_trace, }; /* *INDENT-ON* */ typedef struct punt_feat_trace_t_ { vlib_punt_reason_t pt_reason; } punt_feat_trace_t; always_inline uword punt_test_feat_inline (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame, u8 is_ip4) { u32 n_left_from, *from, *to_next, next_index; from = vlib_frame_vector_args (frame); n_left_from = frame->n_vectors; next_index = node->cached_next_index; while (n_left_from > 0) { u32 n_left_to_next; vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next); while (n_left_from > 0 && n_left_to_next > 0) { vlib_buffer_t *b0; u32 bi0, next0; bi0 = to_next[0] = from[0]; from += 1; to_next += 1; n_left_to_next -= 1; n_left_from -= 1; next0 = 0; b0 = vlib_get_buffer (vm, bi0); if (is_ip4) b0->punt_reason = punt_reason_v4; else b0->punt_reason = punt_reason_v6; if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED)) { punt_feat_trace_t *t; b0 = vlib_get_buffer (vm, bi0); t = vlib_add_trace (vm, node, b0, sizeof (*t)); t->pt_reason = b0->punt_reason; } vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next, n_left_to_next, bi0, next0); } vlib_put_next_frame (vm, node, next_index, n_left_to_next); } return frame->n_vectors; } static u8 * format_punt_feat_trace (u8 * s, va_list * args) { CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *); CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *); punt_feat_trace_t *t = va_arg (*args, punt_feat_trace_t *); s = format (s, "reason: %U", format_vlib_punt_reason, t->pt_reason); return s; } always_inline uword punt_test_feat_ip4 (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { return (punt_test_feat_inline (vm, node, frame, 1)); } always_inline uword punt_test_feat_ip6 (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { return (punt_test_feat_inline (vm, node, frame, 0)); } /* *INDENT-OFF* */ VLIB_REGISTER_NODE (punt_test_feat_ip6_node) = { .function = punt_test_feat_ip6, .name = "punt-test-feat-ip6", .vector_size = sizeof (u32), .format_trace = format_punt_feat_trace, .n_next_nodes = 1, .next_nodes = { [0] = "punt-dispatch" } }; VLIB_REGISTER_NODE (punt_test_feat_ip4_node) = { .function = punt_test_feat_ip4, .name = "punt-test-feat-ip4", .vector_size = sizeof (u32), .format_trace = format_punt_feat_trace, .n_next_nodes = 1, .next_nodes = { [0] = "punt-dispatch" } }; VNET_FEATURE_INIT (punt_test_feat_ip6_feature, static) = { .arc_name = "ip6-unicast", .node_name = "punt-test-feat-ip6", }; VNET_FEATURE_INIT (punt_test_feat_ip4_feature, static) = { .arc_name = "ip4-unicast", .node_name = "punt-test-feat-ip4", }; /* *INDENT-ON* */ static clib_error_t * punt_test (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd_arg) { ip46_address_t ip46 = ip46_address_initializer; fib_protocol_t fproto; vnet_main_t *vnm; u32 sw_if_index; int rc; vnm = vnet_get_main (); fproto = FIB_PROTOCOL_IP4; if (unformat (input, "%U", unformat_vnet_sw_interface, vnm, &sw_if_index)) { vlib_node_t *from; if (unformat (input, "%U", unformat_ip4_address, &ip46.ip4)) { fproto = FIB_PROTOCOL_IP4; } else if (unformat (input, "%U", unformat_ip6_address, &ip46.ip6)) { fproto = FIB_PROTOCOL_IP6; } else if (unformat (input, "clear")) { vnet_feature_enable_disable ("ip4-unicast", "punt-test-feat-ip4", sw_if_index, 0, NULL, 0); vnet_feature_enable_disable ("ip6-unicast", "punt-test-feat-ip6", sw_if_index, 0, NULL, 0); return NULL; } else { /* * allocate a client and a reason */ punt_hdl = vlib_punt_client_register ("test"); rc = vlib_punt_reason_alloc (punt_hdl, "reason-v4", &punt_reason_v4); rc |= vlib_punt_reason_alloc (punt_hdl, "reason-v6", &punt_reason_v6); ASSERT (!rc); vnet_feature_enable_disable ("ip4-unicast", "punt-test-feat-ip4", sw_if_index, 1, NULL, 0); vnet_feature_enable_disable ("ip6-unicast", "punt-test-feat-ip6", sw_if_index, 1, NULL, 0); return NULL; } if (SW_IF_INDEX_PG0 == sw_if_index) { if (FIB_PROTOCOL_IP4 == fproto) { /* * register the node that will forward the punted packet */ vlib_punt_register (punt_hdl, punt_reason_v4, "punt-test-pg0-ip4"); from = vlib_get_node_by_name (vm, (u8 *) "punt-test-pg0-ip4"); } else { vlib_punt_register (punt_hdl, punt_reason_v6, "punt-test-pg0-ip6"); from = vlib_get_node_by_name (vm, (u8 *) "punt-test-pg0-ip6"); } } else { if (FIB_PROTOCOL_IP4 == fproto) { vlib_punt_register (punt_hdl, punt_reason_v4, "punt-test-pg1-ip4"); from = vlib_get_node_by_name (vm, (u8 *) "punt-test-pg1-ip4"); } else { vlib_punt_register (punt_hdl, punt_reason_v6, "punt-test-pg1-ip6"); from = vlib_get_node_by_name (vm, (u8 *) "punt-test-pg1-ip6"); } } vlib_node_add_next (vm, from->index, vnet_tx_node_index_for_sw_interface (vnm, sw_if_index)); vec_validate (adjs[fproto], sw_if_index); adjs[fproto][sw_if_index] = adj_nbr_find (fproto, fib_proto_to_link (fproto), &ip46, sw_if_index); } return (NULL); } /* *INDENT-OFF* */ VLIB_CLI_COMMAND (test_fib_command, static) = { .path = "test punt", .short_help = "punt unit tests - DO NOT RUN ON A LIVE SYSTEM", .function = punt_test, }; /* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */