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 A1353A04C7; Thu, 21 Nov 2019 22:55:41 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 496AA2BAE; Thu, 21 Nov 2019 22:55:40 +0100 (CET) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 224302BA8 for ; Thu, 21 Nov 2019 22:55:38 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 5382922206; Thu, 21 Nov 2019 16:55:37 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 21 Nov 2019 16:55:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=xBSJeT1wKdEGqTbnVni1zQj08fON42zoyGqroa8kWP0=; b=TPFTnlWXYzqr hDA3ggrJ737bAYofmXmFd6ulkvNDiMuUeud0tzDdrgOSWiSE131e1DNSa6bLs5IQ MgOUNy3T8R/6GuHBYoUrcIsrUsEOI+OQ1+kfJMgRu0kiqGHv5RXXXmZL3jtWAI03 ifsYTnQHYthOuWMofLs0IfIbg8oiDOw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=xBSJeT1wKdEGqTbnVni1zQj08fON42zoyGqroa8kW P0=; b=HdurRF/CdfGMPZcQx6OK5Fm0MlY0VGlycWktZ4kdIamr2DsLahTn5B2Br py5kBAjh8/wYd/nkhX18QTCsQxKYIIhGCf6rVfKRD3Roz+p/bI86jrjIWjf3xUQ4 5VC8u+0d593zf88P3elCwF/DstKgGiEXSIUctuZbOabGYtwGkxoDkJ240CSE7CZc 5q1ayXjfjGRbvk8rfxNoiVbVaJyCCQJLAulSU4yeSfYWFo2G9wznHyg+4w7szBXD LSJmoHwUypGD6HqDMC1rrlETQmiJDrasdGR15LuNr+buk+w7OzXR2pUN84Jd7Xy0 2F5LboVbohRjIBVxkdH88Uw36zf7A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudehvddgudehiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ffohhmrghinhepughpughkrdhorhhgnecukfhppeejjedrudefgedrvddtfedrudekgeen ucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth enucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id A354C306005C; Thu, 21 Nov 2019 16:55:35 -0500 (EST) From: Thomas Monjalon To: David Marchand Cc: dev@dpdk.org, ferruh.yigit@intel.com, Wenzhuo Lu , Jingjing Wu , Bernard Iremonger Date: Thu, 21 Nov 2019 22:55:34 +0100 Message-ID: <1777736.27kYGzxk74@xps> In-Reply-To: <16929516.SoWFOtNGnN@xps> References: <20191121151256.20613-1-david.marchand@redhat.com> <16929516.SoWFOtNGnN@xps> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] app/testpmd: reduce memory consumption 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" 21/11/2019 22:25, Thomas Monjalon: > 21/11/2019 16:12, David Marchand: > > Following [1], testpmd memory consumption has skyrocketted. > > The rte_port structure has gotten quite fat. > > > > struct rte_port { > > [...] > > struct rte_eth_rxconf rx_conf[65536]; /* 266280 3145728 */ > > /* --- cacheline 53312 boundary (3411968 bytes) was 40 bytes ago --- */ > > struct rte_eth_txconf tx_conf[65536]; /* 3412008 3670016 */ > > /* --- cacheline 110656 boundary (7081984 bytes) was 40 bytes ago --- */ > > [...] > > /* size: 8654936, cachelines: 135234, members: 31 */ > > [...] > > > > testpmd handles RTE_MAX_ETHPORTS ports (32 by default) which means that it > > needs ~256MB just for this internal representation. > > > > The reason is that a testpmd rte_port (the name is quite confusing, as > > it is a local type) maintains configurations for all queues of a port. > > But where you would expect testpmd to use RTE_MAX_QUEUES_PER_PORT as the > > maximum queue count, the rte_port uses MAX_QUEUE_ID set to 64k. > > > > Prefer the ethdev maximum value. > > > > After this patch: > > struct rte_port { > > [...] > > struct rte_eth_rxconf rx_conf[1025]; /* 8240 49200 */ > > /* --- cacheline 897 boundary (57408 bytes) was 32 bytes ago --- */ > > struct rte_eth_txconf tx_conf[1025]; /* 57440 57400 */ > > /* --- cacheline 1794 boundary (114816 bytes) was 24 bytes ago --- */ > > [...] > > /* size: 139488, cachelines: 2180, members: 31 */ > > [...] > > > > [1]: https://git.dpdk.org/dpdk/commit/?id=436b3a6b6e62 > > > > Signed-off-by: David Marchand > > Acked-by: Thomas Monjalon > > I was really concerned by the memory requirement increase > due to my patch on ethdev structs. > Thank you for finding these giant arrays. After testing this patch, I realized that you can decrease the memory requirement of test-null.sh from 150 (300 in patch [1]) to only 20 MB. The following patch [1] was workarounding the big memory requirement by increasing the allocated memory to 300 MB. [1] https://patches.dpdk.org/patch/63151/