From: Phil Yang <phil.yang@arm.com>
To: stable@dpdk.org
Cc: bluca@debian.org
Subject: [dpdk-stable] [PATCH 16.11 3/3] app/testpmd: reserve NUMA node per device port and per ring
Date: Fri, 2 Nov 2018 15:40:17 +0800 [thread overview]
Message-ID: <1541144417-11169-3-git-send-email-phil.yang@arm.com> (raw)
In-Reply-To: <1541144417-11169-1-git-send-email-phil.yang@arm.com>
[ backported from upstream commit a569af2481cd3bd29e5c6d49f2d2f95586d750a8 ]
If user explicitly requested memory to be allocated from a socket via
`port-numa-config` and `rxring-numa-config`, and if that socket is
valid, add that socket into socket_ids[] so that mempool allocated for
that socket.
Fixes: dbfb8ec ("app/testpmd: optimize mbuf pool allocation")
Signed-off-by: Phil Yang <phil.yang@arm.com>
Suggested-by: Yigit Ferruh <ferruh.yigit@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
app/test-pmd/parameters.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 84e7a63..6fe1ee6 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -435,8 +435,11 @@ parse_portnuma_config(const char *q_arg)
}
socket_id = (uint8_t)int_fld[FLD_SOCKET];
if (new_socket_id(socket_id)) {
- print_invalid_socket_id_error();
- return -1;
+ if (num_sockets >= RTE_MAX_NUMA_NODES) {
+ print_invalid_socket_id_error();
+ return -1;
+ }
+ socket_ids[num_sockets++] = socket_id;
}
port_numa[port_id] = socket_id;
}
@@ -496,8 +499,11 @@ parse_ringnuma_config(const char *q_arg)
}
socket_id = (uint8_t)int_fld[FLD_SOCKET];
if (new_socket_id(socket_id)) {
- print_invalid_socket_id_error();
- return -1;
+ if (num_sockets >= RTE_MAX_NUMA_NODES) {
+ print_invalid_socket_id_error();
+ return -1;
+ }
+ socket_ids[num_sockets++] = socket_id;
}
ring_flag = (uint8_t)int_fld[FLD_FLAG];
if ((ring_flag < RX_RING_ONLY) || (ring_flag > RXTX_RING)) {
--
2.7.4
next prev parent reply other threads:[~2018-11-02 7:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-02 7:40 [dpdk-stable] [PATCH 16.11 1/3] app/testpmd: fix vdev socket initialization Phil Yang
2018-11-02 7:40 ` [dpdk-stable] [PATCH 16.11 2/3] app/testpmd: fix physic port " Phil Yang
2018-11-02 7:40 ` Phil Yang [this message]
2018-11-02 10:42 ` [dpdk-stable] [PATCH 16.11 1/3] app/testpmd: fix vdev " Luca Boccassi
2018-11-03 10:10 ` Phil Yang (Arm Technology China)
2018-11-03 10:53 ` Luca Boccassi
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=1541144417-11169-3-git-send-email-phil.yang@arm.com \
--to=phil.yang@arm.com \
--cc=bluca@debian.org \
--cc=stable@dpdk.org \
/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).