From owner-svn-src-all@FreeBSD.ORG Fri Nov 15 15:44:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04FF6462; Fri, 15 Nov 2013 15:44:10 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CD95721B1; Fri, 15 Nov 2013 15:44:09 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B642FB979; Fri, 15 Nov 2013 10:44:08 -0500 (EST) From: John Baldwin To: Bruce Evans Subject: Re: svn commit: r258142 - head/sys/net Date: Fri, 15 Nov 2013 10:05:59 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201311142007.rAEK7InH068095@svn.freebsd.org> <20131115223304.R2093@besplex.bde.org> In-Reply-To: <20131115223304.R2093@besplex.bde.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201311151005.59405.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 15 Nov 2013 10:44:08 -0500 (EST) Cc: svn-src-head@freebsd.org, George Neville-Neil , svn-src-all@freebsd.org, Sergey Kandaurov , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Nov 2013 15:44:10 -0000 On Friday, November 15, 2013 7:23:23 am Bruce Evans wrote: > On Thu, 14 Nov 2013, George Neville-Neil wrote: > Does the API require defining OUI_FREEBSD as a value that needs to be > shifted left by 24 to use? It would be more useful to define it as the > left-shifted value. Then it gives the base for the FreeBSD range. > Values that aren't left shifted have the advantage of fitting in 32 bits, > so that their natural type is always int the type needed to hold the > left-shifted value can be implementation-defined (it should be int64_t > on 32-bit systems and long on 64-bit systems). The API is free to be whatever we want. I agree that it would be simpler to make the full value explicit. Perhaps something like this: #define OUI_FREEBSD_BASE 0x589cfc000000 #define OUI_FREEBSD(nic) (OUI_FREEBSD_BASE | (nic)) And then you can have: #define OUI_FREEBSD_BHYVE_LOW OUI_FREEBSD(0x000001) #define OUI_FREEBSD_BHYVE_HIGH OUI_FREEBSD(0x00ffff) That avoids the needs for any casts, etc. -- John Baldwin