From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp85.iad3a.emailsrvr.com (smtp85.iad3a.emailsrvr.com [173.203.187.85]) by dpdk.org (Postfix) with ESMTP id 93C36FFA for ; Wed, 30 Aug 2017 07:15:25 +0200 (CEST) Received: from smtp19.relay.iad3a.emailsrvr.com (localhost [127.0.0.1]) by smtp19.relay.iad3a.emailsrvr.com (SMTP Server) with ESMTP id 3501E50BA; Wed, 30 Aug 2017 01:15:25 -0400 (EDT) X-SMTPDoctor-Processed: csmtpprox beta Received: from smtp19.relay.iad3a.emailsrvr.com (localhost [127.0.0.1]) by smtp19.relay.iad3a.emailsrvr.com (SMTP Server) with ESMTP id 301595102; Wed, 30 Aug 2017 01:15:25 -0400 (EDT) X-Auth-ID: padam.singh@inventum.net Received: by smtp19.relay.iad3a.emailsrvr.com (Authenticated sender: padam.singh-AT-inventum.net) with ESMTPSA id 48EA450BA; Wed, 30 Aug 2017 01:15:23 -0400 (EDT) X-Sender-Id: padam.singh@inventum.net Received: from [172.16.1.105] ([UNAVAILABLE]. [103.25.205.2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:465 (trex/5.7.12); Wed, 30 Aug 2017 01:15:25 -0400 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) From: Padam Jeet Singh In-Reply-To: Date: Wed, 30 Aug 2017 10:45:21 +0530 Cc: "users@dpdk.org" Content-Transfer-Encoding: quoted-printable Message-Id: <76E92DAC-247F-41D8-B163-12248DF102C8@inventum.net> References: To: Ming Fu X-Mailer: Apple Mail (2.3273) Subject: Re: [dpdk-users] dpdk with snort 2.9.9 receive from DPDK ring 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: , X-List-Received-Date: Wed, 30 Aug 2017 05:15:25 -0000 > On 30-Aug-2017, at 2:21 AM, Ming Fu wrote: > > I am making a snort DAQ module to receive packet from DPDK capture throug= h a ring. The snort version is 2.9.9 and DPDK version is 17.08. The code is= very similar to the multi_process/client_server_mp example. The DPDK is in= itialized in daq initialize function and mbuf received from daq acquire fun= ction. Snort inspects the mbuf but does not re-inject back to the network, = so daq free the mbuf by rte_pktmbuf_free(mbuf) in the same thread as it cal= ls rte_ring_dequeue_burst(); > The snort successfully received the first burst of 32 packets, but it fai= ls on the first rte_pktmbuf_free(). > > Seems some internal dpdk function pointer is NULL. > #0 0x0000000000000000 in ?? () > #1 0x00000000004f7a8d in rte_mempool_ops_enqueue_bulk (n=3D, obj_table=3D, mp=3D) > at /home/mfu/work/dpdk-17.08/build/include/rte_mempool.h:497 > #2 __mempool_generic_put (cache=3D, n=3D1, obj_table=3D0x= 7fffffffe6e8, mp=3D) at /home/mfu/work/dpdk-17.08/build/incl= ude/rte_mempool.h:1069 > #3 rte_mempool_generic_put (flags=3D, cache=3D, n=3D1, obj_table=3D0x7fffffffe6e8, mp=3D) > at /home/mfu/work/dpdk-17.08/build/include/rte_mempool.h:1109 > #4 rte_mempool_put_bulk (n=3D1, obj_table=3D0x7fffffffe6e8, mp=3D) at /home/mfu/work/dpdk-17.08/build/include/rte_mempool.h:1132 > #5 rte_mempool_put (obj=3D, mp=3D) at /hom= e/mfu/work/dpdk-17.08/build/include/rte_mempool.h:1150 > #6 rte_mbuf_raw_free (m=3D) at /home/mfu/work/dpdk-17.08/= build/include/rte_mbuf.h:853 > #7 rte_pktmbuf_free_seg (m=3D) at /home/mfu/work/dpdk-17.= 08/build/include/rte_mbuf.h:1349 > #8 rte_pktmbuf_free (m=3D) at /home/mfu/work/dpdk-17.08/b= uild/include/rte_mbuf.h:1369 > #9 dpdk_daq_acquire (handle=3D0x1af6910, cnt=3D0, callback=3D, metaback=3D, user=3D) at daq_dpdk.c:234 > #10 0x00000000004551d3 in DAQ_Acquire () > #11 0x0000000000437828 in SnortMain () > #12 0x00007ffff61af830 in __libc_start_main () from /lib/x86_64-linux-gnu= /libc.so.6 > #13 0x0000000000406d29 in _start () > > I notice that snort has three threads, > (gdb) info thread > Id Target Id Frame > * 1 Thread 0x7ffff7fdf8c0 (LWP 42472) "snort" 0x0000000000000000 in ??= () > 2 Thread 0x7fffdff5a700 (LWP 42481) "eal-intr-thread" 0x00007ffff6296= 9d3 in epoll_wait () from /lib/x86_64-linux-gnu/libc.so.6 > 3 Thread 0x7fffdf4d5700 (LWP 42482) "snort" 0x00007ffff625b30d in nan= osleep () from /lib/x86_64-linux-gnu/libc.so.6 > > Would it be a problem if the rte_pktmbuf_free() is not called from the ea= l thread? > The rte_mbuf_free internally calls rte_mempool put calls - which should onl= y be called from a EAL thread - so yes, only call rte_pktmbuf_free from an = EAL thread. > Thanks > Ming > > > > > ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= - NOTICE Please=A0Consider=A0the=A0Environment=A0before=A0printing=A0this=A0Email. This email was sent from within Inventum Technologies Private Limited (http= s://www.inventum.net). This email (and any attachments or hyperlinks within= it) may contain information that is confidential, legally privileged or ot= herwise protected from disclosure. If you are not the intended recipient of= this email, you are not entitled to use, disclose, distribute, copy, print= , disseminate or rely on this email in any way. If you have received this e= mail in error, please notify the sender immediately by telephone or email a= nd destroy it, and all copies of it. We have taken steps to ensure that this email (and any attachments) are fre= e from computer viruses and=A0the like. However, it is the recipient's resp= onsibility to ensure that it is actually virus free. Any emails that you se= nd to us may be monitored for the purposes of ascertaining whether the comm= unication complies with the law and our policies.