Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Aug 2012 13:50:04 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Adrian Chadd <adrian@freebsd.org>
Cc:        freebsd-hackers@freebsd.org, freebsd-net@freebsd.org, Mitya <mitya@cabletv.dp.ua>, John Baldwin <jhb@freebsd.org>, Wojciech Puchar <wojtek@wojtek.tensor.gdynia.pl>
Subject:   Re: Replace bcopy() to update ether_addr
Message-ID:  <3952D2BB-2181-430C-86BC-F9F90706C7A0@bsdimp.com>
In-Reply-To: <CAJ-Vmo=1cbJn3pkSvoCq7y-kEGig-h1Vxo6M5V0=b9=MkfuMRA@mail.gmail.com>
References:  <50324DB4.6080905@cabletv.dp.ua> <420BA06C-C776-47DB-B3BB-F1414C115F99@bsdimp.com> <CAJ-VmokQLD6YgyrsOyez=3cLm4Q8jZOnJ9vo4Wq3sjRu%2BG-E7A@mail.gmail.com> <201208220802.14588.jhb@freebsd.org> <CAJ-Vmo=1cbJn3pkSvoCq7y-kEGig-h1Vxo6M5V0=b9=MkfuMRA@mail.gmail.com>

index | next in thread | previous in thread | raw e-mail


On Aug 22, 2012, at 12:54 PM, Adrian Chadd wrote:

> On 22 August 2012 05:02, John Baldwin <jhb@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.

But it isn't an array of things.  It is a structure.a

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

Which is why we need to check that output to make sure it isn't too horrible.

Warner



home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3952D2BB-2181-430C-86BC-F9F90706C7A0>