diff options
author | Yi-Hung Wei <yihung.wei@gmail.com> | 2020-01-03 17:13:26 -0800 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2020-01-18 02:11:39 +0100 |
commit | e8568993e062afcb75a7a54b1a615f04d7d6df37 (patch) | |
tree | d3b4ae4a9fb100baf9e97bd226d665a4781979d4 /include/sparse/numa.h | |
parent | 105cf8df82f75d38b3afe1d7e1a4fe421f767ca2 (diff) | |
download | openvswitch-e8568993e062afcb75a7a54b1a615f04d7d6df37.tar.gz |
netdev-afxdp: NUMA-aware memory allocation for XSK related memory.
Currently, the AF_XDP socket (XSK) related memory are allocated by main
thread in the main thread's NUMA domain. With the patch that detects
netdev-linux's NUMA node id, the PMD thread of AF_XDP port will be run on
the AF_XDP netdev's NUMA domain. If the net device's NUMA domain
is different from the main thread's NUMA domain, we will have two
cross-NUMA memory accesses (netdev <-> memory, memory <-> CPU).
This patch addresses the aforementioned issue by allocating
the memory in the net device's NUMA domain.
Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Acked-by: William Tu <u9012063@gmail.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'include/sparse/numa.h')
-rw-r--r-- | include/sparse/numa.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/sparse/numa.h b/include/sparse/numa.h new file mode 100644 index 000000000..3691a0eaf --- /dev/null +++ b/include/sparse/numa.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2019 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __CHECKER__ +#error "Use this header only with sparse. It is not a correct implementation." +#endif + +/* Avoid sparse warning: non-ANSI function declaration of function" */ +#define numa_get_membind_compat() numa_get_membind_compat(void) +#define numa_get_interleave_mask_compat() numa_get_interleave_mask_compat(void) +#define numa_get_run_node_mask_compat() numa_get_run_node_mask_compat(void) + +/* Get actual <numa.h> definitions for us to annotate and build on. */ +#include_next<numa.h> |