aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/buffer_funcs.h
AgeCommit message (Collapse)AuthorFilesLines
2018-02-26vlib: add vlib_buffer_free_from_ringDamjan Marion1-0/+26
Change-Id: I63f7b14cd63eac9e64cace5d941190096ad148dc Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-07Refactor vlib_buffer flagsDamjan Marion1-68/+45
Change-Id: I853386aebfe488ebb10328435b81b6e3403c5dd0 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-02vlib_buffer_clone: allow client to request the maximum number of clones; 256Neale Ranns1-12/+50
Change-Id: Id96dc5d86719546268b50a9999a06387d2d9075c Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-02-01IPv4/6 reassemblyKlement Sekera1-0/+62
Change-Id: Ic5dcadd13c88b8a5e7896dab82404509c081614a Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-01-31vlib: allocating buffers on thread-x and freeing them on thread-y causesSteven1-5/+5
a crash on debug image (VPP-1151) In debug image, there is extra code to validate the buffer when it is freed. It uses the hash table to lookup the buffer index with spinlock to prevent contention. However, there is one spinlock for each worker thread. So allocating the buffer on thread-x and freeing the same buffer on thread-y causes the validation to fail on thread-y. The fix is to have only one spinlock, stored in vlib_global_main. Change-Id: Ic383846cefe84a3e262255afcf82276742f0f62e Signed-off-by: Steven <sluong@cisco.com> (cherry picked from commit a7effa1b072463f12305a474f082aeaffb7ada4b)
2018-01-18vlib: add vlib_buffer_alloc_to_ring APIDamjan Marion1-0/+29
Change-Id: I4e2804754b443f5f41fb25eed8334908c4a70f84 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-12-09vlib: PCI rework to support VFIODamjan Marion1-7/+5
Also fixes old ixge driver, so it works with recent physmem changes and vfio. Change-Id: Id4be74b34daed47cd281a77eec43d6692340d882 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-11-27vlib: make vlib_buffer_alloc inline functionDamjan Marion1-21/+59
Currently, every alloc involves callback function call. With this change callback function is called only if there is no empty buffers on the free list. Change-Id: I2238c19ece7ce182c49ba0f2485add52f335f3b6 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-11-09buffers: fix bug in free list n_alloc trackingKlement Sekera1-0/+1
This change avoids hitting ASSERT (vec_len (f->buffers) == f->n_alloc); in vlib_buffer_delete_free_list_internal by updating vlib_buffer_free_list_t->n_alloc in case when buffers are removed from the free list due to overfill. Change-Id: Id60fa97e8cb0f02ef529b05816265a57a4e7d998 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-10-25vlib: add support for multiple buffer poolsDamjan Marion1-1/+4
Change-Id: Icaf7d7ad47284aea7a56e8006b69f45874d64202 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-09-07vlib physmem reworkDamjan Marion1-38/+1
This patch adds supprot support for multiple numa-aware physmem regions. Change-Id: I5c69a6f4da33c8ee21bdb8604d52fd2886f2327e Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-08-30Thread safe internal buffer manager, take twoDamjan Marion1-4/+7
First attempt to make internal buffer manager thread safe was not succesfull, so trying again. This time with more testing. Change-Id: I01b8385a9c26d233934a3339255ea4bd31c865ac Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-08-11Fix tcp multi buffer segments retransmissionFlorin Coras1-1/+6
- Fix tcp/udp sw checksum computation - Fix allocation of multi buffer tcp segments for retransmits - Send FIN only if/when tx fifo is empty Change-Id: I2e43a14b87a72c9e547b4339b9a51811cf5732c4 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-07-27Thread safe internal buffer managerDamjan Marion1-2/+13
Change-Id: I45845b952aa42a854e1c2c396b85f905de987020 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-07-14Introduce l{2,3,4}_hdr_offset fields in the buffer metadataDamjan Marion1-14/+36
To save space in the first cacheline following is changed: - total_length_not_including_first_buffer moved to the 2nd cacheline. This field is used only when VLIB_BUFFER_TOTAL_LENGTH_VALID and VLIB_BUFFER_NEXT_PRESENT are both set. - free_list_index is now stored in 4bits inside flags, which allows up to 16 free lists. In case we need more we can store index in the 2nd cachelin Change-Id: Ic8521350819391af470d31d3fa1013e67ecb7681 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-07-13dpdk: fix dpdk_buffer_pool_create nameChris Luke1-3/+0
- vnet_buffer_pool_create should probably be named dpdk_buffer_pool_create since that is what it does. - Its prototype should also be in a DPDK plugin header, not in vlib/buffer_funcs.h, since the implementation is in the plugin and nobody else should be calling it. Change-Id: I7ba259afa4b888bc94f3ad257305e286b41e7370 Signed-off-by: Chris Luke <chrisy@flirble.org>
2017-07-10vlib: store buffer memory information in the buffer_mainDamjan Marion1-3/+10
Currently, buffer index is calculated as a offset to the physmem region shifted by log2_cacheline size. When DPDK is used we "hack" physmem data with information taken from dpdk mempool. This makes physmem code not usable with DPDK. This change makes buffer memory start and size independent of physmem basically allowing physmem to be used when DPDK plugin is loaded. Change-Id: Ieb399d398f147583b9baab467152a352d58c9c31 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-04-06Use thread local storage for thread indexDamjan Marion1-2/+2
This patch deprecates stack-based thread identification, Also removes requirement that thread stacks are adjacent. Finally, possibly annoying for some folks, it renames all occurences of cpu_index and cpu_number with thread index. Using word "cpu" is misleading here as thread can be migrated ti different CPU, and also it is not related to linux cpu index. Change-Id: I68cdaf661e701d2336fc953dcb9978d10a70f7c1 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-03-15No vector allocation during buffer copyNeale Ranns1-4/+1
Change-Id: I7e8556af833ca0e00fadc96dcd2077ff1104541b Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-03-01Fix buffer template copyDave Barach1-5/+28
Change-Id: If451c9cb68719fc816999b0330b9be3a0169176a Signed-off-by: Dave Barach <dave@barachs.net>
2017-02-28vlib: add buffer cloning supportDamjan Marion1-3/+110
Change-Id: I50070611af15b2b4cc29664a8bee4f821ac3c835 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-02-24VPP-650: handle buffer failure in vlib_buffer_copy(...)Dave Barach1-1/+10
Change-Id: I6aac48d780fcd935818221044eae50067f225175 Signed-off-by: Dave Barach <dave@barachs.net>
2017-02-06vlib: remove algned/unaligned buffers schemeDamjan Marion1-42/+11
Change-Id: I4433eaed3f4e201edc329c4842cbbf74beb19a9a Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-01-17dpdk: remove duplicate code in buffers.cDamjan Marion1-0/+48
Change-Id: Idc17b4a32d40012556d5d8550942db0372ebf23d Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-01-14vlib: add buffer and thread callbacksDamjan Marion1-26/+56
Change-Id: I8e2e8f94a884ab2f9909d0c83ba00edd38cdab77 Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-12-28Reorganize source tree to use single autotools instanceDamjan Marion1-0/+755
Change-Id: I7b51f88292e057c6443b12224486f2d0c9f8ae23 Signed-off-by: Damjan Marion <damarion@cisco.com>