1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2020 Mellanox Technologies, Ltd
5 #include "mlx5_flow_os.h"
7 #include <rte_thread.h>
9 /* Key of thread specific flow workspace data. */
10 static rte_tls_key key_workspace;
13 mlx5_flow_os_init_workspace_once(void)
15 if (rte_thread_tls_key_create(&key_workspace, flow_release_workspace)) {
16 DRV_LOG(ERR, "Can't create flow workspace data thread key.");
23 mlx5_flow_os_get_specific_workspace(void)
25 return rte_thread_tls_value_get(key_workspace);
29 mlx5_flow_os_set_specific_workspace(struct mlx5_flow_workspace *data)
31 return rte_thread_tls_value_set(key_workspace, data);
35 mlx5_flow_os_release_workspace(void)
37 rte_thread_tls_key_delete(key_workspace);