From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0325AA0C41 for ; Thu, 16 Sep 2021 07:08:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6B79C4003F; Thu, 16 Sep 2021 07:08:33 +0200 (CEST) Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) by mails.dpdk.org (Postfix) with ESMTP id 4C9DD4003C for ; Thu, 16 Sep 2021 07:08:32 +0200 (CEST) Received: by mail-ed1-f46.google.com with SMTP id h17so12001950edj.6 for ; Wed, 15 Sep 2021 22:08:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=FSEFzBLRFzx+D6YwAVszib+5lWe88W4Jf8RfJfsLScc=; b=M6slIQBNgnE1HcBLUhQZ6PpPfoP8WWI2Oj8ZdeN0BJFoTLO/7Fk/H2X+RRolfRZ8aj 83Tg38xqaoV6Ku7udSLBUBFq753fa38tNpo4mDhQuOriAeX5AoUCbdDnalM0XSnDWmsj t0Fcz3aXxJhb6EPUZb4T1/HlZZRG8G8mqpII82Hz03ptPQnXptng5sEFxG4p7NtzvDG8 jMGx1N1JgrI9Hz9m2wxr3tXtaNUx2U8Im+CjoBPW9gHOA//XH1B0fF7Ct6Ta+w+eSrWh 4pkSnLOjOnl1/ypjEkZR/ItRH8Fwmh8G1oSkFKhtMa8Hm/UXGX74N9QpFLpS321m5sR4 ATxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=FSEFzBLRFzx+D6YwAVszib+5lWe88W4Jf8RfJfsLScc=; b=ihkyUAhayF1WyNm9Njs8THJDoSmLjgATgGFh52certmV1y+Zp7JfDEFyRDV88ZoMG5 /RwXsN+X3IZXjFfgz7gCCmA9KTOtCKNYHjGLNNY9I/7N6l7Q8/+5hp6MmLbXZPrGTs3+ KK9KVvVamDR/WEk680si2GEcsScU2aZfsTW/2rVArsh9Q/x81kh3Q1yZsYodcxFTcj+j njBEcoyxkQFhJVPGx0FPqWGcM46jlccTne4aoviouRdKKX3EbJh+dYGHl68rrLHqGEMX GT4gA8gaJLkHBKfolBHEsq+rmjev1x4vFGaaz+VoBAEdM0txkJE2ANnJNm1KxF9XGDAr shJA== X-Gm-Message-State: AOAM533u7loIty445+P9k6ugJdaxqNdJmCTh2vcx0b6qHA3DzWKqGj5m 12Rk8BidTzL89LSJs1gCEIRjlcl7+ycIEIFSiGJiAATisw== X-Google-Smtp-Source: ABdhPJxzM8Fl4NjmyhpavLtRTBSCmD1+D24L9SvPkmrEFsT+A+5pp031OFtPQ40i4Jxo/y2J9Iz4M0rgbQYg9OvX8N0= X-Received: by 2002:a17:906:3012:: with SMTP id 18mr4414858ejz.136.1631768911729; Wed, 15 Sep 2021 22:08:31 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jeevan Nailwal Date: Thu, 16 Sep 2021 10:38:21 +0530 Message-ID: To: users@dpdk.org, "Van Haaren, Harry" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [dpdk-users] Fwd: New to DPDK X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 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" Thanks for the inputs Harry. I had started with basics first and reason for moving quickly to vhost application was due to my prior knowledge in same protocol with qemu :) I tried the same code with rte_eal_remote_launch api too but still landed in same error. However this time i build my DPDK with -g option and found bigger stack trace. Can someone please look in this and let me know : bt #0 0x000000000075cd6f in __rte_ring_move_cons_head (entries=0x2aaaac8311b4, new_head=0x2aaaac8311b8, old_head=0x2aaaac8311bc, behavior=RTE_RING_QUEUE_FIXED, n=1, is_sc=0, r=0x6d00000000000000) at /lan/cva/pdapp/jeevann//dpdk-stable-19.11.9/x86_64-native-linuxapp-gcc/include/rte_ring_generic.h:139 #1 __rte_ring_do_dequeue (available=0x0, is_sc=0, behavior=RTE_RING_QUEUE_FIXED, n=1, obj_table=0x2aaaac8312d8, r=0x6d00000000000000) at /lan/cva/pdapp/jeevann//dpdk-stable-19.11.9/x86_64-native-linuxapp-gcc/include/rte_ring.h:384 #2 rte_ring_mc_dequeue_bulk (available=0x0, n=1, obj_table=0x2aaaac8312d8, r=0x6d00000000000000) at /lan/cva/pdapp/jeevann//dpdk-stable-19.11.9/x86_64-native-linuxapp-gcc/include/rte_ring.h:555 #3 common_ring_mc_dequeue (mp=0x100000001, obj_table=0x2aaaac8312d8, n=1) at /lan/cva/pdapp/jeevann//dpdk-stable-19.11.9/drivers/mempool/ring/rte_mempool_ring.c:31 #4 0x0000000000640bd9 in rte_mempool_ops_dequeue_bulk (mp=0x100000001, obj_table=0x2aaaac8312d8, n=1) at /lan/cva/pdapp/jeevann//dpdk-stable-19.11.9/x86_64-native-linuxapp-gcc/include/rte_mempool.h:739 #5 0x0000000000641062 in __mempool_generic_get (cache=0x0, n=1, obj_table=0x2aaaac8312d8, mp=0x100000001) at /lan/cva/pdapp/jeevann//dpdk-stable-19.11.9/x86_64-native-linuxapp-gcc/include/rte_mempool.h:1471 #6 rte_mempool_generic_get (cache=0x0, n=1, obj_table=0x2aaaac8312d8, mp=0x100000001) at /lan/cva/pdapp/jeevann//dpdk-stable-19.11.9/x86_64-native-linuxapp-gcc/include/rte_mempool.h:1506 #7 rte_mempool_get_bulk (n=1, obj_table=0x2aaaac8312d8, mp=0x100000001) at /lan/cva/pdapp/jeevann//dpdk-stable-19.11.9/x86_64-native-linuxapp-gcc/include/rte_mempool.h:1539 #8 rte_mempool_get (obj_p=0x2aaaac8312d8, mp=0x100000001) at /lan/cva/pdapp/jeevann//dpdk-stable-19.11.9/x86_64-native-linuxapp-gcc/include/rte_mempool.h:1565 #9 rte_mbuf_raw_alloc (mp=0x100000001) at /lan/cva/pdapp/jeevann//dpdk-stable-19.11.9/x86_64-native-linuxapp-gcc/include/rte_mbuf.h:551 #10 0x00000000006411b1 in rte_pktmbuf_alloc (mp=0x100000001) at /lan/cva/pdapp/jeevann//dpdk-stable-19.11.9/x86_64-native-linuxapp-gcc/include/rte_mbuf.h:804 #11 0x000000000065d1dd in virtio_dev_pktmbuf_alloc (data_len=110, mp=0x100000001, dev=0x227fffba80) at /lan/cva/pdapp/jeevann//dpdk-stable-19.11.9/lib/librte_vhost/virtio_net.c:1637 #12 virtio_dev_tx_split (dev=0x227fffba80, vq=0x227ffcf280, mbuf_pool=0x100000001, pkts=0x2aaaac8394e8, count=1) at /lan/cva/pdapp/jeevann//dpdk-stable-19.11.9/lib/librte_vhost/virtio_net.c:1734 #13 0x000000000066fae6 in rte_vhost_dequeue_burst (vid=0, queue_id=1, mbuf_pool=0x100000001, pkts=0x2aaaac8394e8, count=1) at /lan/cva/pdapp/jeevann//dpdk-stable-19.11.9/lib/librte_vhost/virtio_net.c:2278 #14 0x000000000048b88c in tx_process () #15 0x000000000076acf8 in eal_thread_loop (arg=0x0) As per Harry's inputs, ring address i.e. r=0x6d00000000000000 in frame 0 arguments seems weired. Can somebody please comment on same? As per m,y code, I am not making any ring explicitly for RX/TX. do i need to create them manually. I thought creating vhost socket and registering will take care of it internally. please correct me if i m wrong. Regards, Jeevan On Wed, Sep 15, 2021 at 5:52 PM Van Haaren, Harry < harry.van.haaren@intel.com> wrote: > > -----Original Message----- > > From: users On Behalf Of Jeevan Nailwal > > Sent: Wednesday, September 15, 2021 1:11 PM > > To: users@dpdk.org > > Subject: [dpdk-users] New to DPDK > > > > Hi Everyone, I am new to DPDK and trying to learn its usage. I am facing > a > > SEGFAULT while sending a single packet via this. > > Please find the snippet of my code below: > > Hi Jeevan, > > > ------------Started my program with initial pool configuration: > > ret = rte_eal_init(argc, argv); > > if (ret < 0) > > rte_exit(EXIT_FAILURE, "Error with EAL initialization\n"); > > argc -= ret; > > argv += ret; > > > > rte_log_set_global_level(RTE_LOG_NOTICE); > > > > /* parse app arguments */ > > if (rte_lcore_count() > RTE_MAX_LCORE) > > rte_exit(EXIT_FAILURE,"Not enough cores\n"); > > > > create_mbuf_pool(128000, 128); > > > > ret = rte_vhost_driver_register(sockpath, 0); > > if (ret != 0) > > rte_exit(EXIT_FAILURE, "vhost driver register failure.\n"); > > > > > > rte_vhost_driver_callback_register (sockpath, &virtio_net_device_ops); > > chmod (sockpath, 0777); > > rte_vhost_driver_start(sockpath); > > Could I suggest to start with a simpler program than going straight for > vhost? > Some basic forwarding using e.g. pcap PMD or something would simplify the > problem... and help get something small working correctly before > attempting big. > > > > -------- afterwards i created a thread to instantiate m TX.. i.e. receive > > packet from DPDK: > > > > ret = pthread_create (&proc_tx, NULL, (void *)tx_process, NULL); > > if (ret != 0) > > { > > rte_exit (EXIT_FAILURE, "Cannot create TX thread\n"); > > } > > DPDK handles thread creation, assigns "lcore ids" and various other > thread-local specific things to the thread. > These are later used in e.g. mempool library for optimized per-thread > cache data structures. Using a "raw" > pthread will not work with DPDK function-calls, nor is it expected to. > > Have a look at examples/helloworld to see how lcores are launch using DPDK. > Then perhaps look at examples/skeleton to see how launched lcores can use > rx/tx burst APIs correctly. > > Hope that helps! -Harry >