svn commit: r312687 - in head/sys: net sys

Gleb Smirnoff glebius at FreeBSD.org
Tue Jan 24 19:27:35 UTC 2017


  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.


More information about the svn-src-head mailing list