aboutsummaryrefslogtreecommitdiffstats
path: root/extras
AgeCommit message (Expand)AuthorFilesLines
2018-12-18Build changes required for Fedora and CentOSThomas F Herbert1-7/+8
2018-12-18PAPI: Add MACAddress object wrapper for vl_api_mac_address_tOle Troan5-13/+9
2018-12-18Remove autotools files from extras/libmemifMauro Sardara3-117/+0
2018-12-17VOM: IGMP only supports IPv4Neale Ranns7-19/+73
2018-12-17libmemif: fix possible segfault on memif_get_detailsKoichiro Den1-31/+28
2018-12-17Added CMake building system for libmemifmsardara12-69/+367
2018-12-16VOM: fixes for statsNeale Ranns4-10/+9
2018-12-13API: Use string type instead of u8.Ole Troan15-40/+122
2018-12-13vom: Add support for new statsMohsin Kazmi13-266/+990
2018-12-12VOM: vxlan-tunnel takes egress interface for multicastNeale Ranns6-17/+49
2018-12-10VOM: vxlan-gbpNeale Ranns11-100/+522
2018-12-07vpp_if_stats: Fixing a bug in getting vpp interfaces indexesKoren Lev2-10/+10
2018-12-07vom: Fix the api type definitionMohsin Kazmi1-2/+4
2018-12-06API: Change ip4_address and ip6_address to use type alias.Ole Troan6-54/+19
2018-12-06Update japi to support type aliasesMichal Cmarada5-32/+126
2018-12-05VOM: interface event structNeale Ranns7-5/+72
2018-11-30Metadata / opaque formatting belongs in vppDave Barach1-781/+178
2018-11-29VOM: missing GBP symbolNeale Ranns1-1/+2
2018-11-29VOM: deprecate TAP add ip-punt redirect dumpNeale Ranns13-297/+174
2018-11-29GBP: l3-out subnetsNeale Ranns7-1/+685
2018-11-29VPP-1507: Added binary api to dump configured ip_punt_redirectPavel Kotucek1-8/+7
2018-11-29API: Add support for type aliasesOle Troan1-0/+7
2018-11-26Minor tweaksDave Barach1-10/+38
2018-11-25Use a dissector table instead of strcmpDave Barach1-30/+51
2018-11-23Fix permission for vpp_papiOnong Tayeng1-1/+1
2018-11-22stats: golang vpp_if_stats_clientKoren Lev8-0/+1180
2018-11-20Add wireshark dissector to extrasDave Barach3-0/+1079
2018-11-20Fix inspection for 18.10, requirementsjdenisco5-42/+68
2018-11-20vom: Add support for redirect contracts in gbpMohsin Kazmi7-13/+613
2018-11-15GBP: redirect contractsNeale Ranns1-2/+2
2018-11-14VPP-1477: Replace DatatypeConverter.printHexBinary with bytesToHexMichal Cmarada1-3/+14
2018-11-13docs and Config utility, package cloud supportjdenisco1-53/+80
2018-11-13japi: Move Java API binding to cmakeMohsin Kazmi6-384/+268
2018-11-07VOM: GBP missing header file exportsNeale Ranns1-2/+5
2018-11-07GBP Endpoint LearningNeale Ranns24-103/+2392
2018-11-07Update the vpp config utilityjdenisco3-15/+19
2018-11-06BD ARP entry use common API typesNeale Ranns1-4/+5
2018-11-01vom: Add igmp 'host' support in vomMohsin Kazmi9-0/+1249
2018-10-31EMACS-LISP-ONLY: fix names of xxx_main_t pointersDave Barach3-29/+32
2018-10-31EMACS-LISP-ONLY: fix boilerplate compile errorDave Barach1-3/+3
2018-10-26extras/scripts: update vfctl scriptDamjan Marion1-1/+3
2018-10-19vppinfra: add atomic macros for __sync builtinsSirshak Das1-2/+2
2018-10-18Update version (18.10) for API changes scriptMarco Varlese1-2/+2
2018-10-03LISP ONLY: maintain the make-plugin.sh scriptDave Barach1-3/+14
2018-10-03LISP ONLY: maintain the emacs lisp plugin generatorDave Barach8-98/+70
2018-10-03jvppgen: update headersBernhard M. Wiedemann1-2/+2
2018-10-02Fix JVPP enum _host_to_net_ translation (VPP-1438)Michal Cmarada1-2/+2
2018-10-01Fix the path error inside vcl socket_test.shYalei Wang1-2/+2
2018-09-29vom: Fix the l2 port type in bridge domainMohsin Kazmi5-35/+105
2018-09-27Revert "japi: Move Java API binding to cmake"Damjan Marion6-218/+384
_valloc_init (clib_valloc_main_t * vam, clib_valloc_chunk_t * template, int need_lock) { ASSERT (template && template->baseva && template->size); clib_memset (vam, 0, sizeof (*vam)); if (need_lock) clib_spinlock_init (&vam->lock); vam->chunk_index_by_baseva = hash_create (0, sizeof (uword)); vam->first_index = ~0; vam->flags |= CLIB_VALLOC_INITIALIZED; clib_valloc_add_chunk (vam, template); } /** Allocate virtual space @param vam - clib_valloc_main_t * pointer to the allocation arena @param size - u64 number of bytes to allocate @os_out_of_memory_on_failure - 1=> panic on allocation failure @return uword allocated space, 0=> failure */ __clib_export uword clib_valloc_alloc (clib_valloc_main_t * vam, uword size, int os_out_of_memory_on_failure) { clib_valloc_chunk_t *ch, *new_ch, *next_ch; u32 index; clib_spinlock_lock_if_init (&vam->lock); index = vam->first_index; while (index != ~0) { ch = pool_elt_at_index (vam->chunks, index); /* If the chunk is free... */ if ((ch->flags & CLIB_VALLOC_BUSY) == 0) { /* Too small? */ if (ch->size < size) goto next_chunk; /* Exact match? */ if (ch->size == size) { ch->flags |= CLIB_VALLOC_BUSY; clib_spinlock_unlock_if_init (&vam->lock); return ch->baseva; } /* * The current free chunk is larger than necessary, split the block. */ pool_get (vam->chunks, new_ch); /* ch might have just moved */ ch = pool_elt_at_index (vam->chunks, index); clib_memset (new_ch, 0, sizeof (*new_ch)); new_ch->next = new_ch->prev = ~0; new_ch->baseva = ch->baseva + size; new_ch->size = ch->size - size; ch->size = size; /* Insert into doubly-linked list */ new_ch->next = ch->next; new_ch->prev = ch - vam->chunks; if (ch->next != ~0) { next_ch = pool_elt_at_index (vam->chunks, ch->next); next_ch->prev = new_ch - vam->chunks; } ch->next = new_ch - vam->chunks; hash_set (vam->chunk_index_by_baseva, new_ch->baseva, new_ch - vam->chunks); ch->flags |= CLIB_VALLOC_BUSY; clib_spinlock_unlock_if_init (&vam->lock); return ch->baseva; } next_chunk: index = ch->next; } clib_spinlock_unlock_if_init (&vam->lock); if (os_out_of_memory_on_failure) os_out_of_memory (); return 0; } /** Free virtual space @param vam - clib_valloc_main_t * pointer to the allocation arena @param baseva - uword base virtual address of the returned space @return uword - size of the freed virtual chunk @note the size is returned since we know it / in case the caller doesn't memorize chunk sizes */ __clib_export uword clib_valloc_free (clib_valloc_main_t * vam, uword baseva) { clib_valloc_chunk_t *ch, *prev_ch, *next_ch, *n2_ch; u32 index; uword return_size = 0; uword *p; clib_spinlock_lock_if_init (&vam->lock); p = hash_get (vam->chunk_index_by_baseva, baseva); /* Check even in production images */ if (p == 0) os_panic (); index = p[0]; ch = pool_elt_at_index (vam->chunks, index); return_size = ch->size; ASSERT (ch->baseva == baseva); ASSERT ((ch->flags & CLIB_VALLOC_BUSY) != 0); ch->flags &= ~CLIB_VALLOC_BUSY; /* combine with previous entry? */ if (ch->prev != ~0) { prev_ch = pool_elt_at_index (vam->chunks, ch->prev); /* * Previous item must be free as well, and * tangent to this block. */ if ((prev_ch->flags & CLIB_VALLOC_BUSY) == 0 && ((prev_ch->baseva + prev_ch->size) == ch->baseva)) { hash_unset (vam->chunk_index_by_baseva, baseva); prev_ch->size += ch->size; prev_ch->next = ch->next; if (ch->next != ~0) { next_ch = pool_elt_at_index (vam->chunks, ch->next); next_ch->prev = ch->prev; } ASSERT (ch - vam->chunks != vam->first_index); clib_memset (ch, 0xfe, sizeof (*ch)); pool_put (vam->chunks, ch); /* See about combining with next elt */ ch = prev_ch; } } /* Combine with next entry? */ if (ch->next != ~0) { next_ch = pool_elt_at_index (vam->chunks, ch->next); if ((next_ch->flags & CLIB_VALLOC_BUSY) == 0 && ((ch->baseva + ch->size) == next_ch->baseva)) { hash_unset (vam->chunk_index_by_baseva, next_ch->baseva); ch->size += next_ch->size; ch->next = next_ch->next; if (ch->next != ~0) { n2_ch = pool_elt_at_index (vam->chunks, next_ch->next); n2_ch->prev = ch - vam->chunks; } ASSERT (next_ch - vam->chunks != vam->first_index); clib_memset (next_ch, 0xfe, sizeof (*ch)); pool_put (vam->chunks, next_ch); } } clib_spinlock_unlock_if_init (&vam->lock); return return_size; } /** format a virtual allocation arena (varargs) @param vam - clib_valloc_main_t pointer to the arena to format @param verbose - int - verbosity level @return u8 vector */ u8 * format_valloc (u8 * s, va_list * va) { clib_valloc_main_t *vam = va_arg (*va, clib_valloc_main_t *); int verbose = va_arg (*va, int); clib_valloc_chunk_t *ch; u32 index; uword *p; clib_spinlock_lock_if_init (&vam->lock); s = format (s, "%d chunks, first index %d\n", pool_elts (vam->chunks), vam->first_index); if (verbose) { index = vam->first_index; while (index != ~0) { ch = pool_elt_at_index (vam->chunks, index); s = format (s, "[%d] base %llx size %llx (%lld) prev %d %s\n", index, ch->baseva, ch->size, ch->size, ch->prev, (ch->flags & CLIB_VALLOC_BUSY) ? "busy" : "free"); p = hash_get (vam->chunk_index_by_baseva, ch->baseva); if (p == 0) { s = format (s, " BUG: baseva not in hash table!\n"); } else if (p[0] != index) { s = format (s, " BUG: baseva in hash table %d not %d!\n", p[0], index); } index = ch->next; } } clib_spinlock_unlock_if_init (&vam->lock); return s; } /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */