Date: Sun, 14 Sep 2014 09:42:42 -0700 From: Adrian Chadd <adrian@freebsd.org> To: dongshan <thomasyang1206@126.com> Cc: "net@freebsd.org" <net@freebsd.org> Subject: Re: netmap BUG found on big endian machine Message-ID: <CAJ-Vmonx%2BFvT2wh-LY%2BQDeeMxuT4-abyQ0NTOnqZ2vcSHUoCkA@mail.gmail.com> In-Reply-To: <001e01cfd02a$255cb430$70161c90$@126.com> References: <001e01cfd02a$255cb430$70161c90$@126.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <thomasyang1206@126.com> 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"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmonx%2BFvT2wh-LY%2BQDeeMxuT4-abyQ0NTOnqZ2vcSHUoCkA>