From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp5.epfl.ch (smtp5.epfl.ch [128.178.224.8]) by dpdk.org (Postfix) with ESMTP id D292C29CB for ; Wed, 2 Nov 2016 16:43:58 +0100 (CET) Received: (qmail 18654 invoked by uid 107); 2 Nov 2016 15:43:56 -0000 X-Virus-Scanned: ClamAV Received: from icdhcp-1-105.epfl.ch (HELO [128.178.116.105]) (128.178.116.105) (TLS, DHE-RSA-AES256-SHA cipher) (authenticated) by mail.epfl.ch (AngelmatoPhylax SMTP proxy) with ESMTPSA; Wed, 02 Nov 2016 16:43:56 +0100 From: George Prekas To: dev@dpdk.org Message-ID: Date: Wed, 2 Nov 2016 16:43:59 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] Possible memory corruption due to incorrect DMA shutdown X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Nov 2016 15:43:59 -0000 I have posted the following messages on users@dpdk.organd it seems that it was the wrong mailing list: http://dpdk.org/ml/archives/users/2016-March/000340.html http://dpdk.org/ml/archives/users/2016-September/001026.html I also include the message here for convenience: I can consistently reproduce this behavior following these steps: On host A do: $ sudo modprobe uio $ sudo insmod ./build/kmod/igb_uio.ko $ sudo python ./tools/dpdk_nic_bind.py --bind=igb_uio 0000:42:00.1 $ sudo ./build/app/testpmd -- --forward-mode=icmpecho From host B (which is on the same local network), do an arping to an arbitrary IP address C.C.C.C (that is in the same network and it doesn't belong to another host). DPDK will respond to any IP address. All you want is to populate host B's ARP cache. Then terminate DPDK and run the following Python program on host B: import sys import socket A=sys.argv[3] * int(sys.argv[2]) for i in xrange(10000): sock = socket.socket(socket.AF_INET,socket.SOCK_DGRAM) sock.sendto(A, (sys.argv[1], 1)) as: $ python go.py C.C.C.C 28 prekageo_was_here_ Then go back to host A and use the physical memory grep tool that you can find here https://github.com/prekageo/allmemscan $ make $ sudo insmod allmem.ko $ sudo ./allmemscan 28 prekageo_was_here Optionally: $ sudo dd if=/dev/allmem bs=4K skip=PAGE count=1 | hexdump -C | less On 11/03/2016 19:41, George Prekas wrote: > Hi. I've been using DPDK for a research project > (https://www.usenix.org/conference/osdi14/technical-sessions/presentation/belay) > for over 2 years and I'd like to report a behavior that puzzles me > using DPDK. > > The behavior leads to memory corruption and is caused by the incorrect > shutdown of DMA. I can reproduce it after executing the following steps: > > $ sudo modprobe uio > $ sudo insmod ./build/kmod/igb_uio.ko > $ sudo python ./tools/dpdk_nic_bind.py --bind=igb_uio 0000:42:00.1 > $ sudo ./build/app/testpmd -- --forward-mode=icmpecho > > Then I terminate the DPDK program (after populating the ARP cache of > another host on the local network). After this, I can send UDP packets > to the host and can observe their payload in host memory. Clearly, > network packets are arriving to the network card and are written to > RAM after DPDK has finished executing. > > Am I doing something wrong? Is this behavior expected? > > Regards, > George >