From owner-freebsd-net@FreeBSD.ORG Sun Jun 1 15:17:50 2014 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E16FDD7E for ; Sun, 1 Jun 2014 15:17:49 +0000 (UTC) Received: from m50-111.126.com (m50-111.126.com [123.125.50.111]) by mx1.freebsd.org (Postfix) with ESMTP id EBFA324AF for ; Sun, 1 Jun 2014 15:17:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-ID:MIME-Version; bh=945N0 A10sDDfTjQoTI3p+YNxFLQpDvbmlEGr5xu16tw=; b=qS5rAlymgyICW2QPfD6MS jzuMiPTEUSyNdIbajbEg7uk9cRuiFZg2iXOShQy4eBR6Ww7aoJLcLyWMAF8c4C8L u86M1a1owhI1q5RIwCQno3ZbOF8rhbkFeZS7amkA817Q8e6lfP4eCgaMxH2rSev7 /8nVTXLfAYyyYQOg8IXymA= Received: from dshPC (unknown [111.161.77.200]) by smtp5 (Coremail) with SMTP id jtKowECppUcHPYtT2xgKAA--.319S2; Sun, 01 Jun 2014 22:47:35 +0800 (CST) From: "dongshan" To: Subject: problem of netmap running on PowerPC platform board Date: Sun, 1 Jun 2014 22:47:37 +0800 Message-ID: <005601cf7da8$6ea46900$4bed3b00$@126.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 15.0 Thread-Index: Ac99oTYeh8bRSeeiRiSjFBMCDQe6kw== Content-Language: zh-cn X-CM-TRANSID: jtKowECppUcHPYtT2xgKAA--.319S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7WrWfuw43Zw1Dtw13uF4xtFb_yoW8ZrW5pr ZrKr9akF4vqrWxKr97Kr48AF1S9r93AFW5Xw1IvayFy3Z8WF1xXrs2kw15W3Z5uwn3KF1j yFnFg3yxtas8XaUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UieOAUUUUU= X-Originating-IP: [111.161.77.200] X-CM-SenderInfo: 5wkrztxv1d0warsqlqqrswhudrp/1tbitQqdxUX9qlld+gAAsL Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.18 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 15:17:50 -0000 Hi, very good work you have done, thank you for sharing the source code of netmap. These days I am trying to test netmap performance on PowerPC 32 bit board, followed the guide, I rebuilt the kernel and netmap modules, then I tested pkt-gen. when configured it as RX mode, it seems work fine. But when I test the TX mode, segmentation fault error occurs. Am sure the procedures I did was right, as I followed the procedures as what I did on X86 platform. Here is the info: root@p4080ds:~/netmap_modules# ./pkt-gen -i eth0 -f tx -n 500111222 -l 60 -w 10 886.299155 main [1624] interface is eth0 886.299712 extract_ip_range [275] range is 10.0.0.1:0 to 10.0.0.1:0 886.299731 extract_ip_range [275] range is 10.1.0.1:0 to 10.1.0.1:0 886.517024 main [1807] mapped 334980KB at 0x48003000 Sending on netmap:eth0: 1 queues, 1 threads and 1 cpus. 10.0.0.1 -> 10.1.0.1 (00:00:00:00:00:00 -> ff:ff:ff:ff:ff:ff) 886.517087 main [1885] Sending 512 packets every 0.000000000 s 886.517099 main [1887] Wait 10 secs for phy reset 896.517259 main [1889] Ready... 896.517293 nm_open [457] overriding ifname eth0 ringid 0x0 flags 0x1 896.517428 sender_body [996] start Segmentation fault After carefully debugging, I found where the error occurs. In pkt-gen.c file, line 691: . } else if (options & OPT_MEMCPY) { memcpyu(frame, p, size); if ( fcnt == nfrags) . The 'p' address in the code is out of range of the mmap(). Then I traced it and found the root error but I don't know how to correct it. I used GDB to debug the code, in netmap_user.h file: 525, I added info of r->ofs as: . for(i = 0; i <+ d->req.nr_tx_rings, i++) { struct netmap_ring *r = NETMAP_TXRING(d->nifp, i); D("TX%d %p h %d c %d t %d ofs 0x%lx", i, r, r->head, r->cur, r->tail, r->buf_ofs); } . The red is what I added. It outcomes the 'ofs' is 0x8000000, however 0x800 is expected. The board I tested is PowerPC big endian 32 bit board, I am not whether it effects the outcome. Best regards, Dongshan