From 2f9d47013e4dbb7381914e6e2e2470f69225cafc Mon Sep 17 00:00:00 2001 From: Sergio Gonzalez Monroy Date: Wed, 15 Jul 2015 17:32:20 +0100 Subject: [PATCH] mem: move librte_malloc to eal/common Move malloc inside eal and create a new section in MAINTAINERS file for Memory Allocation in EAL. Create a dummy malloc library to avoid breaking applications that have librte_malloc in their DT_NEEDED entries. This is the first step towards using malloc to allocate memory directly from memsegs. Thus, memzones would allocate memory through malloc, allowing to free memzones. Signed-off-by: Sergio Gonzalez Monroy --- MAINTAINERS | 23 +- config/common_bsdapp | 9 +- config/common_linuxapp | 9 +- drivers/net/af_packet/Makefile | 1 - drivers/net/bonding/Makefile | 1 - drivers/net/e1000/Makefile | 2 +- drivers/net/enic/Makefile | 2 +- drivers/net/fm10k/Makefile | 2 +- drivers/net/i40e/Makefile | 2 +- drivers/net/ixgbe/Makefile | 2 +- drivers/net/mlx4/Makefile | 1 - drivers/net/null/Makefile | 1 - drivers/net/pcap/Makefile | 1 - drivers/net/virtio/Makefile | 2 +- drivers/net/vmxnet3/Makefile | 2 +- drivers/net/xenvirt/Makefile | 2 +- lib/Makefile | 2 +- lib/librte_acl/Makefile | 2 +- lib/librte_eal/bsdapp/eal/Makefile | 4 +- lib/librte_eal/bsdapp/eal/rte_eal_version.map | 13 + lib/librte_eal/common/Makefile | 1 + .../common/include}/rte_malloc.h | 0 .../common}/malloc_elem.c | 0 .../common}/malloc_elem.h | 0 .../common}/malloc_heap.c | 0 .../common}/malloc_heap.h | 0 lib/librte_eal/common/rte_malloc.c | 260 ++++++++++++++++++ lib/librte_eal/linuxapp/eal/Makefile | 4 +- .../linuxapp/eal/rte_eal_version.map | 13 + lib/librte_hash/Makefile | 2 +- lib/librte_lpm/Makefile | 2 +- lib/librte_malloc/Makefile | 6 +- lib/librte_malloc/rte_malloc.c | 228 +-------------- lib/librte_malloc/rte_malloc_version.map | 16 -- lib/librte_mempool/Makefile | 2 - lib/librte_port/Makefile | 1 - lib/librte_ring/Makefile | 3 +- lib/librte_table/Makefile | 1 - 38 files changed, 326 insertions(+), 296 deletions(-) rename lib/{librte_malloc => librte_eal/common/include}/rte_malloc.h (100%) rename lib/{librte_malloc => librte_eal/common}/malloc_elem.c (100%) rename lib/{librte_malloc => librte_eal/common}/malloc_elem.h (100%) rename lib/{librte_malloc => librte_eal/common}/malloc_heap.c (100%) rename lib/{librte_malloc => librte_eal/common}/malloc_heap.h (100%) create mode 100644 lib/librte_eal/common/rte_malloc.c diff --git a/MAINTAINERS b/MAINTAINERS index a15105d68a..68d9857fb9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -83,12 +83,9 @@ F: app/test/test_debug.c F: app/test/test_devargs.c F: app/test/test_eal* F: app/test/test_errno.c -F: app/test/test_func_reentrancy.c F: app/test/test_interrupts.c F: app/test/test_logs.c F: app/test/test_memcpy* -F: app/test/test_memory.c -F: app/test/test_memzone.c F: app/test/test_pci.c F: app/test/test_per_lcore.c F: app/test/test_prefetch.c @@ -98,6 +95,20 @@ F: app/test/test_string_fns.c F: app/test/test_tailq.c F: app/test/test_version.c +Memory Allocation +M: Sergio Gonzalez Monroy +F: lib/librte_eal/common/include/rte_mem* +F: lib/librte_eal/common/include/rte_malloc.h +F: lib/librte_eal/common/*malloc* +F: lib/librte_eal/common/eal_common_mem* +F: lib/librte_eal/common/eal_hugepages.h +F: lib/librte_malloc/ +F: doc/guides/prog_guide/malloc_lib.rst +F: app/test/test_func_reentrancy.c +F: app/test/test_malloc.c +F: app/test/test_memory.c +F: app/test/test_memzone.c + Secondary process K: RTE_PROC_ F: doc/guides/prog_guide/multi_proc_support.rst @@ -161,12 +172,6 @@ F: lib/librte_eal/bsdapp/nic_uio/ Core Libraries -------------- -Dynamic memory -F: lib/librte_malloc/ -F: doc/guides/prog_guide/malloc_lib.rst -F: app/test/test_malloc.c -F: app/test/test_func_reentrancy.c - Memory pool M: Olivier Matz F: lib/librte_mempool/ diff --git a/config/common_bsdapp b/config/common_bsdapp index 7112f1caef..5bb7f557ea 100644 --- a/config/common_bsdapp +++ b/config/common_bsdapp @@ -106,6 +106,8 @@ CONFIG_RTE_LOG_LEVEL=8 CONFIG_RTE_LOG_HISTORY=256 CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n +CONFIG_RTE_MALLOC_DEBUG=n +CONFIG_RTE_MALLOC_MEMZONE_SIZE=11M # # FreeBSD contiguous memory driver settings @@ -307,13 +309,6 @@ CONFIG_RTE_PKTMBUF_HEADROOM=128 CONFIG_RTE_LIBRTE_TIMER=y CONFIG_RTE_LIBRTE_TIMER_DEBUG=n -# -# Compile librte_malloc -# -CONFIG_RTE_LIBRTE_MALLOC=y -CONFIG_RTE_LIBRTE_MALLOC_DEBUG=n -CONFIG_RTE_MALLOC_MEMZONE_SIZE=11M - # # Compile librte_cfgfile # diff --git a/config/common_linuxapp b/config/common_linuxapp index 4d90d35844..7b57044298 100644 --- a/config/common_linuxapp +++ b/config/common_linuxapp @@ -109,6 +109,8 @@ CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n CONFIG_RTE_EAL_IGB_UIO=y CONFIG_RTE_EAL_VFIO=y +CONFIG_RTE_MALLOC_DEBUG=n +CONFIG_RTE_MALLOC_MEMZONE_SIZE=11M # # Special configurations in PCI Config Space for high performance @@ -315,13 +317,6 @@ CONFIG_RTE_PKTMBUF_HEADROOM=128 CONFIG_RTE_LIBRTE_TIMER=y CONFIG_RTE_LIBRTE_TIMER_DEBUG=n -# -# Compile librte_malloc -# -CONFIG_RTE_LIBRTE_MALLOC=y -CONFIG_RTE_LIBRTE_MALLOC_DEBUG=n -CONFIG_RTE_MALLOC_MEMZONE_SIZE=11M - # # Compile librte_cfgfile # diff --git a/drivers/net/af_packet/Makefile b/drivers/net/af_packet/Makefile index f0bf53716a..ce5d239051 100644 --- a/drivers/net/af_packet/Makefile +++ b/drivers/net/af_packet/Makefile @@ -58,7 +58,6 @@ SYMLINK-y-include += rte_eth_af_packet.h # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += lib/librte_mbuf DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += lib/librte_ether -DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += lib/librte_malloc DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += lib/librte_kvargs include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/net/bonding/Makefile b/drivers/net/bonding/Makefile index 83ccce3386..dee0875ef6 100644 --- a/drivers/net/bonding/Makefile +++ b/drivers/net/bonding/Makefile @@ -61,7 +61,6 @@ SYMLINK-y-include += rte_eth_bond_8023ad.h # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += lib/librte_mbuf DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += lib/librte_ether -DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += lib/librte_malloc DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += lib/librte_eal DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += lib/librte_kvargs diff --git a/drivers/net/e1000/Makefile b/drivers/net/e1000/Makefile index 3d525faa60..ccd2b7bdd4 100644 --- a/drivers/net/e1000/Makefile +++ b/drivers/net/e1000/Makefile @@ -94,6 +94,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_EM_PMD) += em_rxtx.c # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += lib/librte_eal lib/librte_ether DEPDIRS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += lib/librte_mempool lib/librte_mbuf -DEPDIRS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += lib/librte_net lib/librte_malloc +DEPDIRS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += lib/librte_net include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/net/enic/Makefile b/drivers/net/enic/Makefile index 52334c93b0..f0ee093f93 100644 --- a/drivers/net/enic/Makefile +++ b/drivers/net/enic/Makefile @@ -65,7 +65,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += base/vnic_rss.c # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_eal lib/librte_ether DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_mempool lib/librte_mbuf -DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_net lib/librte_malloc +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_net DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_hash include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/net/fm10k/Makefile b/drivers/net/fm10k/Makefile index 7395933f9b..a4a8f564a1 100644 --- a/drivers/net/fm10k/Makefile +++ b/drivers/net/fm10k/Makefile @@ -97,6 +97,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += fm10k_api.c # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += lib/librte_eal lib/librte_ether DEPDIRS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += lib/librte_mempool lib/librte_mbuf -DEPDIRS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += lib/librte_net lib/librte_malloc +DEPDIRS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += lib/librte_net include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/net/i40e/Makefile b/drivers/net/i40e/Makefile index 4fe371d286..55b7d311ec 100644 --- a/drivers/net/i40e/Makefile +++ b/drivers/net/i40e/Makefile @@ -102,6 +102,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_fdir.c # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += lib/librte_eal lib/librte_ether DEPDIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += lib/librte_mempool lib/librte_mbuf -DEPDIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += lib/librte_net lib/librte_malloc +DEPDIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += lib/librte_net include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/net/ixgbe/Makefile b/drivers/net/ixgbe/Makefile index f92a565f0d..6095cc2730 100644 --- a/drivers/net/ixgbe/Makefile +++ b/drivers/net/ixgbe/Makefile @@ -117,7 +117,7 @@ endif # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += lib/librte_eal lib/librte_ether DEPDIRS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += lib/librte_mempool lib/librte_mbuf -DEPDIRS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += lib/librte_net lib/librte_malloc +DEPDIRS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += lib/librte_net ifeq ($(CONFIG_RTE_IXGBE_INC_VECTOR)$(CONFIG_RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC),yn) $(error The ixgbe vpmd depends on Rx bulk alloc) diff --git a/drivers/net/mlx4/Makefile b/drivers/net/mlx4/Makefile index 725717f86f..14cb53f6af 100644 --- a/drivers/net/mlx4/Makefile +++ b/drivers/net/mlx4/Makefile @@ -42,7 +42,6 @@ DEPDIRS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += lib/librte_ether DEPDIRS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += lib/librte_mbuf DEPDIRS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += lib/librte_eal DEPDIRS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += lib/librte_mempool -DEPDIRS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += lib/librte_malloc # Basic CFLAGS. CFLAGS += -O3 diff --git a/drivers/net/null/Makefile b/drivers/net/null/Makefile index 647201532f..96ba01c840 100644 --- a/drivers/net/null/Makefile +++ b/drivers/net/null/Makefile @@ -56,7 +56,6 @@ SYMLINK-y-include += # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += lib/librte_mbuf DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += lib/librte_ether -DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += lib/librte_malloc DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += lib/librte_kvargs include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/net/pcap/Makefile b/drivers/net/pcap/Makefile index 0775dbc294..48be913cd0 100644 --- a/drivers/net/pcap/Makefile +++ b/drivers/net/pcap/Makefile @@ -57,7 +57,6 @@ SYMLINK-y-include += # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += lib/librte_mbuf DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += lib/librte_ether -DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += lib/librte_malloc DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += lib/librte_kvargs include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/net/virtio/Makefile b/drivers/net/virtio/Makefile index 21ff7e59ca..930b60f28c 100644 --- a/drivers/net/virtio/Makefile +++ b/drivers/net/virtio/Makefile @@ -55,6 +55,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += virtio_ethdev.c # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += lib/librte_eal lib/librte_ether DEPDIRS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += lib/librte_mempool lib/librte_mbuf -DEPDIRS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += lib/librte_net lib/librte_malloc +DEPDIRS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += lib/librte_net include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/net/vmxnet3/Makefile b/drivers/net/vmxnet3/Makefile index 901cee18e4..4cf3b33b5e 100644 --- a/drivers/net/vmxnet3/Makefile +++ b/drivers/net/vmxnet3/Makefile @@ -79,6 +79,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += vmxnet3_ethdev.c # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += lib/librte_eal lib/librte_ether DEPDIRS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += lib/librte_mempool lib/librte_mbuf -DEPDIRS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += lib/librte_net lib/librte_malloc +DEPDIRS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += lib/librte_net include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/net/xenvirt/Makefile b/drivers/net/xenvirt/Makefile index f0c796cea6..9c521d5c3e 100644 --- a/drivers/net/xenvirt/Makefile +++ b/drivers/net/xenvirt/Makefile @@ -56,7 +56,7 @@ SYMLINK-y-include += rte_eth_xenvirt.h # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += lib/librte_eal lib/librte_ether DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += lib/librte_mempool lib/librte_mbuf -DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += lib/librte_net lib/librte_malloc +DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += lib/librte_net DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += lib/librte_cmdline include $(RTE_SDK)/mk/rte.lib.mk diff --git a/lib/Makefile b/lib/Makefile index 5f480f9590..2055539984 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -33,7 +33,7 @@ include $(RTE_SDK)/mk/rte.vars.mk DIRS-y += librte_compat DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal -DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc +DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_malloc DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring DIRS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += librte_mempool DIRS-$(CONFIG_RTE_LIBRTE_MBUF) += librte_mbuf diff --git a/lib/librte_acl/Makefile b/lib/librte_acl/Makefile index 68dc248e77..46acc2b847 100644 --- a/lib/librte_acl/Makefile +++ b/lib/librte_acl/Makefile @@ -75,6 +75,6 @@ SYMLINK-$(CONFIG_RTE_LIBRTE_ACL)-include := rte_acl_osdep.h SYMLINK-$(CONFIG_RTE_LIBRTE_ACL)-include += rte_acl.h # this lib needs eal -DEPDIRS-$(CONFIG_RTE_LIBRTE_ACL) += lib/librte_eal lib/librte_malloc +DEPDIRS-$(CONFIG_RTE_LIBRTE_ACL) += lib/librte_eal include $(RTE_SDK)/mk/rte.lib.mk diff --git a/lib/librte_eal/bsdapp/eal/Makefile b/lib/librte_eal/bsdapp/eal/Makefile index 40ec6481ad..064b0c5e70 100644 --- a/lib/librte_eal/bsdapp/eal/Makefile +++ b/lib/librte_eal/bsdapp/eal/Makefile @@ -40,7 +40,6 @@ CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include CFLAGS += -I$(RTE_SDK)/lib/librte_ring CFLAGS += -I$(RTE_SDK)/lib/librte_mempool -CFLAGS += -I$(RTE_SDK)/lib/librte_malloc CFLAGS += -I$(RTE_SDK)/lib/librte_ether CFLAGS += -I$(RTE_SDK)/drivers/net/ring CFLAGS += -I$(RTE_SDK)/drivers/net/pcap @@ -79,6 +78,9 @@ SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_devargs.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_dev.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_options.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_thread.c +SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += rte_malloc.c +SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += malloc_elem.c +SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += malloc_heap.c CFLAGS_eal.o := -D_GNU_SOURCE #CFLAGS_eal_thread.o := -D_GNU_SOURCE diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map index 7e850a9bf2..c107b051ca 100644 --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map @@ -10,6 +10,8 @@ DPDK_2.0 { pci_driver_list; per_lcore__lcore_id; per_lcore__rte_errno; + rte_calloc; + rte_calloc_socket; rte_cpu_check_supported; rte_cpu_get_flag_enabled; rte_cycles_vmware_tsc_map; @@ -53,6 +55,7 @@ DPDK_2.0 { rte_eal_vdev_uninit; rte_eal_wait_lcore; rte_exit; + rte_free; rte_get_hpet_cycles; rte_get_hpet_hz; rte_get_tsc_hz; @@ -68,6 +71,13 @@ DPDK_2.0 { rte_log_dump_history; rte_log_set_history; rte_logs; + rte_malloc; + rte_malloc_dump_stats; + rte_malloc_get_socket_stats; + rte_malloc_set_limit; + rte_malloc_socket; + rte_malloc_validate; + rte_malloc_virt2phy; rte_mem_lock_page; rte_mem_phy2mch; rte_mem_virt2phy; @@ -81,6 +91,7 @@ DPDK_2.0 { rte_memzone_reserve_bounded; rte_memzone_walk; rte_openlog_stream; + rte_realloc; rte_set_application_usage_hook; rte_set_log_level; rte_set_log_type; @@ -94,6 +105,8 @@ DPDK_2.0 { rte_vlog; rte_xen_dom0_memory_attach; rte_xen_dom0_memory_init; + rte_zmalloc; + rte_zmalloc_socket; test_mp_secondary; local: *; diff --git a/lib/librte_eal/common/Makefile b/lib/librte_eal/common/Makefile index 38772d4e1b..0c43d6afa2 100644 --- a/lib/librte_eal/common/Makefile +++ b/lib/librte_eal/common/Makefile @@ -40,6 +40,7 @@ INC += rte_string_fns.h rte_version.h INC += rte_eal_memconfig.h rte_malloc_heap.h INC += rte_hexdump.h rte_devargs.h rte_dev.h INC += rte_pci_dev_feature_defs.h rte_pci_dev_features.h +INC += rte_malloc.h ifeq ($(CONFIG_RTE_INSECURE_FUNCTION_WARNING),y) INC += rte_warnings.h diff --git a/lib/librte_malloc/rte_malloc.h b/lib/librte_eal/common/include/rte_malloc.h similarity index 100% rename from lib/librte_malloc/rte_malloc.h rename to lib/librte_eal/common/include/rte_malloc.h diff --git a/lib/librte_malloc/malloc_elem.c b/lib/librte_eal/common/malloc_elem.c similarity index 100% rename from lib/librte_malloc/malloc_elem.c rename to lib/librte_eal/common/malloc_elem.c diff --git a/lib/librte_malloc/malloc_elem.h b/lib/librte_eal/common/malloc_elem.h similarity index 100% rename from lib/librte_malloc/malloc_elem.h rename to lib/librte_eal/common/malloc_elem.h diff --git a/lib/librte_malloc/malloc_heap.c b/lib/librte_eal/common/malloc_heap.c similarity index 100% rename from lib/librte_malloc/malloc_heap.c rename to lib/librte_eal/common/malloc_heap.c diff --git a/lib/librte_malloc/malloc_heap.h b/lib/librte_eal/common/malloc_heap.h similarity index 100% rename from lib/librte_malloc/malloc_heap.h rename to lib/librte_eal/common/malloc_heap.h diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c new file mode 100644 index 0000000000..c313a57a67 --- /dev/null +++ b/lib/librte_eal/common/rte_malloc.c @@ -0,0 +1,260 @@ +/*- + * BSD LICENSE + * + * Copyright(c) 2010-2014 Intel Corporation. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "malloc_elem.h" +#include "malloc_heap.h" + + +/* Free the memory space back to heap */ +void rte_free(void *addr) +{ + if (addr == NULL) return; + if (malloc_elem_free(malloc_elem_from_data(addr)) < 0) + rte_panic("Fatal error: Invalid memory\n"); +} + +/* + * Allocate memory on specified heap. + */ +void * +rte_malloc_socket(const char *type, size_t size, unsigned align, int socket_arg) +{ + struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config; + int socket, i; + void *ret; + + /* return NULL if size is 0 or alignment is not power-of-2 */ + if (size == 0 || (align && !rte_is_power_of_2(align))) + return NULL; + + if (socket_arg == SOCKET_ID_ANY) + socket = malloc_get_numa_socket(); + else + socket = socket_arg; + + /* Check socket parameter */ + if (socket >= RTE_MAX_NUMA_NODES) + return NULL; + + ret = malloc_heap_alloc(&mcfg->malloc_heaps[socket], type, + size, align == 0 ? 1 : align); + if (ret != NULL || socket_arg != SOCKET_ID_ANY) + return ret; + + /* try other heaps */ + for (i = 0; i < RTE_MAX_NUMA_NODES; i++) { + /* we already tried this one */ + if (i == socket) + continue; + + ret = malloc_heap_alloc(&mcfg->malloc_heaps[i], type, + size, align == 0 ? 1 : align); + if (ret != NULL) + return ret; + } + + return NULL; +} + +/* + * Allocate memory on default heap. + */ +void * +rte_malloc(const char *type, size_t size, unsigned align) +{ + return rte_malloc_socket(type, size, align, SOCKET_ID_ANY); +} + +/* + * Allocate zero'd memory on specified heap. + */ +void * +rte_zmalloc_socket(const char *type, size_t size, unsigned align, int socket) +{ + void *ptr = rte_malloc_socket(type, size, align, socket); + + if (ptr != NULL) + memset(ptr, 0, size); + return ptr; +} + +/* + * Allocate zero'd memory on default heap. + */ +void * +rte_zmalloc(const char *type, size_t size, unsigned align) +{ + return rte_zmalloc_socket(type, size, align, SOCKET_ID_ANY); +} + +/* + * Allocate zero'd memory on specified heap. + */ +void * +rte_calloc_socket(const char *type, size_t num, size_t size, unsigned align, int socket) +{ + return rte_zmalloc_socket(type, num * size, align, socket); +} + +/* + * Allocate zero'd memory on default heap. + */ +void * +rte_calloc(const char *type, size_t num, size_t size, unsigned align) +{ + return rte_zmalloc(type, num * size, align); +} + +/* + * Resize allocated memory. + */ +void * +rte_realloc(void *ptr, size_t size, unsigned align) +{ + if (ptr == NULL) + return rte_malloc(NULL, size, align); + + struct malloc_elem *elem = malloc_elem_from_data(ptr); + if (elem == NULL) + rte_panic("Fatal error: memory corruption detected\n"); + + size = RTE_CACHE_LINE_ROUNDUP(size), align = RTE_CACHE_LINE_ROUNDUP(align); + /* check alignment matches first, and if ok, see if we can resize block */ + if (RTE_PTR_ALIGN(ptr,align) == ptr && + malloc_elem_resize(elem, size) == 0) + return ptr; + + /* either alignment is off, or we have no room to expand, + * so move data. */ + void *new_ptr = rte_malloc(NULL, size, align); + if (new_ptr == NULL) + return NULL; + const unsigned old_size = elem->size - MALLOC_ELEM_OVERHEAD; + rte_memcpy(new_ptr, ptr, old_size < size ? old_size : size); + rte_free(ptr); + + return new_ptr; +} + +int +rte_malloc_validate(const void *ptr, size_t *size) +{ + const struct malloc_elem *elem = malloc_elem_from_data(ptr); + if (!malloc_elem_cookies_ok(elem)) + return -1; + if (size != NULL) + *size = elem->size - elem->pad - MALLOC_ELEM_OVERHEAD; + return 0; +} + +/* + * Function to retrieve data for heap on given socket + */ +int +rte_malloc_get_socket_stats(int socket, + struct rte_malloc_socket_stats *socket_stats) +{ + struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config; + + if (socket >= RTE_MAX_NUMA_NODES || socket < 0) + return -1; + + return malloc_heap_get_stats(&mcfg->malloc_heaps[socket], socket_stats); +} + +/* + * Print stats on memory type. If type is NULL, info on all types is printed + */ +void +rte_malloc_dump_stats(FILE *f, __rte_unused const char *type) +{ + unsigned int socket; + struct rte_malloc_socket_stats sock_stats; + /* Iterate through all initialised heaps */ + for (socket=0; socket< RTE_MAX_NUMA_NODES; socket++) { + if ((rte_malloc_get_socket_stats(socket, &sock_stats) < 0)) + continue; + + fprintf(f, "Socket:%u\n", socket); + fprintf(f, "\tHeap_size:%zu,\n", sock_stats.heap_totalsz_bytes); + fprintf(f, "\tFree_size:%zu,\n", sock_stats.heap_freesz_bytes); + fprintf(f, "\tAlloc_size:%zu,\n", sock_stats.heap_allocsz_bytes); + fprintf(f, "\tGreatest_free_size:%zu,\n", + sock_stats.greatest_free_size); + fprintf(f, "\tAlloc_count:%u,\n",sock_stats.alloc_count); + fprintf(f, "\tFree_count:%u,\n", sock_stats.free_count); + } + return; +} + +/* + * TODO: Set limit to memory that can be allocated to memory type + */ +int +rte_malloc_set_limit(__rte_unused const char *type, + __rte_unused size_t max) +{ + return 0; +} + +/* + * Return the physical address of a virtual address obtained through rte_malloc + */ +phys_addr_t +rte_malloc_virt2phy(const void *addr) +{ + const struct malloc_elem *elem = malloc_elem_from_data(addr); + if (elem == NULL) + return 0; + return elem->mz->phys_addr + ((uintptr_t)addr - (uintptr_t)elem->mz->addr); +} diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile index 42a16fefa9..00ed62ee76 100644 --- a/lib/librte_eal/linuxapp/eal/Makefile +++ b/lib/librte_eal/linuxapp/eal/Makefile @@ -44,7 +44,6 @@ CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include CFLAGS += -I$(RTE_SDK)/lib/librte_ring CFLAGS += -I$(RTE_SDK)/lib/librte_mempool -CFLAGS += -I$(RTE_SDK)/lib/librte_malloc CFLAGS += -I$(RTE_SDK)/lib/librte_ether CFLAGS += -I$(RTE_SDK)/lib/librte_ivshmem CFLAGS += -I$(RTE_SDK)/drivers/net/ring @@ -91,6 +90,9 @@ SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_devargs.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_dev.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_options.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_thread.c +SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += rte_malloc.c +SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += malloc_elem.c +SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += malloc_heap.c CFLAGS_eal.o := -D_GNU_SOURCE CFLAGS_eal_interrupts.o := -D_GNU_SOURCE diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map index 7e850a9bf2..c107b051ca 100644 --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map @@ -10,6 +10,8 @@ DPDK_2.0 { pci_driver_list; per_lcore__lcore_id; per_lcore__rte_errno; + rte_calloc; + rte_calloc_socket; rte_cpu_check_supported; rte_cpu_get_flag_enabled; rte_cycles_vmware_tsc_map; @@ -53,6 +55,7 @@ DPDK_2.0 { rte_eal_vdev_uninit; rte_eal_wait_lcore; rte_exit; + rte_free; rte_get_hpet_cycles; rte_get_hpet_hz; rte_get_tsc_hz; @@ -68,6 +71,13 @@ DPDK_2.0 { rte_log_dump_history; rte_log_set_history; rte_logs; + rte_malloc; + rte_malloc_dump_stats; + rte_malloc_get_socket_stats; + rte_malloc_set_limit; + rte_malloc_socket; + rte_malloc_validate; + rte_malloc_virt2phy; rte_mem_lock_page; rte_mem_phy2mch; rte_mem_virt2phy; @@ -81,6 +91,7 @@ DPDK_2.0 { rte_memzone_reserve_bounded; rte_memzone_walk; rte_openlog_stream; + rte_realloc; rte_set_application_usage_hook; rte_set_log_level; rte_set_log_type; @@ -94,6 +105,8 @@ DPDK_2.0 { rte_vlog; rte_xen_dom0_memory_attach; rte_xen_dom0_memory_init; + rte_zmalloc; + rte_zmalloc_socket; test_mp_secondary; local: *; diff --git a/lib/librte_hash/Makefile b/lib/librte_hash/Makefile index 039da46125..4bb3848a48 100644 --- a/lib/librte_hash/Makefile +++ b/lib/librte_hash/Makefile @@ -53,6 +53,6 @@ SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include += rte_thash.h SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include += rte_fbk_hash.h # this lib needs eal and ring -DEPDIRS-$(CONFIG_RTE_LIBRTE_HASH) += lib/librte_eal lib/librte_malloc lib/librte_ring +DEPDIRS-$(CONFIG_RTE_LIBRTE_HASH) += lib/librte_eal lib/librte_ring include $(RTE_SDK)/mk/rte.lib.mk diff --git a/lib/librte_lpm/Makefile b/lib/librte_lpm/Makefile index 35e6389d4b..0a7a888d50 100644 --- a/lib/librte_lpm/Makefile +++ b/lib/librte_lpm/Makefile @@ -48,6 +48,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_LPM) := rte_lpm.c rte_lpm6.c SYMLINK-$(CONFIG_RTE_LIBRTE_LPM)-include := rte_lpm.h rte_lpm6.h # this lib needs eal -DEPDIRS-$(CONFIG_RTE_LIBRTE_LPM) += lib/librte_eal lib/librte_malloc +DEPDIRS-$(CONFIG_RTE_LIBRTE_LPM) += lib/librte_eal include $(RTE_SDK)/mk/rte.lib.mk diff --git a/lib/librte_malloc/Makefile b/lib/librte_malloc/Makefile index 947e41c9d4..32d86b95c5 100644 --- a/lib/librte_malloc/Makefile +++ b/lib/librte_malloc/Makefile @@ -28,7 +28,6 @@ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - include $(RTE_SDK)/mk/rte.vars.mk # library name @@ -41,10 +40,7 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 EXPORT_MAP := rte_malloc_version.map # all source are stored in SRCS-y -SRCS-$(CONFIG_RTE_LIBRTE_MALLOC) := rte_malloc.c malloc_elem.c malloc_heap.c - -# install includes -SYMLINK-$(CONFIG_RTE_LIBRTE_MALLOC)-include := rte_malloc.h +SRCS-$(CONFIG_RTE_LIBRTE_MALLOC) := rte_malloc.c # this lib needs eal DEPDIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += lib/librte_eal diff --git a/lib/librte_malloc/rte_malloc.c b/lib/librte_malloc/rte_malloc.c index c313a57a67..4b9dc7f509 100644 --- a/lib/librte_malloc/rte_malloc.c +++ b/lib/librte_malloc/rte_malloc.c @@ -31,230 +31,4 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include "malloc_elem.h" -#include "malloc_heap.h" - - -/* Free the memory space back to heap */ -void rte_free(void *addr) -{ - if (addr == NULL) return; - if (malloc_elem_free(malloc_elem_from_data(addr)) < 0) - rte_panic("Fatal error: Invalid memory\n"); -} - -/* - * Allocate memory on specified heap. - */ -void * -rte_malloc_socket(const char *type, size_t size, unsigned align, int socket_arg) -{ - struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config; - int socket, i; - void *ret; - - /* return NULL if size is 0 or alignment is not power-of-2 */ - if (size == 0 || (align && !rte_is_power_of_2(align))) - return NULL; - - if (socket_arg == SOCKET_ID_ANY) - socket = malloc_get_numa_socket(); - else - socket = socket_arg; - - /* Check socket parameter */ - if (socket >= RTE_MAX_NUMA_NODES) - return NULL; - - ret = malloc_heap_alloc(&mcfg->malloc_heaps[socket], type, - size, align == 0 ? 1 : align); - if (ret != NULL || socket_arg != SOCKET_ID_ANY) - return ret; - - /* try other heaps */ - for (i = 0; i < RTE_MAX_NUMA_NODES; i++) { - /* we already tried this one */ - if (i == socket) - continue; - - ret = malloc_heap_alloc(&mcfg->malloc_heaps[i], type, - size, align == 0 ? 1 : align); - if (ret != NULL) - return ret; - } - - return NULL; -} - -/* - * Allocate memory on default heap. - */ -void * -rte_malloc(const char *type, size_t size, unsigned align) -{ - return rte_malloc_socket(type, size, align, SOCKET_ID_ANY); -} - -/* - * Allocate zero'd memory on specified heap. - */ -void * -rte_zmalloc_socket(const char *type, size_t size, unsigned align, int socket) -{ - void *ptr = rte_malloc_socket(type, size, align, socket); - - if (ptr != NULL) - memset(ptr, 0, size); - return ptr; -} - -/* - * Allocate zero'd memory on default heap. - */ -void * -rte_zmalloc(const char *type, size_t size, unsigned align) -{ - return rte_zmalloc_socket(type, size, align, SOCKET_ID_ANY); -} - -/* - * Allocate zero'd memory on specified heap. - */ -void * -rte_calloc_socket(const char *type, size_t num, size_t size, unsigned align, int socket) -{ - return rte_zmalloc_socket(type, num * size, align, socket); -} - -/* - * Allocate zero'd memory on default heap. - */ -void * -rte_calloc(const char *type, size_t num, size_t size, unsigned align) -{ - return rte_zmalloc(type, num * size, align); -} - -/* - * Resize allocated memory. - */ -void * -rte_realloc(void *ptr, size_t size, unsigned align) -{ - if (ptr == NULL) - return rte_malloc(NULL, size, align); - - struct malloc_elem *elem = malloc_elem_from_data(ptr); - if (elem == NULL) - rte_panic("Fatal error: memory corruption detected\n"); - - size = RTE_CACHE_LINE_ROUNDUP(size), align = RTE_CACHE_LINE_ROUNDUP(align); - /* check alignment matches first, and if ok, see if we can resize block */ - if (RTE_PTR_ALIGN(ptr,align) == ptr && - malloc_elem_resize(elem, size) == 0) - return ptr; - - /* either alignment is off, or we have no room to expand, - * so move data. */ - void *new_ptr = rte_malloc(NULL, size, align); - if (new_ptr == NULL) - return NULL; - const unsigned old_size = elem->size - MALLOC_ELEM_OVERHEAD; - rte_memcpy(new_ptr, ptr, old_size < size ? old_size : size); - rte_free(ptr); - - return new_ptr; -} - -int -rte_malloc_validate(const void *ptr, size_t *size) -{ - const struct malloc_elem *elem = malloc_elem_from_data(ptr); - if (!malloc_elem_cookies_ok(elem)) - return -1; - if (size != NULL) - *size = elem->size - elem->pad - MALLOC_ELEM_OVERHEAD; - return 0; -} - -/* - * Function to retrieve data for heap on given socket - */ -int -rte_malloc_get_socket_stats(int socket, - struct rte_malloc_socket_stats *socket_stats) -{ - struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config; - - if (socket >= RTE_MAX_NUMA_NODES || socket < 0) - return -1; - - return malloc_heap_get_stats(&mcfg->malloc_heaps[socket], socket_stats); -} - -/* - * Print stats on memory type. If type is NULL, info on all types is printed - */ -void -rte_malloc_dump_stats(FILE *f, __rte_unused const char *type) -{ - unsigned int socket; - struct rte_malloc_socket_stats sock_stats; - /* Iterate through all initialised heaps */ - for (socket=0; socket< RTE_MAX_NUMA_NODES; socket++) { - if ((rte_malloc_get_socket_stats(socket, &sock_stats) < 0)) - continue; - - fprintf(f, "Socket:%u\n", socket); - fprintf(f, "\tHeap_size:%zu,\n", sock_stats.heap_totalsz_bytes); - fprintf(f, "\tFree_size:%zu,\n", sock_stats.heap_freesz_bytes); - fprintf(f, "\tAlloc_size:%zu,\n", sock_stats.heap_allocsz_bytes); - fprintf(f, "\tGreatest_free_size:%zu,\n", - sock_stats.greatest_free_size); - fprintf(f, "\tAlloc_count:%u,\n",sock_stats.alloc_count); - fprintf(f, "\tFree_count:%u,\n", sock_stats.free_count); - } - return; -} - -/* - * TODO: Set limit to memory that can be allocated to memory type - */ -int -rte_malloc_set_limit(__rte_unused const char *type, - __rte_unused size_t max) -{ - return 0; -} - -/* - * Return the physical address of a virtual address obtained through rte_malloc - */ -phys_addr_t -rte_malloc_virt2phy(const void *addr) -{ - const struct malloc_elem *elem = malloc_elem_from_data(addr); - if (elem == NULL) - return 0; - return elem->mz->phys_addr + ((uintptr_t)addr - (uintptr_t)elem->mz->addr); -} +/* Empty file to be able to create a dummy library for deprecation policy */ diff --git a/lib/librte_malloc/rte_malloc_version.map b/lib/librte_malloc/rte_malloc_version.map index af6ae9bca2..63cb5fcbbd 100644 --- a/lib/librte_malloc/rte_malloc_version.map +++ b/lib/librte_malloc/rte_malloc_version.map @@ -1,19 +1,3 @@ DPDK_2.0 { - global: - - rte_calloc; - rte_calloc_socket; - rte_free; - rte_malloc; - rte_malloc_dump_stats; - rte_malloc_get_socket_stats; - rte_malloc_set_limit; - rte_malloc_socket; - rte_malloc_validate; - rte_malloc_virt2phy; - rte_realloc; - rte_zmalloc; - rte_zmalloc_socket; - local: *; }; diff --git a/lib/librte_mempool/Makefile b/lib/librte_mempool/Makefile index 940d1f77ac..a6898eff8d 100644 --- a/lib/librte_mempool/Makefile +++ b/lib/librte_mempool/Makefile @@ -48,8 +48,6 @@ endif # install includes SYMLINK-$(CONFIG_RTE_LIBRTE_MEMPOOL)-include := rte_mempool.h -# this lib needs eal, rte_ring and rte_malloc DEPDIRS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += lib/librte_eal lib/librte_ring -DEPDIRS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += lib/librte_malloc include $(RTE_SDK)/mk/rte.lib.mk diff --git a/lib/librte_port/Makefile b/lib/librte_port/Makefile index de960fc62b..ddbb38388e 100644 --- a/lib/librte_port/Makefile +++ b/lib/librte_port/Makefile @@ -70,7 +70,6 @@ SYMLINK-$(CONFIG_RTE_LIBRTE_PORT)-include += rte_port_source_sink.h DEPDIRS-$(CONFIG_RTE_LIBRTE_PORT) := lib/librte_eal DEPDIRS-$(CONFIG_RTE_LIBRTE_PORT) += lib/librte_mbuf DEPDIRS-$(CONFIG_RTE_LIBRTE_PORT) += lib/librte_mempool -DEPDIRS-$(CONFIG_RTE_LIBRTE_PORT) += lib/librte_malloc DEPDIRS-$(CONFIG_RTE_LIBRTE_PORT) += lib/librte_ether DEPDIRS-$(CONFIG_RTE_LIBRTE_PORT) += lib/librte_ip_frag diff --git a/lib/librte_ring/Makefile b/lib/librte_ring/Makefile index 84ad3d336d..4b1112e417 100644 --- a/lib/librte_ring/Makefile +++ b/lib/librte_ring/Makefile @@ -46,7 +46,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_RING) := rte_ring.c # install includes SYMLINK-$(CONFIG_RTE_LIBRTE_RING)-include := rte_ring.h -# this lib needs eal and rte_malloc -DEPDIRS-$(CONFIG_RTE_LIBRTE_RING) += lib/librte_eal lib/librte_malloc +DEPDIRS-$(CONFIG_RTE_LIBRTE_RING) += lib/librte_eal include $(RTE_SDK)/mk/rte.lib.mk diff --git a/lib/librte_table/Makefile b/lib/librte_table/Makefile index 0d8394c723..c5b3eaf152 100644 --- a/lib/librte_table/Makefile +++ b/lib/librte_table/Makefile @@ -75,7 +75,6 @@ SYMLINK-$(CONFIG_RTE_LIBRTE_TABLE)-include += rte_table_stub.h DEPDIRS-$(CONFIG_RTE_LIBRTE_TABLE) := lib/librte_eal DEPDIRS-$(CONFIG_RTE_LIBRTE_TABLE) += lib/librte_mbuf DEPDIRS-$(CONFIG_RTE_LIBRTE_TABLE) += lib/librte_mempool -DEPDIRS-$(CONFIG_RTE_LIBRTE_TABLE) += lib/librte_malloc DEPDIRS-$(CONFIG_RTE_LIBRTE_TABLE) += lib/librte_port DEPDIRS-$(CONFIG_RTE_LIBRTE_TABLE) += lib/librte_lpm ifeq ($(CONFIG_RTE_LIBRTE_ACL),y) -- 2.20.1