diff options
author | Kevin Traynor <ktraynor@redhat.com> | 2022-06-24 11:13:23 +0100 |
---|---|---|
committer | Ian Stokes <ian.stokes@intel.com> | 2022-07-14 13:17:59 +0100 |
commit | 3757e9f8e9c3190cf981740fec662e84b12d07ef (patch) | |
tree | e8978d4016aefca9a1e54890bf192b971eeb63bc /Documentation/topics/dpdk/memory.rst | |
parent | eacc544c4d45315844d15a6b36aa3301eb8f83d4 (diff) | |
download | openvswitch-3757e9f8e9c3190cf981740fec662e84b12d07ef.tar.gz |
netdev-dpdk: Add shared mempool config.
Mempools may currently be shared between DPDK ports based
on port MTU and NUMA. With some hint from the user we can
increase the sharing on MTU and hence reduce memory
consumption in many cases.
For example, a port with MTU 9000, uses a mempool with an
mbuf size based on 9000 MTU. A port with MTU 1500, uses a
different mempool with an mbuf size based on 1500 MTU.
In this case, assuming same NUMA, both these ports could
share the 9000 MTU mempool.
The user must give a hint as order of creation of ports and
setting of MTUs may vary and we need to ensure that upgrades
from older OVS versions do not require more memory.
This scheme can also prevent multiple mempools being created
for cases where a port is added picking up a default MTU and
an appropriate mempool, but later has it's MTU changed to a
different value requiring a different mempool.
Example usage:
$ ovs-vsctl --no-wait set Open_vSwitch . \
other_config:shared-mempool-config=9000,1500:1,6000:1
Port added on NUMA 0:
* MTU 1500, use mempool based on 9000 MTU
* MTU 5000, use mempool based on 9000 MTU
* MTU 9000, use mempool based on 9000 MTU
* MTU 9300, use mempool based on 9300 MTU (existing behaviour)
Port added on NUMA 1:
* MTU 1500, use mempool based on 1500 MTU
* MTU 5000, use mempool based on 6000 MTU
* MTU 9000, use mempool based on 9000 MTU
* MTU 9300, use mempool based on 9300 MTU (existing behaviour)
Default behaviour is unchanged and mempools are still only created
when needed.
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Sunil Pai G <sunil.pai.g@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Diffstat (limited to 'Documentation/topics/dpdk/memory.rst')
-rw-r--r-- | Documentation/topics/dpdk/memory.rst | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Documentation/topics/dpdk/memory.rst b/Documentation/topics/dpdk/memory.rst index 8b7758e6e..9714d79d4 100644 --- a/Documentation/topics/dpdk/memory.rst +++ b/Documentation/topics/dpdk/memory.rst @@ -213,3 +213,47 @@ Example 3: (2 rxq, 2 PMD, 9000 MTU) Number of mbufs = (2 * 2048) + (3 * 2048) + (1 * 32) + (16384) = 26656 Mbuf size = 10176 Bytes Memory required = 26656 * 10176 = 271 MB + +Shared Mempool Configuration +---------------------------- + +In order to increase sharing of mempools, a user can configure the MTUs which +mempools are based on by using ``shared-mempool-config``. + +An MTU configured by the user is adjusted to an mbuf size used for mempool +creation and stored. If a port is subsequently added that has an MTU which can +be accommodated by this mbuf size, it will be used for mempool creation/reuse. + +This can increase sharing by consolidating mempools for ports with different +MTUs which would otherwise use separate mempools. It can also help to remove +the need for mempools being created after a port is added but before it's MTU +is changed to a different value. + +For example, on a 2 NUMA system:: + + $ ovs-vsctl ovs-vsctl --no-wait set Open_vSwitch . \ + other_config:shared-mempool-config=9000,1500:1,6000:1 + + +In this case, OVS stores the mbuf sizes based on the following MTUs. + +* NUMA 0: 9000 +* NUMA 1: 1500, 6000, 9000 + +Ports added will use mempools with the mbuf sizes based on the above MTUs where +possible. If there is more than one suitable, the one closest to the MTU will +be selected. + +Port added on NUMA 0: + +* MTU 1500, use mempool based on 9000 MTU +* MTU 6000, use mempool based on 9000 MTU +* MTU 9000, use mempool based on 9000 MTU +* MTU 9300, use mempool based on 9300 MTU (existing behaviour) + +Port added on NUMA 1: + +* MTU 1500, use mempool based on 1500 MTU +* MTU 6000, use mempool based on 6000 MTU +* MTU 9000, use mempool based on 9000 MTU +* MTU 9300, use mempool based on 9300 MTU (existing behaviour) |