diff options
author | Damjan Marion <damarion@cisco.com> | 2017-03-16 11:32:09 +0100 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2017-03-16 13:06:27 +0000 |
commit | e9f929b52ddb741ec1e4cb2d92c6be1e798933a0 (patch) | |
tree | 1843d4798292dbd17d27ad3fab3c833388eaaf62 /src/vnet/hdlc | |
parent | 3cc4971882235a539bc6177e8e4b4d92129b3a12 (diff) |
vlib: make runtime_data thread-local
Change-Id: I4aa3e7e42fb81211de1aed07dc7befee87a1e18b
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/hdlc')
-rw-r--r-- | src/vnet/hdlc/node.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/vnet/hdlc/node.c b/src/vnet/hdlc/node.c index 4fe0296aca1..57e04c85bae 100644 --- a/src/vnet/hdlc/node.c +++ b/src/vnet/hdlc/node.c @@ -285,18 +285,9 @@ VLIB_REGISTER_NODE (hdlc_input_node) = { .unformat_buffer = unformat_hdlc_header, }; -static clib_error_t * hdlc_input_init (vlib_main_t * vm) +static clib_error_t * hdlc_input_runtime_init (vlib_main_t * vm) { hdlc_input_runtime_t * rt; - - { - clib_error_t * error = vlib_call_init_function (vm, hdlc_init); - if (error) - clib_error_report (error); - } - - hdlc_setup_node (vm, hdlc_input_node.index); - rt = vlib_node_get_runtime_data (vm, hdlc_input_node.index); rt->next_by_protocol = sparse_vec_new @@ -313,7 +304,23 @@ static clib_error_t * hdlc_input_init (vlib_main_t * vm) return 0; } +static clib_error_t * hdlc_input_init (vlib_main_t * vm) +{ + + { + clib_error_t * error = vlib_call_init_function (vm, hdlc_init); + if (error) + clib_error_report (error); + } + + hdlc_setup_node (vm, hdlc_input_node.index); + hdlc_input_runtime_init (vm); + + return 0; +} + VLIB_INIT_FUNCTION (hdlc_input_init); +VLIB_WORKER_INIT_FUNCTION (hdlc_input_runtime_init); void hdlc_register_input_protocol (vlib_main_t * vm, |