Date: Wed, 22 Aug 2012 11:54:07 -0700 From: Adrian Chadd <adrian@freebsd.org> To: John Baldwin <jhb@freebsd.org> Cc: freebsd-hackers@freebsd.org, freebsd-net@freebsd.org, Mitya <mitya@cabletv.dp.ua>, Warner Losh <imp@bsdimp.com>, Wojciech Puchar <wojtek@wojtek.tensor.gdynia.pl> Subject: Re: Replace bcopy() to update ether_addr Message-ID: <CAJ-Vmo=1cbJn3pkSvoCq7y-kEGig-h1Vxo6M5V0=b9=MkfuMRA@mail.gmail.com> In-Reply-To: <201208220802.14588.jhb@freebsd.org> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
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. 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmo=1cbJn3pkSvoCq7y-kEGig-h1Vxo6M5V0=b9=MkfuMRA>