* hugepages on both sockets
@ 2025-04-04 22:24 Lombardo, Ed
2025-04-04 22:39 ` Dmitry Kozlyuk
0 siblings, 1 reply; 4+ messages in thread
From: Lombardo, Ed @ 2025-04-04 22:24 UTC (permalink / raw)
To: users
[-- Attachment #1: Type: text/plain, Size: 1621 bytes --]
Hi,
I tried to pass into dpdk_eal_init() the argument --socket-mem=2048,2048" and I get segmentation error when strsplit() function is called
arg_num = rte_strsplit(strval, len,
arg, RTE_MAX_NUMA_NODES, ',');
In eal_common_string_fns.c gdb failed at the line shown below.
rte_strsplit(char *string, int stringlen,
char **tokens, int maxtokens, char delim)
{
int i, tok = 0;
int tokstart = 1; /* first token is right at start of string */
if (string == NULL || tokens == NULL)
goto einval_error;
for (i = 0; i < stringlen; i++) {
if (string[i] == '\0' || tok >= maxtokens)
break;
if (tokstart) {
tokstart = 0;
tokens[tok++] = &string[i];
}
if (string[i] == delim) {
string[i] = '\0'; <<<< Fails here with segmentation fault.
tokstart = 1;
}
}
return tok;
If I pass "--socket_mem=2048", --socket-mem=2048", rte_eal_init() does not complain.
Not sure if this would ensure both CPU sockets will host 2-1G hugepages? I suspect it doesn't because I only see to rtemap_0 and rtemap_1 in /mnt/huge directory. I think I should see four total.
# /opt/dpdk/dpdk-hugepages.py -s
Node Pages Size Total
0 2 1Gb 2Gb
1 2 1Gb 2Gb
I don't know if I should believe the above output showing 2Gb on Numa Nodes 0 and 1.
Any help is appreciated.
Thanks,
Ed
[-- Attachment #2: Type: text/html, Size: 6264 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: hugepages on both sockets
2025-04-04 22:24 hugepages on both sockets Lombardo, Ed
@ 2025-04-04 22:39 ` Dmitry Kozlyuk
2025-04-06 0:56 ` Lombardo, Ed
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Kozlyuk @ 2025-04-04 22:39 UTC (permalink / raw)
To: Lombardo, Ed, users
Hi Ed,
On 05.04.2025 01:24, Lombardo, Ed wrote:
>
> Hi,
>
> I tried to pass into dpdk_eal_init() the argument
> --socket-mem=2048,2048” and I get segmentation error when strsplit()
> function is called
>
> arg_num = rte_strsplit(strval, len,
>
> arg, RTE_MAX_NUMA_NODES, ',');
>
Please forgive me for the stupid question:
"strval" points to a mutable buffer, like "char strval[] = "2048,2048",
not "char *strval = "2048,2048"?
> If I pass “--socket_mem=2048”, --socket-mem=2048”, rte_eal_init() does
> not complain.
>
> Not sure if this would ensure both CPU sockets will host 2-1G
> hugepages? I suspect it doesn’t because I only see to rtemap_0 and
> rtemap_1 in /mnt/huge directory. I think I should see four total.
>
> # /opt/dpdk/dpdk-hugepages.py -s
>
> Node Pages Size Total
>
> 0 2 1Gb 2Gb
>
> 1 2 1Gb 2Gb
>
> I don’t know if I should believe the above output showing 2Gb on Numa
> Nodes 0 and 1.
>
You are correct, --socket-mem=2048 allocates 2048 MB total, spreading
between nodes.
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: hugepages on both sockets
2025-04-04 22:39 ` Dmitry Kozlyuk
@ 2025-04-06 0:56 ` Lombardo, Ed
2025-04-06 15:38 ` Stephen Hemminger
0 siblings, 1 reply; 4+ messages in thread
From: Lombardo, Ed @ 2025-04-06 0:56 UTC (permalink / raw)
To: Dmitry Kozlyuk, users
Hi Dmitry,
You pointed out a good point. I passed the literal "--socket-mem=2048,2048" in the array provided to rte_eal_init() function, where DPDK EAL tries to tokenize in place the string and it crashes trying to modify a readonly memory. I don't know why DPDK does this. But now I know, and I now see four rtemap_x files created for two sockets.
Thank you,
Ed
-----Original Message-----
From: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Sent: Friday, April 4, 2025 6:40 PM
To: Lombardo, Ed <Ed.Lombardo@netscout.com>; users@dpdk.org
Subject: Re: hugepages on both sockets
External Email: This message originated outside of NETSCOUT. Do not click links or open attachments unless you recognize the sender and know the content is safe.
Hi Ed,
On 05.04.2025 01:24, Lombardo, Ed wrote:
>
> Hi,
>
> I tried to pass into dpdk_eal_init() the argument
> --socket-mem=2048,2048” and I get segmentation error when strsplit()
> function is called
>
> arg_num = rte_strsplit(strval, len,
>
> arg, RTE_MAX_NUMA_NODES, ',');
>
Please forgive me for the stupid question:
"strval" points to a mutable buffer, like "char strval[] = "2048,2048", not "char *strval = "2048,2048"?
> If I pass “--socket_mem=2048”, --socket-mem=2048”, rte_eal_init() does
> not complain.
>
> Not sure if this would ensure both CPU sockets will host 2-1G
> hugepages? I suspect it doesn’t because I only see to rtemap_0 and
> rtemap_1 in /mnt/huge directory. I think I should see four total.
>
> # /opt/dpdk/dpdk-hugepages.py -s
>
> Node Pages Size Total
>
> 0 2 1Gb 2Gb
>
> 1 2 1Gb 2Gb
>
> I don’t know if I should believe the above output showing 2Gb on Numa
> Nodes 0 and 1.
>
You are correct, --socket-mem=2048 allocates 2048 MB total, spreading between nodes.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: hugepages on both sockets
2025-04-06 0:56 ` Lombardo, Ed
@ 2025-04-06 15:38 ` Stephen Hemminger
0 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2025-04-06 15:38 UTC (permalink / raw)
To: Lombardo, Ed; +Cc: Dmitry Kozlyuk, users
On Sun, 6 Apr 2025 00:56:45 +0000
"Lombardo, Ed" <Ed.Lombardo@netscout.com> wrote:
> Hi Dmitry,
> You pointed out a good point. I passed the literal "--socket-mem=2048,2048" in the array provided to rte_eal_init() function, where DPDK EAL tries to tokenize in place the string and it crashes trying to modify a readonly memory. I don't know why DPDK does this. But now I know, and I now see four rtemap_x files created for two sockets.
The function rte_eal_init() expects arguments to be like the arguments passed to main().
Those arguments are not read-only. You need to use strdup (or strdupa) to make mutable versions.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-04-06 15:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-04 22:24 hugepages on both sockets Lombardo, Ed
2025-04-04 22:39 ` Dmitry Kozlyuk
2025-04-06 0:56 ` Lombardo, Ed
2025-04-06 15:38 ` Stephen Hemminger
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).