From owner-freebsd-net@FreeBSD.ORG Sun Jun 1 14:51:22 2014 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDA47408 for ; Sun, 1 Jun 2014 14:51:22 +0000 (UTC) Received: from m50-111.126.com (m50-111.126.com [123.125.50.111]) by mx1.freebsd.org (Postfix) with ESMTP id 57BAA22E3 for ; Sun, 1 Jun 2014 14:51:20 +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=OpZ6U OX0hfsiSQHfzCLPc0ZIhXe8x84sTuouLf15Uco=; b=apxLpyfDUiffaDVcxcQjF iLvVFxdL0s7noiAbrjSqg5R9iCSrXNYu9nWPJwRScNnwNg2Q/t4JxI3MI9qUF9sE E9o5k+QgFaTAx3lDek5bxxtG5NQNffyeEHb48F0m2WH4ndJHH8s8bnE2F27jHsiP 3L0GSKlA+gNrhMh50qQ0RU= Received: from dshPC (unknown [111.161.77.200]) by smtp5 (Coremail) with SMTP id jtKowEB5XFTlPYtTUTIKAA--.1493S2; Sun, 01 Jun 2014 22:51:17 +0800 (CST) From: "dongshan" To: References: In-Reply-To: Subject: problem of netmap running on PowerPC platform board Date: Sun, 1 Jun 2014 22:51:19 +0800 Message-ID: <006501cf7da8$f2f23110$d8d69330$@126.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQNTdI7Zy6vugcn83UKu5UbBrvA+6ZhUaGbQ Content-Language: zh-cn X-CM-TRANSID: jtKowEB5XFTlPYtTUTIKAA--.1493S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7WrWfuw43Zw1Dtw13uF4xtFb_yoW8ZF1Dpr ZrKr9akF4kXrWxKr97Kr48AF1S9r93AFW5Xw1IvayFy3W5WF1xXrs2kw15W3Z5Cwn3KF1j yFnFg3yxtas8XaUanT9S1TB71UUUUUJqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UEkskUUUUU= X-Originating-IP: [111.161.77.200] X-CM-SenderInfo: 5wkrztxv1d0warsqlqqrswhudrp/1tbitBedxUX9rCezqwAAsQ 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 14:51:22 -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, kernel: linux 3.8. I am not whether it effects the outcome. Best regards, Dongshan