From owner-freebsd-net@FreeBSD.ORG Sun Sep 14 16:42:44 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 793129BB for ; Sun, 14 Sep 2014 16:42:44 +0000 (UTC) Received: from mail-qa0-x234.google.com (mail-qa0-x234.google.com [IPv6:2607:f8b0:400d:c00::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A4A6B29 for ; Sun, 14 Sep 2014 16:42:44 +0000 (UTC) Received: by mail-qa0-f52.google.com with SMTP id m5so2813917qaj.39 for ; Sun, 14 Sep 2014 09:42:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=y0qgT4rfb4s9jL1bFLvm/2uSp2tx8H7CEhwpTixpXHQ=; b=pLYp3ceTa/9uSmuiiST7G92QQ6AwM/NFhjs9RYihZDJKQ7WSI9zvd8bnGi18bnzYne Ly3fYsVbklqP39jPeWwYy8kD+U8NyOQRzuGZFmE8bvAlAiJTN2BzatA0TJ/ySMfIFE6d GgC/VT+tJ6zh0EQZK0MQ3kG9IrgUlHgozJtu8+wojzoCkuapXI73OnIBNCHDNOi9y1p0 2vTF26cwwnZ573ENn+QNUDgzdFJJW15RhD8JQ6se9WCOEeTKWgKQygwXutulnifXBfBn NTUGnZHr1eficyq+rZyfQ0KEDG2dVPGN9Gb7XLKTCi6/1EpxF/94OO4oSHjW3y8tXW26 ZupQ== MIME-Version: 1.0 X-Received: by 10.224.75.73 with SMTP id x9mr29994719qaj.63.1410712962800; Sun, 14 Sep 2014 09:42:42 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.39.139 with HTTP; Sun, 14 Sep 2014 09:42:42 -0700 (PDT) In-Reply-To: <001e01cfd02a$255cb430$70161c90$@126.com> References: <001e01cfd02a$255cb430$70161c90$@126.com> Date: Sun, 14 Sep 2014 09:42:42 -0700 X-Google-Sender-Auth: YL_Ttmv83xYRoeJsg0NphllX9MU Message-ID: Subject: Re: netmap BUG found on big endian machine From: Adrian Chadd To: dongshan Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "net@freebsd.org" 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 16:42:44 -0000 Hi! Good catch! Would you mind filing a bug so we don't forget? http://bugs.freebsd.org/submit/ Thanks! -a On 14 September 2014 07:42, dongshan wrote: > Hi, > > > > I have tested netmap on freescale PowerPC board, it is a big endia= n > machine, when I test the example app pkt-gen=EF=BC=8C I found one bug, re= ally it is > bug of netmap souce code. > > The commit id is =E2=80=9Cd39c4411a2129926d262f9faffacaf876392c7cd= =E2=80=9D, the > bug locates in =E2=80=9Cnetmap_mem2.c, netmap_mem_rings_create()=E2=80=9D= , you should use > > =E2=80=9C*(uint32_t *)(uintptr_t)&ring->nr_buf_size =3D > NETMAP_BDG_BUF_SIZE(na->nm_mem);=E2=80=9D substituting > > =E2=80=9C*(uint16_t *)(uintptr_t)&ring->nr_buf_size =3D > NETMAP_BDG_BUF_SIZE(na->nm_mem);=E2=80=9D > > 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=E2=80=99t run big endian machine directly. > > > > > > Best regards, > > Dongshan > > > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"