Date: Tue, 24 Jan 2017 11:27:25 -0800 From: Gleb Smirnoff <glebius@FreeBSD.org> To: Dexuan Cui <dexuan@FreeBSD.org> 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> In-Reply-To: <201701240919.v0O9JlM7021007@repo.freebsd.org> References: <201701240919.v0O9JlM7021007@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170124192725.GX2611>