From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 18 08:12:30 2014 Return-Path: Delivered-To: freebsd-hackers@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 C9E3F814 for ; Mon, 18 Aug 2014 08:12:30 +0000 (UTC) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) by mx1.freebsd.org (Postfix) with ESMTP id A5268391B for ; Mon, 18 Aug 2014 08:12:30 +0000 (UTC) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 2F4675A9F24; Mon, 18 Aug 2014 08:12:23 +0000 (UTC) Date: Mon, 18 Aug 2014 08:12:23 +0000 From: Brooks Davis To: "Pokala, Ravi" Subject: Re: Common storage of original MAC address Message-ID: <20140818081223.GA6099@spindle.one-eyed-alien.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="W/nzBZO5zC0uMSeA" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Aug 2014 08:12:30 -0000 --W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Aug 17, 2014 at 11:31:19PM +0000, Pokala, Ravi wrote: > Hi folks, >=20 > At attach-time, the NIC drivers call ether_ifattach(), which stores the > MAC address in the sockaddr_dl. If the MAC is subsequently changed (like > by adding the interface to a lagg), if_setlladdr() changes the value in > the sockaddr_dl. At least, that's the way I'm reading things - is that > correct? >=20 > If so, then we do not keep a copy of the original MAC address. For a > couple of reasons (diagnostics, asset tracking and reporting), it would be > very nice if the original MAC were kept somewhere, even after the working > MAC was changed by if_setlladdr(). >=20 > Up till now, Panasas has been saving the original MAC in the softc of > specific network drivers that we use, and making it accessible via a > sysctl. That's something we have to do on a per-driver basis, and > something we have to keep track of on our own. We'd like to put that > information in a structure all the NIC drivers already use, and get that > code upstream. Storing it would require a simple change to > ether_ifattach() to stash it in the new location in addition to in the > sockaddr_dl, and adding some standard way (a new ioctl or sysctl?) to > access it. Notably, it would not require changing all the individual > drivers.=20 >=20 > Are there any objections to this idea? Any suggestions as to where we > might stash the original MAC? I think I'd store the original address in struct arpcom at attach time and publish it in the dev.. sysctl namespace. -- Brooks --W/nzBZO5zC0uMSeA Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlPxtWYACgkQXY6L6fI4GtQTtACfdpNlVcX4CV6JhSUbDh8cUnLy iFoAoN5Kw0y7GF47JMWLjc8352ZNtj0S =qp// -----END PGP SIGNATURE----- --W/nzBZO5zC0uMSeA--