DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: David Marchand <david.marchand@redhat.com>, dev@dpdk.org
Cc: thomas@monjalon.net, Wenzhuo Lu <wenzhuo.lu@intel.com>,
	Jingjing Wu <jingjing.wu@intel.com>,
	Bernard Iremonger <bernard.iremonger@intel.com>
Subject: Re: [dpdk-dev] [PATCH] app/testpmd: reduce memory consumption
Date: Thu, 21 Nov 2019 15:36:10 +0000	[thread overview]
Message-ID: <8055a2ec-42ef-30c2-5452-b0e8b92caa87@intel.com> (raw)
In-Reply-To: <20191121151256.20613-1-david.marchand@redhat.com>

On 11/21/2019 3:12 PM, David Marchand wrote:
> 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 <david.marchand@redhat.com>

Thanks for figuring this out,
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

<...>

> diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
> index 90694a3309..217d577018 100644
> --- a/app/test-pmd/testpmd.h
> +++ b/app/test-pmd/testpmd.h
> @@ -58,8 +58,6 @@ typedef uint16_t portid_t;
>  typedef uint16_t queueid_t;
>  typedef uint16_t streamid_t;
>  
> -#define MAX_QUEUE_ID ((1 << (sizeof(queueid_t) * 8)) - 1)

No strong opinion, but would it be simpler if assign 'MAX_QUEUE_ID' to
'RTE_MAX_QUEUES_PER_PORT' instead?
#define MAX_QUEUE_ID RTE_MAX_QUEUES_PER_PORT


  reply	other threads:[~2019-11-21 15:36 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-21 15:12 David Marchand
2019-11-21 15:36 ` Ferruh Yigit [this message]
2019-11-21 16:17   ` David Marchand
2019-11-21 16:23     ` David Marchand
2019-11-21 21:22       ` Thomas Monjalon
2019-11-21 16:45 ` Stephen Hemminger
2019-11-21 20:32   ` David Marchand
2019-11-21 21:25 ` Thomas Monjalon
2019-11-21 21:55   ` Thomas Monjalon
2019-11-22 10:43 ` [dpdk-dev] [PATCH v2] " David Marchand
2019-11-22 12:24   ` Ferruh Yigit
2019-11-22 13:12     ` Thomas Monjalon
2019-11-22 13:14       ` Ferruh Yigit
2019-11-22 13:48         ` [dpdk-dev] [PATCH] devtools: disable automatic probing in null testing Thomas Monjalon
2019-11-22 13:56           ` Ferruh Yigit
2019-11-22 15:56             ` David Marchand
2019-11-24 22:52               ` Thomas Monjalon
2019-11-22 14:03           ` Gaëtan Rivet
2019-11-22 14:36             ` Thomas Monjalon
2019-11-22 14:14   ` [dpdk-dev] [PATCH v2] app/testpmd: reduce memory consumption Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8055a2ec-42ef-30c2-5452-b0e8b92caa87@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=bernard.iremonger@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=thomas@monjalon.net \
    --cc=wenzhuo.lu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).