Replace bcopy() to update ether_addr

Adrian Chadd adrian at freebsd.org
Wed Aug 22 18:54:07 UTC 2012


On 22 August 2012 05:02, John Baldwin <jhb at freebsd.org> wrote:
> On Tuesday, August 21, 2012 12:34:42 pm Adrian Chadd wrote:
>> 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.
>
> I doubt we even _need_ the ugliness.  We should just use *dst = *src
> unless there is a compelling reason not to.

Because it's not very clear? :-) I'd much prefer my array-of-things
copies to be explicit.

Also, the optimisation and compiler silliness may not be THAT obvious
on intel (except when you're luigi and using netmap) but I can't help
but wonder whether the same does hold for MIPS/ARM. Getting it wrong
there will lead to some very very poor performing code.



Adrian


More information about the freebsd-net mailing list