Changeset View
Changeset View
Standalone View
Standalone View
sys/net/route/route_tables.c
Show First 20 Lines • Show All 283 Lines • ▼ Show 20 Lines | #endif | ||||
grow_rtables(V_rt_numfibs); | grow_rtables(V_rt_numfibs); | ||||
RTABLES_UNLOCK(); | RTABLES_UNLOCK(); | ||||
} | } | ||||
VNET_SYSINIT(vnet_rtables_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_FOURTH, | VNET_SYSINIT(vnet_rtables_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_FOURTH, | ||||
vnet_rtables_init, 0); | vnet_rtables_init, 0); | ||||
#ifdef VIMAGE | #ifdef VIMAGE | ||||
static void | static void | ||||
rtables_destroy(const void *unused __unused) | rtables_flush(const void *unused __unused) | ||||
{ | { | ||||
struct rib_head *rnh; | struct rib_head *rnh; | ||||
struct domain *dom; | struct domain *dom; | ||||
int family; | int family; | ||||
RTABLES_LOCK(); | RTABLES_LOCK(); | ||||
SLIST_FOREACH(dom, &domains, dom_next) { | SLIST_FOREACH(dom, &domains, dom_next) { | ||||
if (dom->dom_rtdetach == NULL) | if (dom->dom_rtdetach == NULL) | ||||
continue; | continue; | ||||
family = dom->dom_family; | family = dom->dom_family; | ||||
for (int i = 0; i < V_rt_numfibs; i++) { | for (int i = 0; i < V_rt_numfibs; i++) { | ||||
rnh = rt_tables_get_rnh(i, family); | rnh = rt_tables_get_rnh(i, family); | ||||
dom->dom_rtdetach(rnh); | dom->dom_rtdetach(rnh); | ||||
// FIXME give other components a chance to cleanup nh ref ? | |||||
// XXX RIB_NOTIFY_DELAYED ? | |||||
// rib_notify(rnh, RIB_NOTIFY_IMMEDIATE, NULL); | |||||
} | } | ||||
} | } | ||||
RTABLES_UNLOCK(); | RTABLES_UNLOCK(); | ||||
} | |||||
VNET_SHUTDOWN(rtables_flush, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, | |||||
rtables_flush, NULL); | |||||
static void | |||||
rtables_destroy(const void *unused __unused) | |||||
{ | |||||
/* | /* | ||||
* dom_rtdetach calls rt_table_destroy(), which | * dom_rtdetach calls rt_table_destroy(), which | ||||
* schedules deletion for all rtentries, nexthops and control | * schedules deletion for all rtentries, nexthops and control | ||||
* structures. Wait for the destruction callbacks to fire. | * structures. Wait for the destruction callbacks to fire. | ||||
* Note that this should result in freeing all rtentries, but | * Note that this should result in freeing all rtentries, but | ||||
* nexthops deletions will be scheduled for the next epoch run | * nexthops deletions will be scheduled for the next epoch run | ||||
* and will be completed after vnet teardown. | * and will be completed after vnet teardown. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |