netmap BUG found on big endian machine

Adrian Chadd adrian at freebsd.org
Sun Sep 14 16:42:44 UTC 2014


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 at 126.com> wrote:
> Hi,
>
>
>
>        I have tested netmap on freescale PowerPC board, it is a big endian
> machine, when I test the example app pkt-gen, I found one bug, really it is
> bug of netmap souce code.
>
>        The commit id is “d39c4411a2129926d262f9faffacaf876392c7cd”, the
> bug locates in “netmap_mem2.c, netmap_mem_rings_create()”, you should use
>
> “*(uint32_t *)(uintptr_t)&ring->nr_buf_size =
> NETMAP_BDG_BUF_SIZE(na->nm_mem);” substituting
>
> “*(uint16_t *)(uintptr_t)&ring->nr_buf_size =
> NETMAP_BDG_BUF_SIZE(na->nm_mem);”
>
>        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’t run big endian machine directly.
>
>
>
>
>
> Best regards,
>
> Dongshan
>
>
>
> _______________________________________________
> freebsd-net at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"


More information about the freebsd-net mailing list