aboutsummaryrefslogtreecommitdiffstats
path: root/src/vat
AgeCommit message (Expand)AuthorFilesLines
2018-12-14String type: Fix off by one errorOle Troan1-1/+1
2018-12-13API: Use string type instead of u8.Ole Troan1-13/+33
2018-12-11Fix vat dependenciesjuraj.linkes1-0/+2
2018-12-07VPP-1506: dump local punts and registered punt socketsPavel Kotucek1-9/+9
2018-12-04MPLS: buffer over-run with incorrectly init'd vector. fix VAT dumpNeale Ranns1-2/+2
2018-11-12IPv6: Make link-local configurable per-interface (VPP-1446)Juraj Sloboda1-54/+0
2018-11-06BD ARP entry use common API typesNeale Ranns1-15/+9
2018-11-05Genric API types format/unformat support for VAT and custom dumpNeale Ranns3-0/+13
2018-10-23c11 safe string handling supportDave Barach5-51/+51
2018-10-17fix ip6 prefix check for tap_v2Michal Cmarada1-1/+1
2018-10-04Fix handling of mpls_tunnel_add_del APIJohn Lo1-14/+41
2018-10-01vat: fix coverity warning for show_threadsMohsin Kazmi1-3/+7
2018-10-01thread: Add show threads apiMohsin Kazmi1-0/+72
2018-09-29vom: Fix the l2 port type in bridge domainMohsin Kazmi1-4/+5
2018-09-27Trivial: Cleanup some typos.Paul Vinciguerra1-3/+3
2018-09-26MPLS tunnel dump: use sw_if_index not tunnel_indexNeale Ranns1-8/+5
2018-09-26itf: dump interface rx-placementMohsin Kazmi1-0/+79
2018-09-25L2 BD: introduce a BD interface on which to send UU packetsNeale Ranns1-10/+14
2018-09-21Add more CLI options to vpp_api_test for calling ip_add_del_routeJohn Lo1-2/+14
2018-09-20Route counters in the stats segmentNeale Ranns1-4/+4
2018-09-20vhost-user: Add disable feature support in apiMohsin Kazmi1-0/+10
2018-09-14Ehnance and fix vpp_api_test and custom_dump to support SR-MPLSJohn Lo1-25/+176
2018-09-11vat: remove the endiness for u8Mohsin Kazmi1-1/+1
2018-09-10cmake: put vpp_api_test back to packagingDamjan Marion1-1/+1
2018-09-07cmake: set packaging component for different filesDamjan Marion1-3/+7
2018-08-30Fix array bound failure in api_sr_localsid_add_delLijian Zhang1-2/+2
2018-08-26cmake: add add_vpp_library and add_vpp_executable macrosDamjan Marion1-25/+23
2018-08-24rx-placement: Add API call for interface rx-placementMohsin Kazmi1-0/+55
2018-08-23CMake: Add Cmake support for VatMohsin Kazmi1-0/+63
2018-08-17l2: arp termination dumpMohsin Kazmi1-0/+96
2018-08-09Fix "Old Style VLA" build warningsJuraj Sloboda1-0/+2
2018-07-31Fix undefined symbol: fformat_append_cr in vat plugins loadingYi He1-11/+0
2018-07-18Add config option to use dlmalloc instead of mheapDave Barach1-9/+1
2018-07-13VPP-1338: fix ipsec api coverity warningsDave Barach1-8/+4
2018-07-10FIB path dump: fix next-hop-table ID for recursive routesNeale Ranns1-4/+6
2018-06-25MAP: Move MAP-E/T to a plugin.Ole Troan1-373/+0
2018-06-19Fixed bugs in SRv6 APIPablo Camarillo1-4/+12
2018-06-15STATS: Separate socket for fd exchange.Ole Troan1-90/+2
2018-06-13Stat segment / client: show run" works nowDave Barach2-10/+11
2018-06-13vxlan:offload RX floweyal bari1-5/+106
2018-06-11MTU: Software interface / Per-protocol MTU supportOle Troan1-6/+6
2018-06-08export counters in a memfd segmentDave Barach2-2/+170
2018-06-07DHCP Client DumpNeale Ranns1-9/+10
2018-05-31Improve L2FIB delete entry handling and "show l2fib" CLI optionsJohn Lo1-2/+2
2018-05-30vppinfra: explicitely state for signed types that they are signedDamjan Marion1-1/+1
2018-05-30Fix clang compilation on aarch64: sizeof operator error.Sirshak Das1-1/+1
2018-05-29af_packet: Add support for dump interfacesMohsin Kazmi1-0/+49
2018-05-25ARP proxy dumpsNeale Ranns1-3/+3
2018-05-11Periodic scan and probe of IP neighbors to maintain neighbor poolsJohn Lo1-0/+77
2018-05-10Remove the historical memfd api segment bootstrapDave Barach1-164/+30
ass="n">u32 bi, memif_ring_t * ring, u16 * head, u16 mask) { vlib_buffer_t *b0; void *mb0; u32 total = 0, len; mb0 = memif_get_buffer (mif, ring, *head); ring->desc[*head].flags = 0; do { b0 = vlib_get_buffer (vm, bi); len = b0->current_length; if (PREDICT_FALSE (ring->desc[*head].buffer_length < (total + len))) { if (PREDICT_TRUE (total)) { ring->desc[*head].length = total; total = 0; ring->desc[*head].flags |= MEMIF_DESC_FLAG_NEXT; *head = (*head + 1) & mask; mb0 = memif_get_buffer (mif, ring, *head); ring->desc[*head].flags = 0; } } if (PREDICT_TRUE (ring->desc[*head].buffer_length >= (total + len))) { clib_memcpy (mb0 + total, vlib_buffer_get_current (b0), CLIB_CACHE_LINE_BYTES); if (len > CLIB_CACHE_LINE_BYTES) clib_memcpy (mb0 + CLIB_CACHE_LINE_BYTES + total, vlib_buffer_get_current (b0) + CLIB_CACHE_LINE_BYTES, len - CLIB_CACHE_LINE_BYTES); total += len; } else { vlib_error_count (vm, node->node_index, MEMIF_TX_ERROR_TRUNC_PACKET, 1); break; } } while ((bi = (b0->flags & VLIB_BUFFER_NEXT_PRESENT) ? b0->next_buffer : 0)); if (PREDICT_TRUE (total)) { ring->desc[*head].length = total; *head = (*head + 1) & mask; } } static_always_inline uword memif_interface_tx_inline (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame, memif_if_t * mif, memif_ring_type_t type) { u8 qid; memif_ring_t *ring; u32 *buffers = vlib_frame_args (frame); u32 n_left = frame->n_vectors; u16 ring_size, mask; u16 head, tail; u16 free_slots; u32 thread_index = vlib_get_thread_index (); u8 tx_queues = vec_len (mif->tx_queues); memif_queue_t *mq; if (PREDICT_FALSE (tx_queues == 0)) { vlib_error_count (vm, node->node_index, MEMIF_TX_ERROR_NO_TX_QUEUES, n_left); goto error; } if (tx_queues < vec_len (vlib_mains)) { qid = thread_index % tx_queues; clib_spinlock_lock_if_init (&mif->lockp); } else { qid = thread_index; } mq = vec_elt_at_index (mif->tx_queues, qid); ring = mq->ring; ring_size = 1 << mq->log2_ring_size; mask = ring_size - 1; /* free consumed buffers */ head = ring->head; tail = ring->tail; if (tail > head) free_slots = tail - head; else free_slots = ring_size - head + tail; while (n_left > 5 && free_slots > 1) { if (PREDICT_TRUE (head + 5 < ring_size)) { CLIB_PREFETCH (memif_get_buffer (mif, ring, head + 2), CLIB_CACHE_LINE_BYTES, STORE); CLIB_PREFETCH (memif_get_buffer (mif, ring, head + 3), CLIB_CACHE_LINE_BYTES, STORE); CLIB_PREFETCH (&ring->desc[head + 4], CLIB_CACHE_LINE_BYTES, STORE); CLIB_PREFETCH (&ring->desc[head + 5], CLIB_CACHE_LINE_BYTES, STORE); } else { CLIB_PREFETCH (memif_get_buffer (mif, ring, (head + 2) % mask), CLIB_CACHE_LINE_BYTES, STORE); CLIB_PREFETCH (memif_get_buffer (mif, ring, (head + 3) % mask), CLIB_CACHE_LINE_BYTES, STORE); CLIB_PREFETCH (&ring->desc[(head + 4) % mask], CLIB_CACHE_LINE_BYTES, STORE); CLIB_PREFETCH (&ring->desc[(head + 5) % mask], CLIB_CACHE_LINE_BYTES, STORE); } memif_prefetch_buffer_and_data (vm, buffers[2]); memif_prefetch_buffer_and_data (vm, buffers[3]); memif_copy_buffer_to_tx_ring (vm, node, mif, buffers[0], ring, &head, mask); memif_copy_buffer_to_tx_ring (vm, node, mif, buffers[1], ring, &head, mask); buffers += 2; n_left -= 2; free_slots -= 2; } while (n_left && free_slots) { memif_copy_buffer_to_tx_ring (vm, node, mif, buffers[0], ring, &head, mask); buffers++; n_left--; free_slots--; } CLIB_MEMORY_STORE_BARRIER (); ring->head = head; clib_spinlock_unlock_if_init (&mif->lockp); if (n_left) { vlib_error_count (vm, node->node_index, MEMIF_TX_ERROR_NO_FREE_SLOTS, n_left); } if ((ring->flags & MEMIF_RING_FLAG_MASK_INT) == 0 && mq->int_fd > -1) { u64 b = 1; CLIB_UNUSED (int r) = write (mq->int_fd, &b, sizeof (b)); mq->int_count++; } error: vlib_buffer_free (vm, vlib_frame_args (frame), frame->n_vectors); return frame->n_vectors; } static uword memif_interface_tx (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { memif_main_t *nm = &memif_main; vnet_interface_output_runtime_t *rund = (void *) node->runtime_data; memif_if_t *mif = pool_elt_at_index (nm->interfaces, rund->dev_instance); if (mif->flags & MEMIF_IF_FLAG_IS_SLAVE) return memif_interface_tx_inline (vm, node, frame, mif, MEMIF_RING_S2M); else return memif_interface_tx_inline (vm, node, frame, mif, MEMIF_RING_M2S); } static void memif_set_interface_next_node (vnet_main_t * vnm, u32 hw_if_index, u32 node_index) { memif_main_t *apm = &memif_main; vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index); memif_if_t *mif = pool_elt_at_index (apm->interfaces, hw->dev_instance); /* Shut off redirection */ if (node_index == ~0) { mif->per_interface_next_index = node_index; return; } mif->per_interface_next_index = vlib_node_add_next (vlib_get_main (), memif_input_node.index, node_index); } static void memif_clear_hw_interface_counters (u32 instance) { /* Nothing for now */ } static clib_error_t * memif_interface_rx_mode_change (vnet_main_t * vnm, u32 hw_if_index, u32 qid, vnet_hw_interface_rx_mode mode) { memif_main_t *mm = &memif_main; vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index); memif_if_t *mif = pool_elt_at_index (mm->interfaces, hw->dev_instance); memif_queue_t *mq = vec_elt_at_index (mif->rx_queues, qid); if (mode == VNET_HW_INTERFACE_RX_MODE_POLLING) mq->ring->flags |= MEMIF_RING_FLAG_MASK_INT; else mq->ring->flags &= ~MEMIF_RING_FLAG_MASK_INT; return 0; } static clib_error_t * memif_interface_admin_up_down (vnet_main_t * vnm, u32 hw_if_index, u32 flags) { memif_main_t *mm = &memif_main; vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index); memif_if_t *mif = pool_elt_at_index (mm->interfaces, hw->dev_instance); static clib_error_t *error = 0; if (flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP) mif->flags |= MEMIF_IF_FLAG_ADMIN_UP; else mif->flags &= ~MEMIF_IF_FLAG_ADMIN_UP; return error; } static clib_error_t * memif_subif_add_del_function (vnet_main_t * vnm, u32 hw_if_index, struct vnet_sw_interface_t *st, int is_add) { /* Nothing for now */ return 0; } /* *INDENT-OFF* */ VNET_DEVICE_CLASS (memif_device_class) = { .name = "memif", .tx_function = memif_interface_tx, .format_device_name = format_memif_device_name, .format_device = format_memif_device, .format_tx_trace = format_memif_tx_trace, .tx_function_n_errors = MEMIF_TX_N_ERROR, .tx_function_error_strings = memif_tx_func_error_strings, .rx_redirect_to_node = memif_set_interface_next_node, .clear_counters = memif_clear_hw_interface_counters, .admin_up_down_function = memif_interface_admin_up_down, .subif_add_del_function = memif_subif_add_del_function, .rx_mode_change_function = memif_interface_rx_mode_change, }; VLIB_DEVICE_TX_FUNCTION_MULTIARCH(memif_device_class, memif_interface_tx) /* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */