if_lagg.c (99031b8f7db9abdcc4e09848235e8ae9f20d2645) | if_lagg.c (70398c2f86e2fbc2120b4a11d9ec9284a6a395f5) |
---|---|
1/* $OpenBSD: if_trunk.c,v 1.30 2007/01/31 06:20:19 reyk Exp $ */ 2 3/* 4 * Copyright (c) 2005, 2006 Reyk Floeter <reyk@openbsd.org> 5 * Copyright (c) 2007 Andrew Thompson <thompsa@FreeBSD.org> 6 * Copyright (c) 2014, 2016 Marcelo Araujo <araujo@FreeBSD.org> 7 * 8 * Permission to use, copy, modify, and distribute this software for any --- 59 unchanged lines hidden (view full) --- 68#include <netinet6/in6_var.h> 69#include <netinet6/in6_ifattach.h> 70#endif 71 72#include <net/if_vlan_var.h> 73#include <net/if_lagg.h> 74#include <net/ieee8023ad_lacp.h> 75 | 1/* $OpenBSD: if_trunk.c,v 1.30 2007/01/31 06:20:19 reyk Exp $ */ 2 3/* 4 * Copyright (c) 2005, 2006 Reyk Floeter <reyk@openbsd.org> 5 * Copyright (c) 2007 Andrew Thompson <thompsa@FreeBSD.org> 6 * Copyright (c) 2014, 2016 Marcelo Araujo <araujo@FreeBSD.org> 7 * 8 * Permission to use, copy, modify, and distribute this software for any --- 59 unchanged lines hidden (view full) --- 68#include <netinet6/in6_var.h> 69#include <netinet6/in6_ifattach.h> 70#endif 71 72#include <net/if_vlan_var.h> 73#include <net/if_lagg.h> 74#include <net/ieee8023ad_lacp.h> 75 |
76#define LAGG_RLOCK() epoch_enter(net_epoch) 77#define LAGG_RUNLOCK() epoch_exit(net_epoch) | 76#define LAGG_RLOCK() epoch_enter_preempt(net_epoch_preempt) 77#define LAGG_RUNLOCK() epoch_exit_preempt(net_epoch_preempt) |
78#define LAGG_RLOCK_ASSERT() MPASS(in_epoch()) 79#define LAGG_UNLOCK_ASSERT() MPASS(!in_epoch()) 80 81#define LAGG_SX_INIT(_sc) sx_init(&(_sc)->sc_sx, "if_lagg sx") 82#define LAGG_SX_DESTROY(_sc) sx_destroy(&(_sc)->sc_sx) 83#define LAGG_XLOCK(_sc) sx_xlock(&(_sc)->sc_sx) 84#define LAGG_XUNLOCK(_sc) sx_xunlock(&(_sc)->sc_sx) 85#define LAGG_SXLOCK_ASSERT(_sc) sx_assert(&(_sc)->sc_sx, SA_LOCKED) --- 768 unchanged lines hidden (view full) --- 854 lagg_setcaps(lp, lp->lp_ifcapenable); 855 if_setlladdr(ifp, lp->lp_lladdr, ETHER_ADDR_LEN); 856 } 857 858 /* 859 * free port and release it's ifnet reference after a grace period has 860 * elapsed. 861 */ | 78#define LAGG_RLOCK_ASSERT() MPASS(in_epoch()) 79#define LAGG_UNLOCK_ASSERT() MPASS(!in_epoch()) 80 81#define LAGG_SX_INIT(_sc) sx_init(&(_sc)->sc_sx, "if_lagg sx") 82#define LAGG_SX_DESTROY(_sc) sx_destroy(&(_sc)->sc_sx) 83#define LAGG_XLOCK(_sc) sx_xlock(&(_sc)->sc_sx) 84#define LAGG_XUNLOCK(_sc) sx_xunlock(&(_sc)->sc_sx) 85#define LAGG_SXLOCK_ASSERT(_sc) sx_assert(&(_sc)->sc_sx, SA_LOCKED) --- 768 unchanged lines hidden (view full) --- 854 lagg_setcaps(lp, lp->lp_ifcapenable); 855 if_setlladdr(ifp, lp->lp_lladdr, ETHER_ADDR_LEN); 856 } 857 858 /* 859 * free port and release it's ifnet reference after a grace period has 860 * elapsed. 861 */ |
862 epoch_call(net_epoch, &lp->lp_epoch_ctx, lagg_port_destroy_cb); | 862 epoch_call(net_epoch_preempt, &lp->lp_epoch_ctx, lagg_port_destroy_cb); |
863 /* Update lagg capabilities */ 864 lagg_capabilities(sc); 865 lagg_linkstate(sc); 866 867 return (0); 868} 869 870static int --- 1333 unchanged lines hidden --- | 863 /* Update lagg capabilities */ 864 lagg_capabilities(sc); 865 lagg_linkstate(sc); 866 867 return (0); 868} 869 870static int --- 1333 unchanged lines hidden --- |