From owner-freebsd-net@FreeBSD.ORG Sun Sep 14 15:13:24 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 EAF6314 for ; Sun, 14 Sep 2014 15:13:24 +0000 (UTC) Received: from m15-114.126.com (m15-114.126.com [220.181.15.114]) by mx1.freebsd.org (Postfix) with ESMTP id 402A9125 for ; Sun, 14 Sep 2014 15:13:23 +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=7w2/i c5j0FRLrBJ+oXV75afyzhO81N5AtlCFEXagd8A=; b=Ri4YgXK5Dfg4bVvetOS9k LdxczzKFUFawvlQ4RrRT5YE1uvhgpDBgxcFCouoEbeQIvh8jX8QMX7cKAq8apQpv hqr6116+qXTI3NWFQpc8P5NwKP9RRX7Yzb30PL0LsMVpuUnlg2CfZLhdOLzr4AAb xuNyUcJr69luZ7HC+StmKw= Received: from dshPC (unknown [219.237.227.113]) by smtp7 (Coremail) with SMTP id DsmowEAZrGNjqRVUFU0sBw--.13786S2; Sun, 14 Sep 2014 22:42:45 +0800 (CST) From: "dongshan" To: Subject: netmap BUG found on big endian machine Date: Sun, 14 Sep 2014 22:42:43 +0800 Message-ID: <001e01cfd02a$255cb430$70161c90$@126.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 15.0 Thread-Index: Ac/QKCuwLScJOIFfS+OmrWeJcWdYQg== Content-Language: zh-cn X-CM-TRANSID: DsmowEAZrGNjqRVUFU0sBw--.13786S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7GF1rur47KF1Uuw4xKw43GFg_yoW3GFg_WF ykArW8ury3Cwn7W3929rWFq3WDKry0qw1rCrW5Xr4jk34UGa4kuFZayr9Igw48Za15Kr15 Gwn8Wa1Fvr1fujkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU1i0etUUUUU== X-Originating-IP: [219.237.227.113] X-CM-SenderInfo: 5wkrztxv1d0warsqlqqrswhudrp/1tbi1gYHxU0vOJamDwAAs3 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 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, 14 Sep 2014 15:13:25 -0000 Hi,=20 =20 I have tested netmap on freescale PowerPC board, it is a big = endian machine, when I test the example app pkt-gen=A3=AC I found one bug, = really it is bug of netmap souce code. The commit id is = =A1=B0d39c4411a2129926d262f9faffacaf876392c7cd=A1=B1, the bug locates in =A1=B0netmap_mem2.c, netmap_mem_rings_create()=A1=B1, you = should use=20 =A1=B0*(uint32_t *)(uintptr_t)&ring->nr_buf_size =3D NETMAP_BDG_BUF_SIZE(na->nm_mem);=A1=B1 substituting =A1=B0*(uint16_t *)(uintptr_t)&ring->nr_buf_size =3D NETMAP_BDG_BUF_SIZE(na->nm_mem);=A1=B1 Because the outcome of big endian and little endian is different. = I guess the source code is written and tested on intel arch machine. But = it is true it can=A1=AFt run big endian machine directly. =20 =20 Best regards, Dongshan =20