vty_config_lockless();
zebrad.master = frr_init();
+ /* Initialize pthread library */
+ frr_pthread_init();
+
/* Zebra related initialize. */
zebra_router_init();
zserv_init();
/* Needed for BSD routing socket. */
pid = getpid();
- /* Intialize pthread library */
- frr_pthread_init();
-
/* Start Zebra API server */
zserv_start(zserv_path);
_Atomic uint32_t dg_routes_queued_max;
_Atomic uint32_t dg_route_errors;
+ /* Dataplane pthread */
+ struct frr_pthread *dg_pthread;
+
/* Event-delivery context 'master' for the dplane */
struct thread_master *dg_master;
zdplane_info.dg_max_queued_updates = DPLANE_DEFAULT_MAX_QUEUED;
/* TODO -- register default kernel 'provider' during init */
+ zdplane_info.dg_run = true;
+
+ /* Start dataplane pthread */
zdplane_info.dg_run = true;
- /* TODO -- start dataplane pthread. We're using the zebra
- * core/main thread temporarily
- */
- zdplane_info.dg_master = zebra->master;
+ struct frr_pthread_attr pattr = {
+ .start = frr_pthread_attr_default.start,
+ .stop = frr_pthread_attr_default.stop
+ };
+
+ zdplane_info.dg_pthread = frr_pthread_new(&pattr, "Zebra dplane thread",
+ "Zebra dplane");
+
+ zdplane_info.dg_master = zdplane_info.dg_pthread->master;
+
+ frr_pthread_run(zdplane_info.dg_pthread, NULL);
}
/* Indicates zebra shutdown/exit is in progress. Some operations may be
THREAD_OFF(zdplane_info.dg_t_update);
- /* TODO */
- /* frr_pthread_stop(...) */
+ frr_pthread_stop(zdplane_info.dg_pthread, NULL);
+
+ /* Destroy pthread */
+ frr_pthread_destroy(zdplane_info.dg_pthread);
+ zdplane_info.dg_pthread = NULL;
+ zdplane_info.dg_master = NULL;
/* Notify provider(s) of final shutdown */