From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 06A57A0540; Wed, 15 Jul 2020 06:00:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E0E971C1A8; Wed, 15 Jul 2020 06:00:12 +0200 (CEST) Received: from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130]) by dpdk.org (Postfix) with ESMTP id 0D96A1C1A7 for ; Wed, 15 Jul 2020 06:00:11 +0200 (CEST) From: Suanming Mou To: viacheslavo@mellanox.com, matan@mellanox.com Cc: orika@mellanox.com, rasland@mellanox.com, dev@dpdk.org Date: Wed, 15 Jul 2020 11:59:56 +0800 Message-Id: <1594785603-152773-1-git-send-email-suanmingm@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH 0/7] net/mlx5: add sys_mem_en devarg X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Currently, for MLX5 PMD, once millions of flows created, the memory consumption of the flows are also very huge. For the system with limited memory, it means the system need to reserve most of the memory as huge page memory to serve the flows in advance. And other normal applications will have no chance to use this reserved memory any more. While most of the time, the system will not have lots of flows, the reserved huge page memory becomes a bit waste of memory at most of the time. By the new sys_mem_en devarg, once set it to be true, it allows the PMD allocate the memory from system by default with the new add mlx5 memory management functions. Only once the MLX5_MEM_RTE flag is set, the memory will be allocate from rte, otherwise, it allocates memory from system. So in this case, the system with limited memory no need to reserve most of the memory for hugepage. Only some needed memory for datapath objects will be enough to allocated with explicitly flag. Other memory will be allocated from system. For system with enough memory, no need to care about the devarg, the memory will always be from rte hugepage. One restriction is that for DPDK application with multiple PCI devices, if the sys_mem_en devargs are different between the devices, the sys_mem_en only gets the value from the first device devargs, and print out a message to warn that. Suanming Mou (7): common/mlx5: add mlx5 memory management functions net/mlx5: add allocate memory from system devarg net/mlx5: convert control path memory to unified malloc common/mlx5: convert control path memory to unified malloc common/mlx5: convert data path objects to unified malloc net/mlx5: convert configuration objects to unified malloc net/mlx5: convert Rx/Tx queue objects to unified malloc doc/guides/nics/mlx5.rst | 7 + drivers/common/mlx5/Makefile | 1 + drivers/common/mlx5/linux/mlx5_glue.c | 13 +- drivers/common/mlx5/linux/mlx5_nl.c | 5 +- drivers/common/mlx5/meson.build | 1 + drivers/common/mlx5/mlx5_common.c | 10 +- drivers/common/mlx5/mlx5_common_mp.c | 7 +- drivers/common/mlx5/mlx5_common_mr.c | 31 ++-- drivers/common/mlx5/mlx5_devx_cmds.c | 75 +++++---- drivers/common/mlx5/mlx5_malloc.c | 214 ++++++++++++++++++++++++ drivers/common/mlx5/mlx5_malloc.h | 93 ++++++++++ drivers/common/mlx5/rte_common_mlx5_version.map | 5 + drivers/net/mlx5/linux/mlx5_ethdev_os.c | 8 +- drivers/net/mlx5/linux/mlx5_os.c | 28 ++-- drivers/net/mlx5/mlx5.c | 108 ++++++------ drivers/net/mlx5/mlx5.h | 1 + drivers/net/mlx5/mlx5_ethdev.c | 15 +- drivers/net/mlx5/mlx5_flow.c | 45 ++--- drivers/net/mlx5/mlx5_flow_dv.c | 46 ++--- drivers/net/mlx5/mlx5_flow_meter.c | 11 +- drivers/net/mlx5/mlx5_flow_verbs.c | 8 +- drivers/net/mlx5/mlx5_mp.c | 3 +- drivers/net/mlx5/mlx5_rss.c | 13 +- drivers/net/mlx5/mlx5_rxq.c | 74 ++++---- drivers/net/mlx5/mlx5_txq.c | 44 +++-- drivers/net/mlx5/mlx5_utils.c | 60 ++++--- drivers/net/mlx5/mlx5_utils.h | 2 +- drivers/net/mlx5/mlx5_vlan.c | 8 +- 28 files changed, 660 insertions(+), 276 deletions(-) create mode 100644 drivers/common/mlx5/mlx5_malloc.c create mode 100644 drivers/common/mlx5/mlx5_malloc.h -- 1.8.3.1