From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 18 00:54:30 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 73855419 for ; Mon, 18 Aug 2014 00:54:30 +0000 (UTC) Received: from natasha.panasas.com (natasha.panasas.com [209.166.131.148]) by mx1.freebsd.org (Postfix) with ESMTP id 365083713 for ; Mon, 18 Aug 2014 00:54:29 +0000 (UTC) Received: from seabiscuit.panasas.com (seabiscuit.panasas.com [172.17.132.204]) by natasha.panasas.com (8.13.1/8.13.1) with ESMTP id s7HNVNKG023684 for ; Sun, 17 Aug 2014 19:31:24 -0400 Received: from SEABISCUIT.int.panasas.com ([172.17.132.204]) by seabiscuit ([172.17.132.204]) with mapi id 14.03.0181.006; Sun, 17 Aug 2014 16:31:23 -0700 From: "Pokala, Ravi" To: "freebsd-hackers@freebsd.org" Subject: Common storage of original MAC address Thread-Topic: Common storage of original MAC address Thread-Index: AQHPunNYUBEgYXTq+ky03AEN5pUz3Q== Date: Sun, 17 Aug 2014 23:31:19 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.4.3.140616 x-originating-ip: [172.17.28.63] Content-Type: text/plain; charset="us-ascii" Content-ID: <0B749EF31FB9724A957E83DAF9DEEB13@panasas.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 00:54:30 -0000 Hi folks, 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? 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(). 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 Are there any objections to this idea? Any suggestions as to where we might stash the original MAC? Thanks, Ravi