From: Suanming Mou <suanmingm@mellanox.com>
To: Matan Azrad <matan@mellanox.com>, viacheslavo@mellanox.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [RFC] net/mlx5: memory optimization for flow
Date: Mon, 16 Mar 2020 10:54:53 +0800 [thread overview]
Message-ID: <176d3eb4-e591-1609-a7b9-0bfaf9a7fa25@mellanox.com> (raw)
Once there are millions of flows be created, the memory consumption of
one flow will become more sensitive. A byte memory means Mbytes
consumption with millions of flows. In this case, to take care of every
bytes the flow costed becomes more important.
We are planning to save the memory consumption with flow creation step
by step.
Step 1, currently, the mlx5 rte_flow is composed with the mlx5_flow
subflows. The data struct memory optimization will mainly focus on the
two structs.
1. Merge the struct members those can be as union.
2. The members in the mlx5_flow subflows which are both same in the
rte_flow will be moved to save only in rte_flow struct. It’s not
needed to save the copies of the same actions in every mlx5_flow
subflows.
3. The members in the struct use limited bits will be stripped to the
bits only they are needed.
4. The structs aligned with holes will be reconstructed.
5. Some global limited resources such as port_id actions may not be
recorded in the flow data struct to save the pointer memory and only
to released when port is closed.
Step 2, as flow creation will allocate several small memory blocks, such
as the rte_flow memory, mlx5_flow memory, actions memory, the small
memory blocks will be allocated from pools to avoid the overhead of
every rte_malloc().
Step 3, data struct which stands for several mode may split for
individual mode, such as currently the struct mlx5_flow_counter contains
the members both batch and none-batch mode. The split of the members
will save the bytes of counters in the pool with different mode.
Thanks
SuanmingMou
reply other threads:[~2020-03-16 2:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=176d3eb4-e591-1609-a7b9-0bfaf9a7fa25@mellanox.com \
--to=suanmingm@mellanox.com \
--cc=dev@dpdk.org \
--cc=matan@mellanox.com \
--cc=viacheslavo@mellanox.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).