Re: speed tests (Re: Replace bcopy() to update ether_addr)

2012-08-22 Thread Mitya
22.08.2012 17:36, Luigi Rizzo написал: On Wed, Aug 22, 2012 at 02:32:21AM +, Bruce Evans wrote: luigi wrote: even more orthogonal: I found that copying 8n + (5, 6 or 7) bytes was much much slower than copying a multiple of 8 bytes. For n=0, 1,2,4,8 bytes are efficient, other cases are slo

Re: Replace bcopy() to update ether_addr

2012-08-21 Thread Mitya
21.08.2012 14:26, Marius Strobl написал: On Mon, Aug 20, 2012 at 01:20:29PM -0600, Warner Losh wrote: On Aug 20, 2012, at 1:17 PM, Wojciech Puchar wrote: or use ++. i think it is always aligned to 2 bytes and this should produce usable code on any CPU? should be 6 instructions on MIPS and PP

Re: Replace bcopy() to update ether_addr

2012-08-21 Thread Mitya
20.08.2012 22:20, Warner Losh написал: On Aug 20, 2012, at 1:17 PM, Wojciech Puchar wrote: or use ++. i think it is always aligned to 2 bytes and this should produce usable code on any CPU? should be 6 instructions on MIPS and PPC IMHO. We should tag it as __aligned(2) then, no? If so, then

Replace bcopy() to update ether_addr

2012-08-20 Thread Mitya
Hi. I found some overhead code in /src/sys/net/if_ethersubr.c and /src/sys/netgraph/ng_ether.c It contains strings, like bcopy(src, dst, ETHER_ADDR_LEN); When src and dst are "struct ether_addr*", and ETHER_ADDR_LEN equal 6. This code call every time, when we send Ethernet packet. On example, o