From owner-svn-src-head@freebsd.org Mon Jan 4 14:56:56 2016 Return-Path: Delivered-To: svn-src-head@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 061B6A606C0; Mon, 4 Jan 2016 14:56:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB22C13DF; Mon, 4 Jan 2016 14:56:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 61A49B979; Mon, 4 Jan 2016 09:56:54 -0500 (EST) From: John Baldwin To: Garrett Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293112 - head/sys/dev/ixl Date: Sun, 03 Jan 2016 14:23:05 -0800 Message-ID: <1740114.0GzEsp8E6P@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201601031809.u03I9lNJ091471@repo.freebsd.org> References: <201601031809.u03I9lNJ091471@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 04 Jan 2016 09:56:54 -0500 (EST) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 14:56:56 -0000 On Sunday, January 03, 2016 06:09:47 PM Garrett Cooper wrote: > Author: ngie > Date: Sun Jan 3 18:09:46 2016 > New Revision: 293112 > URL: https://svnweb.freebsd.org/changeset/base/293112 > > Log: > Fix ixl(4) compilation with PCI_IOV pre-r266974 > > stable/10 doesn't have the if_getdrvflags(9) KPI. Reference the field in the > structure directly if the __FreeBSD_version is < 1100022, so the driver can > be built with PCI_IOV support on stable/10, without backporting all of > r266974 (which requires additional changes due to projects/ifnet, etc) > > Differential Revision: https://reviews.freebsd.org/D4759 > Reviewed by: erj, sbruno > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sys/dev/ixl/if_ixl.c > > Modified: head/sys/dev/ixl/if_ixl.c > ============================================================================== > --- head/sys/dev/ixl/if_ixl.c Sun Jan 3 17:58:11 2016 (r293111) > +++ head/sys/dev/ixl/if_ixl.c Sun Jan 3 18:09:46 2016 (r293112) > @@ -6606,7 +6606,11 @@ ixl_iov_uninit(device_t dev) > pf->veb_seid = 0; > } > > +#if __FreeBSD_version > 1100022 > if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) > +#else > + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) > +#endif > ixl_disable_intr(vsi); FWIW, it is probably simpler to do something like this in an ixl header instead: #if __FreeBSD_version <= 1100022 #define if_getdrvflags(ifp) (ifp)->if_drv_flags #endif In the past when the Intel drivers have used compat shims they have preferred this method (defining compat macros for "new" APIs on old OS versions) instead of using #ifdef's in the code itself. -- John Baldwin