From 703faabf2d44d245fe1dd0b75f1736bf6114a557 Mon Sep 17 00:00:00 2001 From: Konstantin Ananyev Date: Thu, 27 Jun 2019 19:28:26 +0100 Subject: v6: memtank introduction For analogy with mempool, named this structure memtank. Same a s mempool it allows to alloc/free objects of fixed size in a lightweight manner (not as lightweight as mempool, but hopefully close enough). The whole idea is that alloc/free is used at fast-path and don't allocate/free more than *min_free* objects at one call. So for majority of cases our fast-path alloc/free should be lightweight (LIFO enqueue/dequeue operations). Also user will need to call grow/shrink periodically (ideally from the slow-path) to make sure there is enough free objects in the tank. Internally it is just a simple LIFO for up to *max_free* objects plus a list of memory buffers (memchunk) from where these objects were allocated. v1 -> v2 - Added UT - Fixed few bugs v2 -> v3 - extend UT with more parameters v3 -> v4 - add object alignement as parameter for memtank_create - extend UT with more parameters - added memtank dump routine v4 -> v5 - fixed few bugs inside memtank lib - extend UT with: - new test case - new command-line options: '-s ', '-m ' v5 -> v6 - extend memtank dump to collect/display extra information - make memtank dump routine MT safe - add memtank sanity check function - add proper comments for pubic API Signed-off-by: Konstantin Ananyev Change-Id: I8939772577f5d9e293088eaa9a9fe316c3fe8f87 --- lib/libtle_memtank/Makefile | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 lib/libtle_memtank/Makefile (limited to 'lib/libtle_memtank/Makefile') diff --git a/lib/libtle_memtank/Makefile b/lib/libtle_memtank/Makefile new file mode 100644 index 0000000..d87e320 --- /dev/null +++ b/lib/libtle_memtank/Makefile @@ -0,0 +1,40 @@ +# Copyright (c) 2016 Intel Corporation. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +ifeq ($(RTE_SDK),) +$(error "Please define RTE_SDK environment variable") +endif + +# Default target, can be overwritten by command line or environment +RTE_TARGET ?= x86_64-native-linuxapp-gcc + +include $(RTE_SDK)/mk/rte.vars.mk + +# library name +LIB = libtle_memtank.a + +CFLAGS += -O3 +CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) + +EXPORT_MAP := tle_memtank_version.map + +LIBABIVER := 1 + +#source files +SRCS-y += memtank.c +SRCS-y += misc.c + +SYMLINK-y-include += tle_memtank_pub.h +SYMLINK-y-include += tle_memtank.h + +include $(TLDK_ROOT)/mk/tle.lib.mk -- cgit 1.2.3-korg