From owner-svn-src-stable-10@freebsd.org Thu May 18 23:41:35 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63B24D73A0D; Thu, 18 May 2017 23:41:35 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32310146F; Thu, 18 May 2017 23:41:35 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4INfYGM091541; Thu, 18 May 2017 23:41:34 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4INfYTM091540; Thu, 18 May 2017 23:41:34 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201705182341.v4INfYTM091540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Thu, 18 May 2017 23:41:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r318505 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 May 2017 23:41:35 -0000 Author: rpokala Date: Thu May 18 23:41:34 2017 New Revision: 318505 URL: https://svnweb.freebsd.org/changeset/base/318505 Log: Persistently store NIC's hardware MAC address, and add a way to retrive it jhb pointed out that (struct ifnet) is part of the network driver KBI, and thus the offsets of internal fields must not change. Therefore, move the new "if_hw_addr" field to the end, and consume one of the "if_pspare"s; that's what they're there for. Because netmap on stable/10 uses "if_pspare[0]", the new field replaces the *last* element of that array; that way, offsetof(if_pspare) is unchanged compared to before r318430. PR: 194386 Reviewed by: jhb Pointyhat to: rpokala Sponsored by: Panasas Modified: stable/10/sys/net/if_var.h Modified: stable/10/sys/net/if_var.h ============================================================================== --- stable/10/sys/net/if_var.h Thu May 18 23:41:18 2017 (r318504) +++ stable/10/sys/net/if_var.h Thu May 18 23:41:34 2017 (r318505) @@ -200,7 +200,6 @@ struct ifnet { (struct ifnet *, struct vnet *, char *); struct vnet *if_home_vnet; /* where this ifnet originates from */ struct ifaddr *if_addr; /* pointer to link-level address */ - void *if_hw_addr; /* hardware link-level address */ void *if_llsoftc; /* link layer softc */ int if_drv_flags; /* driver-managed status flags */ struct ifaltq if_snd; /* output queue (includes altq) */ @@ -260,7 +259,8 @@ struct ifnet { */ u_int if_hw_tsomaxsegcount; /* TSO maximum segment count */ u_int if_hw_tsomaxsegsize; /* TSO maximum segment size in bytes */ - void *if_pspare[8]; /* 1 netmap, 7 TDB */ + void *if_pspare[7]; /* 1 netmap, 6 TDB */ + void *if_hw_addr; /* hardware link-level address */ }; typedef void if_init_f_t(void *);