summaryrefslogtreecommitdiffstats
path: root/src/vppinfra
AgeCommit message (Expand)AuthorFilesLines
2018-05-11Periodic scan and probe of IP neighbors to maintain neighbor poolsJohn Lo2-0/+6
2018-05-11VPP-1275 Fix memory leaks in IPsec CLIKlement Sekera1-1/+1
2018-05-10vppinfra: use count_trailing_zeros in sparse_vec_indexDamjan Marion3-68/+30
2018-05-10vppinfra: use popcnt instruction when availableDamjan Marion1-0/+8
2018-05-09dpdk: tx code reworkDamjan Marion1-0/+12
2018-05-05autodetect alignment during _vec_resizeDamjan Marion5-8/+12
2018-05-04Harmonize vec/pool_get_aligned object sizes and alignment requestsDave Barach2-0/+4
2018-04-30Remove historical README fileDave Barach1-43/+0
2018-04-25dpdk: complete rework of the dpdk-input nodeDamjan Marion4-5/+149
2018-04-18vppinfra: make set_mempolicy failure non-critical unless NUMA_FORCE is setDamjan Marion1-1/+2
2018-04-11Clean up temp dir in failure casesDave Barach1-0/+3
2018-03-22Add circular loggingDave Barach3-21/+85
2018-03-12Remove md5.[ch] from vppinfraDave Barach3-515/+0
2018-03-09Correct address calculation for VPP-1168Lee Roberts1-1/+1
2018-03-06glibc 2.27 fixMarco Varlese1-0/+2
2018-03-04vppinfra: fix clib_mem_vm_ext_alloc non-shared allocationsDamjan Marion2-3/+9
2018-02-26Added u8x16,u32x4,u64x2 variants of _zero_byte_mask(x) for ARM/NEON platform....Adrian Oanca1-0/+20
2018-02-24u8x16_compare_byte_mask - optimize to use 128bit registers as suggested by Ni...Adrian Oanca1-24/+9
2018-02-23Add prefetch inlines, update bi-hash doc tagsDave Barach2-12/+90
2018-02-22bihash table size perf/scale improvementsDave Barach3-41/+73
2018-02-21vppinfra: change default cache line size 64 bytesDamjan Marion1-10/+2
2018-02-21vppinfra: remove vector_iwmmxt.hDamjan Marion2-126/+0
2018-02-21add 'is_all_zero(x)' for NEONAdrian Oanca1-0/+24
2018-02-20vppinfra: autogerate vector typedefs and basic inline functionsDamjan Marion5-379/+83
2018-02-20Reset expired timer vector length after callbackDave Barach1-1/+4
2018-02-20vppinfra: CLIB_HAVE_VEC128 mandates SSE4.2Damjan Marion2-9/+3
2018-02-19Use neutral vector code for ethernet_frame_is_taggedDamjan Marion1-0/+25
2018-02-18fix format_hexdumpDamjan Marion1-1/+2
2018-02-14vppinfra: Remove empty fileMohsin Kazmi1-0/+0
2018-02-09GBP pluginNeale Ranns1-0/+0
2018-02-08add CLIB_HAVE_VEC128 with NEON intrinsics (VPP-1127)Gabriel Ganne2-8/+64
2018-02-08Minimize bihash memory consumptionDave Barach3-118/+207
2018-02-06vlib: epoll on worker threadsDamjan Marion1-0/+25
2018-02-06Provide page-aligned length to ftruncate.Igor Mikhailov (imichail)1-1/+1
2018-02-05session: segment manager refactorFlorin Coras1-2/+19
2018-02-01Add flowhash hash table to vppinfraPierre Pfister4-0/+998
2018-01-30Compile valloc.c, install header file, etc.Dave Barach1-1/+1
2018-01-30Arm system counter cleanupBrian Brooks2-18/+19
2018-01-27First-fit virtual space allocatorDave Barach3-0/+700
2018-01-25vppinfra: add readers-writer lockFlorin Coras1-14/+98
2018-01-25session: add support for memfd segmentsFlorin Coras2-2/+3
2018-01-24Adding a format function for bihash init routine to format the key, value, wh...Vijayabhaskar Katamreddy2-3/+28
2018-01-19Sub-Interface deletion not cleanup hash's properly (VPP-1136)John Lo1-4/+6
2018-01-17ssvm: reuse clib mem infra for memfd segmentsFlorin Coras2-8/+64
2018-01-09physmem: fix physmem allocation on kernels without NUMA supportDamjan Marion1-4/+4
2018-01-09api: refactor vlibmemoryFlorin Coras1-0/+1
2018-01-06aarch64 - show cpu microarchitectureGabriel Ganne1-0/+50
2018-01-05sock api: add infra for bootstrapping shm clientsFlorin Coras1-0/+7
2018-01-05Unify and cleanup usage of hash_set/unset_mem by various tunnelsJohn Lo1-0/+21
2017-12-16Use crc32 wrapper (VPP-1086)Gabriel Ganne2-2/+7
_rotor++; ep->server_fails++; if (ep->server_rotor >= vec_len (dm->ip6_name_servers)) ep->server_rotor = 0; if (0) clib_warning ("Try server %U", format_ip6_address, dm->ip6_name_servers + ep->server_rotor); vnet_dns_send_dns6_request (dm, ep, dm->ip6_name_servers + ep->server_rotor); } else { if (0) clib_warning ("Server %U failed to resolve '%s'", format_ip4_address, dm->ip4_name_servers + ep->server_rotor, ep->name); if (ep->server_fails > 1 || vec_len (dm->ip4_name_servers) <= 1) { /* No, tell the client to go away */ goto reply; } ep->retry_count = 0; ep->server_rotor++; ep->server_fails++; if (ep->server_rotor >= vec_len (dm->ip4_name_servers)) ep->server_rotor = 0; if (0) clib_warning ("Try server %U", format_ip4_address, dm->ip4_name_servers + ep->server_rotor); vnet_dns_send_dns4_request (dm, ep, dm->ip4_name_servers + ep->server_rotor); } dns_cache_unlock (dm); return; } reply: /* Save the response */ ep->dns_response = reply; /* * Pick a sensible default cache entry expiration time. * We don't play the 10-second timeout game. */ ep->expiration_time = now + 600.0; if (0) clib_warning ("resolving '%s', was %s valid", ep->name, (ep->flags & DNS_CACHE_ENTRY_FLAG_VALID) ? "already" : "not"); /* * The world is a mess. A single DNS request sent to e.g. 8.8.8.8 * may yield multiple, subtly different responses - all with the same * DNS protocol-level ID. * * Last response wins in terms of what ends up in the cache. * First response wins in terms of the response sent to the client. */ /* Strong hint that we may not find a pending resolution entry */ entry_was_valid = (ep->flags & DNS_CACHE_ENTRY_FLAG_VALID) ? 1 : 0; if (vec_len (ep->dns_response)) ep->flags |= DNS_CACHE_ENTRY_FLAG_VALID; /* Most likely, send 1 message */ for (i = 0; i < vec_len (ep->pending_requests); i++) { vl_api_registration_t *regp; pr = vec_elt_at_index (ep->pending_requests, i); switch (pr->request_type) { case DNS_API_PENDING_NAME_TO_IP: { vl_api_dns_resolve_name_reply_t *rmp; regp = vl_api_client_index_to_registration (pr->client_index); if (regp == 0) continue; rmp = vl_msg_api_alloc (sizeof (*rmp)); rmp->_vl_msg_id = clib_host_to_net_u16 (VL_API_DNS_RESOLVE_NAME_REPLY + dm->msg_id_base); rmp->context = pr->client_context; min_ttl = ~0; rv = vnet_dns_response_to_reply (ep->dns_response, rmp, &min_ttl); if (min_ttl != ~0) ep->expiration_time = now + min_ttl; rmp->retval = clib_host_to_net_u32 (rv); vl_api_send_msg (regp, (u8 *) rmp); } break; case DNS_API_PENDING_IP_TO_NAME: { vl_api_dns_resolve_ip_reply_t *rmp; regp = vl_api_client_index_to_registration (pr->client_index); if (regp == 0) continue; rmp = vl_msg_api_alloc (sizeof (*rmp)); rmp->_vl_msg_id = clib_host_to_net_u16 (VL_API_DNS_RESOLVE_IP_REPLY + dm->msg_id_base); rmp->context = pr->client_context; min_ttl = ~0; rv = vnet_dns_response_to_name (ep->dns_response, rmp, &min_ttl); if (min_ttl != ~0) ep->expiration_time = now + min_ttl; rmp->retval = clib_host_to_net_u32 (rv); vl_api_send_msg (regp, (u8 *) rmp); } break; case DNS_PEER_PENDING_IP_TO_NAME: case DNS_PEER_PENDING_NAME_TO_IP: if (pr->is_ip6) vnet_send_dns6_reply (dm, pr, ep, 0 /* allocate a buffer */ ); else vnet_send_dns4_reply (dm, pr, ep, 0 /* allocate a buffer */ ); break; default: clib_warning ("request type %d unknown", pr->request_type); break; } } vec_free (ep->pending_requests); remove_count = 0; for (i = 0; i < vec_len (dm->unresolved_entries); i++) { if (dm->unresolved_entries[i] == pool_index) { vec_delete (dm->unresolved_entries, 1, i); remove_count++; i--; } } /* See multiple response comment above... */ if (remove_count == 0) { u32 error_code = entry_was_valid ? DNS46_REPLY_ERROR_MULTIPLE_REPLY : DNS46_REPLY_ERROR_NO_UNRESOLVED_ENTRY; vlib_node_increment_counter (vm, dns46_reply_node.index, error_code, 1); dns_cache_unlock (dm); return; } /* Deal with bogus names, server issues, etc. */ switch (rcode) { default: case DNS_RCODE_NO_ERROR: break; case DNS_RCODE_SERVER_FAILURE: case DNS_RCODE_NOT_IMPLEMENTED: case DNS_RCODE_REFUSED: if (ep->server_af == 0) clib_warning ("name server %U can't resolve '%s'", format_ip4_address, dm->ip4_name_servers + ep->server_rotor, ep->name); else clib_warning ("name server %U can't resolve '%s'", format_ip6_address, dm->ip6_name_servers + ep->server_rotor, ep->name); /* FALLTHROUGH */ case DNS_RCODE_NAME_ERROR: case DNS_RCODE_FORMAT_ERROR: /* remove trash from the cache... */ vnet_dns_delete_entry_by_index_nolock (dm, ep - dm->entries); break; } dns_cache_unlock (dm); return; } static void retry_scan (dns_main_t * dm, f64 now) { int i; dns_cache_entry_t *ep; for (i = 0; i < vec_len (dm->unresolved_entries); i++) { dns_cache_lock (dm, 11); ep = pool_elt_at_index (dm->entries, dm->unresolved_entries[i]); ASSERT ((ep->flags & DNS_CACHE_ENTRY_FLAG_VALID) == 0); vnet_send_dns_request (dm, ep); dns_cache_unlock (dm); } } static uword dns_resolver_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f) { dns_main_t *dm = &dns_main; f64 now; f64 timeout = 1000.0; uword *event_data = 0; uword event_type; int i; while (1) { vlib_process_wait_for_event_or_clock (vm, timeout); now = vlib_time_now (vm); event_type = vlib_process_get_events (vm, (uword **) & event_data); switch (event_type) { /* Send one of these when a resolution is pending */ case DNS_RESOLVER_EVENT_PENDING: timeout = 2.0; break; case DNS_RESOLVER_EVENT_RESOLVED: for (i = 0; i < vec_len (event_data); i++) resolve_event (dm, now, (u8 *) event_data[i]); break; case ~0: /* timeout */ retry_scan (dm, now); break; } vec_reset_length (event_data); /* No work? Back to slow timeout mode... */ if (vec_len (dm->unresolved_entries) == 0) timeout = 1000.0; } return 0; /* or not */ } void vnet_dns_create_resolver_process (dns_main_t * dm) { /* Already created the resolver process? */ if (dm->resolver_process_node_index > 0) return; /* No, create it now and make a note of the node index */ dm->resolver_process_node_index = vlib_process_create (dm->vlib_main, "dns-resolver-process", dns_resolver_process, 16 /* log2_n_stack_bytes */ ); } /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */