Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_subr.c
Show First 20 Lines • Show All 1,349 Lines • ▼ Show 20 Lines | deregister_tcp_functions(struct tcp_function_block *blk, bool quiesce, | ||||
} | } | ||||
/* Mark the block so no more stacks can use it. */ | /* Mark the block so no more stacks can use it. */ | ||||
blk->tfb_flags |= TCP_FUNC_BEING_REMOVED; | blk->tfb_flags |= TCP_FUNC_BEING_REMOVED; | ||||
/* | /* | ||||
* If TCBs are still attached to the stack, attempt to switch them | * If TCBs are still attached to the stack, attempt to switch them | ||||
* to the default stack. | * to the default stack. | ||||
*/ | */ | ||||
if (force && blk->tfb_refcnt) { | if (force && blk->tfb_refcnt) { | ||||
struct inpcb_iterator inpi = INP_ALL_ITERATOR(&V_tcbinfo, | |||||
INPLOOKUP_WLOCKPCB); | |||||
struct inpcb *inp; | struct inpcb *inp; | ||||
struct tcpcb *tp; | struct tcpcb *tp; | ||||
VNET_ITERATOR_DECL(vnet_iter); | VNET_ITERATOR_DECL(vnet_iter); | ||||
rw_wunlock(&tcp_function_lock); | rw_wunlock(&tcp_function_lock); | ||||
VNET_LIST_RLOCK(); | VNET_LIST_RLOCK(); | ||||
VNET_FOREACH(vnet_iter) { | VNET_FOREACH(vnet_iter) { | ||||
CURVNET_SET(vnet_iter); | CURVNET_SET(vnet_iter); | ||||
struct inpcb_iterator inpi = INP_ALL_ITERATOR(&V_tcbinfo, | |||||
INPLOOKUP_WLOCKPCB); | |||||
while ((inp = inp_next(&inpi)) != NULL) { | while ((inp = inp_next(&inpi)) != NULL) { | ||||
tp = intotcpcb(inp); | tp = intotcpcb(inp); | ||||
if (tp == NULL || tp->t_fb != blk) | if (tp == NULL || tp->t_fb != blk) | ||||
continue; | continue; | ||||
tcp_switch_back_to_default(tp); | tcp_switch_back_to_default(tp); | ||||
} | } | ||||
CURVNET_RESTORE(); | CURVNET_RESTORE(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 3,219 Lines • Show Last 20 Lines |