DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] RTE Hash addition results to segmentation fault
@ 2020-10-22 12:03 Jatin Sahu
  2020-10-23 11:10 ` Jatin Sahu
  0 siblings, 1 reply; 2+ messages in thread
From: Jatin Sahu @ 2020-10-22 12:03 UTC (permalink / raw)
  To: users; +Cc: chandrika.gautam, jatin.sahu, sumit.bhatkar

Hi,

I am using DPDK's RTE hash data structure in a test application.
The RTE initlilization and hash creation are successful but adding key to
hash results in segmentation fault.

Please find the details of code snipped, output and stack trace.
I have written this code using example "server_node_efd/node/node.c" as
reference.
Please advise if there is any issue in usage or configuration.

*Version: *dpdk-stable-18.11.6

*Output:*
[roamware@loadtestsrv dpdk-hash]$ ./Test
EAL: Detected 72 lcore(s)
EAL: Detected 2 NUMA nodes
EAL: Multi-process socket /run/user/1000/dpdk/rte/mp_socket
EAL: Probing VFIO support...
EAL: Started without hugepages support, physical addresses not available
Hash table created. Count:0
Inserting key:d2040000 KeyAddr:0x7ffc2b1761fc
Segmentation fault (core dumped)

*Stack trace:*
(gdb) where
#0  0x000000000000007f in ?? ()
#1  0x00000000004f0c48 in rte_hash_add_key ()
#2  0x000000000047b08c in test () at HashTest.cpp:47

*Code snippet:*

> *void test()*
> *{*
> *        /* rte init */*
> *        int   argc = 4;*
> *        char *argv[] = {*
> *                "HashTest",*
> *                "-c",*
> *                "0x2",*
> *                "--no-huge"*
> *        };*
> *        int rc = rte_eal_init(argc, argv);*
> *        if(rc < 0)*
> *                rte_exit(EXIT_FAILURE, "RTE init failed \n");*
>
>
> *        /* create hash table */*
> *        uint32_t num_flows_node = 10;*
> *        char name[100];*
> *        struct rte_hash *h;*
> *        struct rte_hash_parameters hash_params;*
> *        int node_id=0;*
> *        hash_params.entries = num_flows_node * 2; /* table load = 50% */*
> *        hash_params.key_len = sizeof(uint32_t); /* Store IPv4 dest IP
> address */*
> *        hash_params.socket_id = rte_socket_id();*
> *        hash_params.hash_func_init_val = 0;*
> *        snprintf(name, sizeof(name), "hash_table");*
> *        hash_params.name <http://hash_params.name> = name;*
> *        h = rte_hash_create(&hash_params);*
> *        if (h == NULL)*
> *                rte_exit(EXIT_FAILURE, "Problem creating the hash table
> for node %d\n", node_id);*
> *        else*
> *                fprintf(stderr, "Hash table created. Count:%d\n",
> rte_hash_count(h));*
>
>
> *        /* insert record to hash table */*
> *        unsigned int i=1234;*
> *        int32_t ret;*
> *        uint32_t ip_dst;*
> *        ip_dst = rte_cpu_to_be_32(i);*
> *        fprintf(stderr, "Inserting key:%x KeyAddr:%p\n", ip_dst,
> &ip_dst);*
> *        ret = rte_hash_add_key(h, (void *) &ip_dst);*
> *        if (ret < 0)*
> *                rte_exit(EXIT_FAILURE, "Unable to add entry %u in hash
> table\n", i);*
> *}*


Regards,
Jatin

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-users] RTE Hash addition results to segmentation fault
  2020-10-22 12:03 [dpdk-users] RTE Hash addition results to segmentation fault Jatin Sahu
@ 2020-10-23 11:10 ` Jatin Sahu
  0 siblings, 0 replies; 2+ messages in thread
From: Jatin Sahu @ 2020-10-23 11:10 UTC (permalink / raw)
  To: users

Hello guyz,
Any reference to resolve this issue?

On Thu, 22 Oct, 2020, 5:33 pm Jatin Sahu, <jatin152@gmail.com> wrote:

> Hi,
>
> I am using DPDK's RTE hash data structure in a test application.
> The RTE initlilization and hash creation are successful but adding key to
> hash results in segmentation fault.
>
> Please find the details of code snipped, output and stack trace.
> I have written this code using example "server_node_efd/node/node.c" as
> reference.
> Please advise if there is any issue in usage or configuration.
>
> *Version: *dpdk-stable-18.11.6
>
> *Output:*
> [roamware@loadtestsrv dpdk-hash]$ ./Test
> EAL: Detected 72 lcore(s)
> EAL: Detected 2 NUMA nodes
> EAL: Multi-process socket /run/user/1000/dpdk/rte/mp_socket
> EAL: Probing VFIO support...
> EAL: Started without hugepages support, physical addresses not available
> Hash table created. Count:0
> Inserting key:d2040000 KeyAddr:0x7ffc2b1761fc
> Segmentation fault (core dumped)
>
> *Stack trace:*
> (gdb) where
> #0  0x000000000000007f in ?? ()
> #1  0x00000000004f0c48 in rte_hash_add_key ()
> #2  0x000000000047b08c in test () at HashTest.cpp:47
>
> *Code snippet:*
>
>> *void test()*
>> *{*
>> *        /* rte init */*
>> *        int   argc = 4;*
>> *        char *argv[] = {*
>> *                "HashTest",*
>> *                "-c",*
>> *                "0x2",*
>> *                "--no-huge"*
>> *        };*
>> *        int rc = rte_eal_init(argc, argv);*
>> *        if(rc < 0)*
>> *                rte_exit(EXIT_FAILURE, "RTE init failed \n");*
>>
>>
>> *        /* create hash table */*
>> *        uint32_t num_flows_node = 10;*
>> *        char name[100];*
>> *        struct rte_hash *h;*
>> *        struct rte_hash_parameters hash_params;*
>> *        int node_id=0;*
>> *        hash_params.entries = num_flows_node * 2; /* table load = 50% */*
>> *        hash_params.key_len = sizeof(uint32_t); /* Store IPv4 dest IP
>> address */*
>> *        hash_params.socket_id = rte_socket_id();*
>> *        hash_params.hash_func_init_val = 0;*
>> *        snprintf(name, sizeof(name), "hash_table");*
>> *        hash_params.name <http://hash_params.name> = name;*
>> *        h = rte_hash_create(&hash_params);*
>> *        if (h == NULL)*
>> *                rte_exit(EXIT_FAILURE, "Problem creating the hash table
>> for node %d\n", node_id);*
>> *        else*
>> *                fprintf(stderr, "Hash table created. Count:%d\n",
>> rte_hash_count(h));*
>>
>>
>> *        /* insert record to hash table */*
>> *        unsigned int i=1234;*
>> *        int32_t ret;*
>> *        uint32_t ip_dst;*
>> *        ip_dst = rte_cpu_to_be_32(i);*
>> *        fprintf(stderr, "Inserting key:%x KeyAddr:%p\n", ip_dst,
>> &ip_dst);*
>> *        ret = rte_hash_add_key(h, (void *) &ip_dst);*
>> *        if (ret < 0)*
>> *                rte_exit(EXIT_FAILURE, "Unable to add entry %u in hash
>> table\n", i);*
>> *}*
>
>
> Regards,
> Jatin
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-23 11:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-22 12:03 [dpdk-users] RTE Hash addition results to segmentation fault Jatin Sahu
2020-10-23 11:10 ` Jatin Sahu

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).