From owner-svn-src-all@freebsd.org Tue Jan 24 19:27:34 2017 Return-Path: Delivered-To: svn-src-all@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 F3339CC000C; Tue, 24 Jan 2017 19:27:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C10D41D6B; Tue, 24 Jan 2017 19:27:31 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v0OJRPRb013573 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 24 Jan 2017 11:27:25 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v0OJRPjC013572; Tue, 24 Jan 2017 11:27:25 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 24 Jan 2017 11:27:25 -0800 From: Gleb Smirnoff To: Dexuan Cui Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312687 - in head/sys: net sys Message-ID: <20170124192725.GX2611@FreeBSD.org> References: <201701240919.v0O9JlM7021007@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201701240919.v0O9JlM7021007@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 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: Tue, 24 Jan 2017 19:27:35 -0000 Dexuan, On Tue, Jan 24, 2017 at 09:19:47AM +0000, Dexuan Cui wrote: D> Author: dexuan D> Date: Tue Jan 24 09:19:46 2017 D> New Revision: 312687 D> URL: https://svnweb.freebsd.org/changeset/base/312687 D> D> Log: D> ifnet: introduce event handlers for ifup/ifdown events D> D> Hyper-V's NIC SR-IOV implementation needs a Hyper-V synthetic NIC and D> a VF NIC to work together, mainly to support seamless live migration. D> D> When the VF device becomes UP (or DOWN), the synthetic NIC driver needs D> to switch the data path from the synthetic NIC to the VF (or the opposite). D> D> So the synthetic NIC driver needs to know when a VF device is becoming D> UP or DOWN and hence the patch is made. D> D> Reviewed by: sephe D> Approved by: sephe (mentor) D> MFC after: 2 weeks D> Sponsored by: Microsoft D> Differential Revision: https://reviews.freebsd.org/D8963 D> D> Modified: D> head/sys/net/if.c D> head/sys/sys/eventhandler.h ... D> Modified: head/sys/sys/eventhandler.h D> ============================================================================== D> --- head/sys/sys/eventhandler.h Tue Jan 24 09:15:36 2017 (r312686) D> +++ head/sys/sys/eventhandler.h Tue Jan 24 09:19:46 2017 (r312687) D> @@ -284,4 +284,11 @@ typedef void (*swapoff_fn)(void *, struc D> EVENTHANDLER_DECLARE(swapon, swapon_fn); D> EVENTHANDLER_DECLARE(swapoff, swapoff_fn); D> D> +/* ifup/ifdown events */ D> +#define IFNET_EVENT_UP 0 D> +#define IFNET_EVENT_DOWN 1 D> +struct ifnet; D> +typedef void (*ifnet_event_fn)(void *, struct ifnet *ifp, int event); D> +EVENTHANDLER_DECLARE(ifnet_event, ifnet_event_fn); D> + D> #endif /* _SYS_EVENTHANDLER_H_ */ The network stuff shall not be added to sys/eventhandler.h. All these declarations should go to net/if_var.h. There is already a block of event(9) defines there. Please move it there. -- Totus tuus, Glebius.