From owner-freebsd-net@FreeBSD.ORG Wed Aug 22 18:54:07 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BCE5F106564A; Wed, 22 Aug 2012 18:54:07 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 817AF8FC12; Wed, 22 Aug 2012 18:54:07 +0000 (UTC) Received: by pbbrp2 with SMTP id rp2so1953318pbb.13 for ; Wed, 22 Aug 2012 11:54:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=rZfpz1tHNTTbKu38ojel5PANQA/rJ6lxn/hzSdvoPfU=; b=i43JnjXohwftbPVV7ETFoNBPqMNitbFlA4cf6Fcx+ACbV3tfRv6wL2q8tjCIICbK2S fOKAwsUc9dHNCVnh8kQMaZFbt1Ha+SFsm8vR7aCUQGACKYmTWHhvxOieijY5sLTkYtrv yQoW19LSj8y4j9GgCvwyQZ6wUqce5cFEtkpAvw5KPqE/bXnxQCjPvhnugP31bL7Gyx7t rhIW+3sjbMCGyiclGld/mhCKycGJjO5X2KiDBpngFuLRAlh4gicnqjijIYlE5hwhH7YS WdExxnlGFKTWvS2wrcQqj6nF8xO0H59MlbemSezxKTt0ASq16s+XomJpXqZaRX5DZRQQ V4yw== MIME-Version: 1.0 Received: by 10.68.129.131 with SMTP id nw3mr55048357pbb.43.1345661647286; Wed, 22 Aug 2012 11:54:07 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.68.36.106 with HTTP; Wed, 22 Aug 2012 11:54:07 -0700 (PDT) In-Reply-To: <201208220802.14588.jhb@freebsd.org> References: <50324DB4.6080905@cabletv.dp.ua> <420BA06C-C776-47DB-B3BB-F1414C115F99@bsdimp.com> <201208220802.14588.jhb@freebsd.org> Date: Wed, 22 Aug 2012 11:54:07 -0700 X-Google-Sender-Auth: x8ry_dNw4_u3xMxdchT3PDLjlps Message-ID: From: Adrian Chadd To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org, freebsd-net@freebsd.org, Mitya , Warner Losh , Wojciech Puchar Subject: Re: Replace bcopy() to update ether_addr X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2012 18:54:07 -0000 On 22 August 2012 05:02, John Baldwin 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