numam-dpdk/app/test-pmd
Dmitry Kozlyuk 13b196425c app/testpmd: fix external buffer allocation
External pinned buffer memory (--mp-alloc=xbuf)
was allocated as multiple IOVA-contiguous memzones
of 2M size and 2M alignment.
Due to the malloc overhead and the alignment requirement,
each 2M memzone consumed 4M of hugepage memory:
2M of usable memory + X of malloc overhead + (2M-X) padding.
The allocation often failed with 2M hugepages and IOVA-as-PA
if a PA-contiguous span of 2 hugepages could not be found.
Also, with any hugepage size and IOVA mode
memory consumption was almost 2x of the usable amount.

Alignment requirement of 2M for external buffers is redundant.
It was an attempt to ensure IOVA-contiguity
by forcing memzones to start at hugepage boundaries,
while 2M size intended to leave no unused space on the page.
As shown above, this in fact caused excessive memory consumption
and decreased the chance of a successful allocation.
RTE_MEMZONE_F_IOVA_CONTIG already ensures IOVA-contiguity.

Remove the alignment requirement.
Reduce the memzone size by the malloc overhead size (4 cache lines),
so that memory consumption for each memzone is
(2M-X) of usable memory + X of malloc overhead = 2M.
This also means that whenever there are free 2M hugepages,
an IOVA-contiguous memzone can always be allocated.

Fixes: 72512e1897 ("app/testpmd: add mempool with external data buffers")
Cc: stable@dpdk.org

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2022-01-18 14:22:15 +01:00
..
5tswap.c net: rename Ethernet header fields 2021-10-08 14:58:11 +02:00
bpf_cmd.c app/testpmd: send failure logs to stderr 2021-07-24 15:12:57 +02:00
bpf_cmd.h build: replace use of old build macros 2020-10-19 22:15:44 +02:00
cmd_flex_item.c app/testpmd: fix flex item flush 2021-11-05 22:19:38 +01:00
cmdline_flow.c app/testpmd: fix dereference before null check 2022-01-18 14:02:48 +01:00
cmdline_mtr.c app/testpmd: fix access to DSCP table entries 2021-10-19 18:10:28 +02:00
cmdline_mtr.h app/testpmd: support policy actions per color 2021-04-21 12:22:18 +02:00
cmdline_tm.c fix spelling in comments and strings 2022-01-11 12:16:53 +01:00
cmdline_tm.h app/testpmd: add TM command for non-leaf and packet mode 2020-09-18 18:55:10 +02:00
cmdline.c fix spelling in comments and strings 2022-01-11 12:16:53 +01:00
config.c app/testpmd: fix tunnel offload validation 2021-11-17 13:12:56 +01:00
csumonly.c fix spelling in comments and strings 2022-01-11 12:16:53 +01:00
flowgen.c app: remove unneeded atomic header include 2021-11-17 11:07:06 +01:00
icmpecho.c app: remove unneeded atomic header include 2021-11-17 11:07:06 +01:00
ieee1588fwd.c mbuf: add namespace to offload flags 2021-10-24 13:37:43 +02:00
iofwd.c app: remove unneeded atomic header include 2021-11-17 11:07:06 +01:00
macfwd.c app: remove unneeded atomic header include 2021-11-17 11:07:06 +01:00
macswap_common.h mbuf: add namespace to offload flags 2021-10-24 13:37:43 +02:00
macswap_neon.h net: add rte prefix to ether structures 2019-05-24 13:34:45 +02:00
macswap_sse.h net: add rte prefix to ether structures 2019-05-24 13:34:45 +02:00
macswap.c app: remove unneeded atomic header include 2021-11-17 11:07:06 +01:00
macswap.h net: rename Ethernet header fields 2021-10-08 14:58:11 +02:00
meson.build build: make metrics libraries optional 2021-11-17 12:48:33 +01:00
noisy_vnf.c app/testpmd: update forward engine beginning 2021-10-08 18:57:48 +02:00
parameters.c fix spelling in comments and strings 2022-01-11 12:16:53 +01:00
rxonly.c app: remove unneeded atomic header include 2021-11-17 11:07:06 +01:00
shared_rxq_fwd.c app/testpmd: add forwarding engine for shared Rx queue 2021-10-22 00:09:19 +02:00
testpmd.c app/testpmd: fix external buffer allocation 2022-01-18 14:22:15 +01:00
testpmd.h app/testpmd: fix Tx scheduling interval 2022-01-14 18:02:30 +01:00
txonly.c app/testpmd: fix Tx scheduling interval 2022-01-14 18:02:30 +01:00
util.c app/testpmd: fix flow transfer proxy port handling 2021-11-17 11:26:27 +01:00