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 2F1C8A04DD for ; Tue, 20 Oct 2020 11:49:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 15089C92A; Tue, 20 Oct 2020 11:49:36 +0200 (CEST) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by dpdk.org (Postfix) with ESMTP id 9367CBCE9 for ; Tue, 20 Oct 2020 11:49:34 +0200 (CEST) Received: by mail-pl1-f173.google.com with SMTP id y1so750240plp.6 for ; Tue, 20 Oct 2020 02:49:34 -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=coPgy6T7M2O3mO6YyBlFrDMWwe+6p0l/Q0ppr0BKWMU=; b=sL9sjaVJh+eTkd0tRIhEspOg6BBDPDT2TT15u3V0r8mhVdoOUi3JLsSYb5yEL91Xyj WNs7cR7EIcWd+pvqjKk9dNv3STe3J8T2QQubdh7DQ3mjo009bub9yotjUVnFK+Fjlkp2 NVrr9YXvVlElzidZm4Y7zNpwqYoR4I4WYycCbViTVVt6DndFR2CGoA+cwZD8kmZgO+Uv ecxyVcppNOwjJrk2V7z8svSLcLbBgRtBnYk2GgDhnOzr9SipyJxSsq6qN6qmTmfb3CUK 3PVPhqxWX3fL8lLPGUQ6EUN5SAjN0Ir1fwDrs3ppheW0OIx7svPSomoZ3hvgeBytGXWc KIEA== 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=coPgy6T7M2O3mO6YyBlFrDMWwe+6p0l/Q0ppr0BKWMU=; b=Poyx+A+6RxicKfFMAhzJI1imbkhBmLIK7wuF4vW93QBFg1YSlYO6hp2Czds2rGja6t FiWiMDA2gjPji8YJ1VdxO0AU3LZGvzXzdBN4cWDJhAHHonZzD6AqaOGy1zdgGsr40Uxe XN8u+xy9I7c4IsEkYcdLceA+n9aC4eUdtSaa9+24rVd7FNbfLQ328Ud4NAx146xJ0rc6 LSvD5TrH62mHiN5dWTf4OMRNPqt6Vrcv8aZPsW4z9jo2oieOVqkeMNZnUYkr6VXOurLM 2NgzXJ2Dy2vRJ1QjoPzz9znNV/2QHEPJ7wDNgX7J6PWgW0saZuba2/hAdec8I5ZSBt9K ngoA== X-Gm-Message-State: AOAM5313zVX4aiqnmLGOSGqu61C23OEMho7uNSr4gk7cIN/LgAwuXxMY 3MYQ/ezDGkZcu+VfmfStWH+IWMGHy/XoLZKE1JtErc/Ye7c= X-Google-Smtp-Source: ABdhPJy3LISVs0ZXx7T2mGC1JnYQAA5IlBOmuqBadw0W/Pj3SIzuFvd3G4lxVBgkxhLsL61XOHSWRXMAdcV6G6STaV0= X-Received: by 2002:a17:90a:ca93:: with SMTP id y19mr2117753pjt.128.1603187372581; Tue, 20 Oct 2020 02:49:32 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Nirmal R Date: Tue, 20 Oct 2020 11:49:21 +0200 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] DPDK: IP reassemble segmentation fault for rte_ip_frag_table_create. 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, Issue resolved after assigning memory to each lcore. Thank you. With Regards, Nirmal On Mon, Oct 19, 2020 at 12:35 PM Nirmal R wrote: > Hello, > > > > I am new to DPDK and writing the code in c++ language, currently working > on IP reassembling the packets below is my sample code which is giving me > segmentation fault for rte_ip_frag_table_create, I am unable to debug the > issue. Much appreciated if someone can explain to me where did I go wrong > and how to do it in a proper manner. At the moment I am finding it > difficult. Thanks in advance. > > > > #define BUFFER_RING_SIZE 65536 > > #define BUFFER_LENGTH 1500 > > #define POOL_SIZE 8192 > > #define POOL_CACHE_SIZE 256 > > > > #define DEF_FLOW_NUM 0x1000 > > #define DEF_FLOW_TTL MS_PER_S > > #define IP_FRAG_TBL_BUCKET_ENTRIES 4 > > static uint32_t max_flow_num = DEF_FLOW_NUM; > > static uint32_t max_flow_ttl = DEF_FLOW_TTL; > > #define RTE_LOGTYPE_IP_RSMBL RTE_LOGTYPE_USER1 > > > > struct lcore_queue_conf { > > struct rte_ip_frag_tbl *frag_tbl; > > struct rte_ip_frag_death_row death_row; > > } __rte_cache_aligned; > > > > > > static inline int setup_queue_tbl(struct lcore_queue_conf *qconf) > > { > > uint64_t frag_cycles = (rte_get_tsc_hz() + MS_PER_S - 1) / MS_PER_S * > max_flow_ttl; > > qconf->frag_tbl = rte_ip_frag_table_create(max_flow_num, > IP_FRAG_TBL_BUCKET_ENTRIES, max_flow_num, frag_cycles, rte_socket_id()); > > if((qconf->frag_tbl) == NULL){ > > RTE_LOG(ERR, IP_RSMBL, "Table Failed."); > > return -1; > > } > > return 0; > > } > > > > static int > > lcore_main() > > { > > struct lcore_queue_conf *qconf; > > > > if(setup_queue_tbl(qconf) != 0) > > rte_exit(EXIT_FAILURE, "%s\n", rte_strerror(rte_errno)); > > > > . > > . > > . > > . > > > > } > > > > int main(int argc, char *argv[]) > > { > > > > struct rte_mempool *mbuf_pool; > > struct rte_ring *ring; > > uint16_t portcheck; > > > > /* catch ctrl-c so we can print on exit */ > > signal(SIGINT, int_handler); > > > > /* EAL setup */ > > ret=rte_eal_init(argc, argv); > > cout << > "=====================================================" << endl; > > if(ret < 0) > > cout << EAL initialising failed." << > strerror(-ret) << endl; > > else > > cout << EAL initialisation success." << endl; > > > > /* Mempool creation */ > > > > mbuf_pool=rte_pktmbuf_pool_create("BUFFER", POOL_SIZE, > POOL_CACHE_SIZE, 0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id()); > > > > if(mbuf_pool== NULL) > > rte_exit(EXIT_FAILURE, "%s\n", rte_strerror(rte_errno)); > > . > > . > > . > > . > > /* Master core call */ > > lcore_main(); > > > > return 0; > > } > > > > > > EAL: Detected 12 lcore(s) > > EAL: Detected 1 NUMA nodes > > EAL: Multi-process socket /var/run/dpdk/rte/mp_socket > > EAL: Selected IOVA mode 'VA' > > EAL: Probing VFIO support... > > EAL: VFIO support initialized > > EAL: Invalid NUMA socket, default to 0 > > EAL: Invalid NUMA socket, default to 0 > > EAL: using IOMMU type 1 (Type 1) > > EAL: Probe PCI driver: net_ixgbe (8086:15d1) device: 0000:01:00.0 (socket > 0) > > EAL: Invalid NUMA socket, default to 0 > > EAL: No legacy callbacks, legacy socket not created > > ===================================================== > > EAL initialisation success. > > PORT 0: Ethernet configuration success. > > TX queue configuration success. > > RX queue configuration success. > > PORT 0: NIC started successfully. > > PORT 0: Enabled promiscuous mode. > > MAC Addr b4:96:91:3f:21:b6 > > ===================================================== > > USER1: rte_ip_frag_table_create: allocated of 6291584 bytes at socket 0 > > Segmentation fault > > > > With Regards, > > Nirmal. > >