From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5D300A04DD for ; Thu, 22 Oct 2020 14:03:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1149CA9C9; Thu, 22 Oct 2020 14:03:41 +0200 (CEST) Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) by dpdk.org (Postfix) with ESMTP id 62623A9C2 for ; Thu, 22 Oct 2020 14:03:39 +0200 (CEST) Received: by mail-il1-f173.google.com with SMTP id p10so1474209ile.3 for ; Thu, 22 Oct 2020 05:03:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=EXuaZ2Ad7fPygXgseRnWhzEHEPJk9ZBPsC+NbS/OL5w=; b=d5Ul6D17q7baaQoJh9jXYLHrLP6UyBf0M28+3UICsMR++JRXnTN5+IegZWiZXX4X3k FEK53glgOCL0HTOahQOG9nYh0g0ZfWndfwU3QI29uyx8KSbNFwDtKmpOLDqzPrG6Tj88 kUg5r4fW3PyG1NpJ+h92UdSwSbmzCG3It9xE9fKE2tpwd//99HQsa4ycHhVgQ5cGK5sj Ixsj4zra+fMsmkPazQQpdtx1mhCYBX6MvwR3vV68NLNP+wOM7rhr6uxklmVQIsc/inie fEoDHDbUMc/9q83dTlI+8n/gLBHVHrlohvRkeefpk4ZnWdaHryLrGj00Xi97+PzFJjK3 ZxkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=EXuaZ2Ad7fPygXgseRnWhzEHEPJk9ZBPsC+NbS/OL5w=; b=VNd3DTiiwZPRNF4smYmEDf61SMtkSZV5I9G6XjfxKh2q+bzpM+it4d+o+nfdQiyd+S JPv2hBzE3W3+bIIWcv3dL8YvBmHrvPFba/udvW+Y5M4EBXYT+jgPibIvIB9uTdhHpJm+ VrIpKIbEK1TsBnfy7Ytvvm67KeXICQ7+MFMHPCo37dsvQb9mZy3YmKeJgMVNM3aHgkbu Gi3XXkeIU6TuhVPS4o4DTsRMiiUtww3JKgJYPwAm4CN7/2lvSZ1z93D5wx1DZ8McSLX1 6UG6s22Tyidh4sJXSK8gIXrthILkicsFGItysXeQZZdSNePyQFYNJ5vkq6Iq9W1dGw6i kILA== X-Gm-Message-State: AOAM530LlT5OmiTuLPN7pHVyjus1Jm0xkfJPgwo7k0oudQgdEmvE6JZn C8DiWkrfIFt9N5HxIDKHMe6VTGIESW1Y71UTN+s3m6VKWuCu7Q== X-Google-Smtp-Source: ABdhPJzxNIjAP/TzjwYnz7bfXG/aNbvjLY4+0BNkm+PebB9Y5OmXT/AsD72OIXSsNvL+ZixP0wj7VHhegvGQVMd5LuQ= X-Received: by 2002:a92:a008:: with SMTP id e8mr1609552ili.83.1603368218472; Thu, 22 Oct 2020 05:03:38 -0700 (PDT) MIME-Version: 1.0 From: Jatin Sahu Date: Thu, 22 Oct 2020 17:33:27 +0530 Message-ID: To: users@dpdk.org Cc: chandrika.gautam@mobileum.com, jatin.sahu@mobileum.com, sumit.bhatkar@mobileum.com Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-users] RTE Hash addition results to segmentation fault X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Sender: "users" 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 = 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