2 * Copyright (c) 2014 Nicira, Inc.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
26 #define OVS_CORE_UNSPEC INT_MAX
27 #define OVS_NUMA_UNSPEC INT_MAX
29 /* Dump of a list of 'struct ovs_numa_info'. */
30 struct ovs_numa_dump {
34 /* A numa_id - core_id pair. */
35 struct ovs_numa_info {
36 struct ovs_list list_node;
43 void ovs_numa_init(void);
44 bool ovs_numa_numa_id_is_valid(int numa_id);
45 bool ovs_numa_core_id_is_valid(int core_id);
46 bool ovs_numa_core_is_pinned(int core_id);
47 int ovs_numa_get_n_numas(void);
48 void ovs_numa_set_cpu_mask(const char *cmask);
49 int ovs_numa_get_n_cores(void);
50 int ovs_numa_get_numa_id(int core_id);
51 int ovs_numa_get_n_cores_on_numa(int numa_id);
52 int ovs_numa_get_n_unpinned_cores_on_numa(int numa_id);
53 bool ovs_numa_try_pin_core_specific(int core_id);
54 int ovs_numa_get_unpinned_core_any(void);
55 int ovs_numa_get_unpinned_core_on_numa(int numa_id);
56 void ovs_numa_unpin_core(int core_id);
57 struct ovs_numa_dump *ovs_numa_dump_cores_on_numa(int numa_id);
58 void ovs_numa_dump_destroy(struct ovs_numa_dump *);
60 #define FOR_EACH_CORE_ON_NUMA(ITER, DUMP) \
61 LIST_FOR_EACH((ITER), list_node, &(DUMP)->dump)
72 ovs_numa_numa_id_is_valid(int numa_id OVS_UNUSED)
78 ovs_numa_core_id_is_valid(int core_id OVS_UNUSED)
84 ovs_numa_core_is_pinned(int core_id OVS_UNUSED)
90 ovs_numa_set_cpu_mask(const char *cmask OVS_UNUSED)
96 ovs_numa_get_n_numas(void)
98 return OVS_NUMA_UNSPEC;
102 ovs_numa_get_n_cores(void)
104 return OVS_CORE_UNSPEC;
108 ovs_numa_get_numa_id(int core_id OVS_UNUSED)
110 return OVS_NUMA_UNSPEC;
114 ovs_numa_get_n_cores_on_numa(int numa_id OVS_UNUSED)
116 return OVS_CORE_UNSPEC;
120 ovs_numa_get_n_unpinned_cores_on_numa(int numa_id OVS_UNUSED)
122 return OVS_CORE_UNSPEC;
126 ovs_numa_try_pin_core_specific(int core_id OVS_UNUSED)
132 ovs_numa_get_unpinned_core_any(void)
134 return OVS_CORE_UNSPEC;
138 ovs_numa_get_unpinned_core_on_numa(int numa_id OVS_UNUSED)
140 return OVS_CORE_UNSPEC;
144 ovs_numa_unpin_core(int core_id OVS_UNUSED)
149 static inline struct ovs_numa_dump *
150 ovs_numa_dump_cores_on_numa(int numa_id OVS_UNUSED)
156 ovs_numa_dump_destroy(struct ovs_numa_dump *dump OVS_UNUSED)
162 #define FOR_EACH_CORE_ON_NUMA(ITER, DUMP) \
163 for ((ITER) = NULL; (ITER);)
165 #endif /* __linux__ */
166 #endif /* ovs-thead.h */