Re: Replace bcopy() to update ether_addr

2012-08-21 Thread Mitya
22.08.2012 05:07, Bruce Evans написал: On Mon, Aug 20, 2012 at 05:46:12PM +0300, Mitya wrote: 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

Incorrect ARP table entries

2012-08-21 Thread Peter Jeremy
I've run into a problem where the ARP table on several of my hosts is apparently spontaneously replacing correct entries with incorrect MAC addresses. I've done some digging with tcpdump and can't identify the cause. I've tried to look in the code but lost my way since ARP and IP routing seem to

Re: Replace bcopy() to update ether_addr

2012-08-21 Thread Bruce Evans
jhb wrote: > On Monday, August 20, 2012 10:46:12 am Mitya wrote: > > ... > > I propose this solution. > > > > In file /usr/src/include/net/ethernet.h add this lines: > > > > static inline void ether_addr_copy(ether_addr* src, ether_addr* dst) { > > #if defined(__i386__) || defined(__amd64__) > >

Re: Replace bcopy() to update ether_addr

2012-08-21 Thread Bruce Evans
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 slow (turned into 2 or 3 different writes). > > The netmap code uses a pkt_copy routine that doe

Re: Replace bcopy() to update ether_addr

2012-08-21 Thread Bruce Evans
> On Mon, Aug 20, 2012 at 05:46:12PM +0300, Mitya wrote: > > 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

Re: 82574L hangs (with r233708 e1000 driver).

2012-08-21 Thread Jason Wolfe
On Fri, Aug 17, 2012 at 7:23 AM, Barney Cordoba wrote: > > --- On Thu, 8/9/12, Jason Wolfe wrote: >> >> Ever since r235553 the 82574L has been stable for me, >> collectively >> passing ~1.2Tb/s for the past 4 months without issue. >> We did have >> some issues with switches not liking the fallout

Problem with link aggregation + sshd

2012-08-21 Thread Giulio Ferro
Scenario : freebsd 9 stable (yesterday) amd64 on HP server with 4 nic (igb) 1 nic is connected standalone to the management switch, the 3 other nics are connected to a switch configured for aggregation. If I configure the first nic (igb0) there is no problem, I can operate as I normally do and s

Re: Replace bcopy() to update ether_addr

2012-08-21 Thread Adrian Chadd
Hi, What about just creating an ETHER_ADDR_COPY(dst, src) and putting that in a relevant include file, then hide the ugliness there? The same benefits will likely appear when copying wifi MAC addresses to/from headers. Thanks, I'm glad someone noticed this. Adrian ___

Re: Replace bcopy() to update ether_addr

2012-08-21 Thread Warner Losh
On Aug 21, 2012, at 1:42 AM, Wojciech Puchar wrote: >> >> Even without this tagging, the code to do a structure level copy of 6 bytes >> is going to be tiny... > > true. > > just to make sure it will be absolutely portable how about > > bcopymacaddress(dst,src) > > and then define it whatev

Re: Replace bcopy() to update ether_addr

2012-08-21 Thread John Baldwin
On Monday, August 20, 2012 10:46:12 am Mitya wrote: > 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 c

Re: Replace bcopy() to update ether_addr

2012-08-21 Thread Warner Losh
On Aug 21, 2012, at 5:26 AM, Marius Strobl wrote: > 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 C

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 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 PPC IMHO. > >>

Re: Replace bcopy() to update ether_addr

2012-08-21 Thread Luigi Rizzo
On Tue, Aug 21, 2012 at 12:26:30PM +0200, Marius Strobl wrote: ... > > Why we are use bcopy(), to copy only 6 bytes? > > Answer - in some architectures we are can not directly copy unaligned data. > > > > I propose this solution. > > > > In file /usr/src/include/net/ethernet.h add this lines: > >

Re: Replace bcopy() to update ether_addr

2012-08-21 Thread Marius Strobl
On Mon, Aug 20, 2012 at 05:46:12PM +0300, Mitya wrote: > 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. > Thi

Re: Replace bcopy() to update ether_addr

2012-08-21 Thread Wojciech Puchar
Even without this tagging, the code to do a structure level copy of 6 bytes is going to be tiny... true. just to make sure it will be absolutely portable how about bcopymacaddress(dst,src) and then define it whatever you find it fastest on any architecture? _