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 8D78BA04DE for ; Fri, 23 Oct 2020 13:10:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 734B2A93E; Fri, 23 Oct 2020 13:10:40 +0200 (CEST) Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) by dpdk.org (Postfix) with ESMTP id 2388C9AF1 for ; Fri, 23 Oct 2020 13:10:38 +0200 (CEST) Received: by mail-io1-f44.google.com with SMTP id r9so1282400ioo.7 for ; Fri, 23 Oct 2020 04:10:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=AT2f53gRsbRi9kvlAnCOlxECu5fHNuOHGYWlTkHxDGU=; b=G2RIUv5ZOJzu2EjAF+rodF72fYGbkCC/MHYmMoM35mRYmCklZXLRuhk3hwxLzifKPK ZZ9f4dL6aqUy85o6OTUt/r0BgK7exk0HV5xah0bige128xgIQoAWRSYU6yp7ZqOa9l8k AxjOVIikdA1PRqWZ2HmxUXmWe3nzi/AhQg2hF11rXSEnDsZ7ILF0IM8ANRET8sBj9Ei4 Fqgb6GjRriUVjxAGa0xZyTHLzFDicQfrI5jYlCsY/2aZ/1kBvecrNtyJQ8mCfM9Ot/1R uoRL5ZPQDZV6MqNZUY6b57cJ/PZphkSNBv+k6NSiQ8K5DwxZMhgWMOuu8mB1igM4BjhU bitw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=AT2f53gRsbRi9kvlAnCOlxECu5fHNuOHGYWlTkHxDGU=; b=qTOKRoh239Mhh+LJKK20+8UgVo4PYBBIlohtrxnMA1s9kH51i4i5BOoy7upd/FFS/1 sjQvGu/q3gEsgAM/GiWzE0pGfZjh4llWVZdOxEBtv4Uzp/OyQEQVGuldq3D+KY1LdLRC 6cZnyuzgx2o0klCe6TDiEkniUmI0TC34eD0wDEdT3fX74cWr9tvbTacU0BWatYnwyEvR LP7GTTfhnS+Xy2MLxAehPjNHxi/uWnk3fRDV1ocK4A4Q7mm4CDqvDbSjrH5WKV2Z/sJp qLweFkvfwykZBhAWHlffAEHlZLJhcduyMaXfbtfExEMpC7kFCL1tJ1h7SlH0aG7Zck6s +I/g== X-Gm-Message-State: AOAM531xlPrWuYIbhIJPzL8lInVGtLJgHFe41+lZ5SHuxZZv9eS93x+f 08FbTRjrSBT+nMciP9As/Xf6pUMIs06Di7BrJT5n/mrThKI= X-Google-Smtp-Source: ABdhPJxE755xkykNAajfKEWVISBlADpvjYabhTB/auAIZVnUbMNZPFXmkNvtRbN0YIwwTFAzDnUkkDYALQ6aZ+nk3w8= X-Received: by 2002:a5e:9743:: with SMTP id h3mr1136931ioq.158.1603451436181; Fri, 23 Oct 2020 04:10:36 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jatin Sahu Date: Fri, 23 Oct 2020 16:40:24 +0530 Message-ID: To: users@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [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" Hello guyz, Any reference to resolve this issue? On Thu, 22 Oct, 2020, 5:33 pm Jatin Sahu, 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 = 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 >