2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 05:47:55 +00:00

2 Commits

Author SHA1 Message Date
Ilya Maximets
d6501c6605 sparse: Fix numa.h for libnuma >= 2.0.13.
Current numa.h header for sparse re-defines functions in a way
that breaks the header from libnuma 2.0.13+, because the original
issue was fixed in that version:
  25dcde021d

Sparse errors as a result:

  lib/netdev-afxdp.c: note: in included file (through include/sparse/numa.h):
  /usr/include/numa.h:346:26: error: macro "numa_get_interleave_mask_compat"
                                     passed 1 arguments, but takes just 0
  /usr/include/numa.h:376:26: error: macro "numa_get_membind_compat"
                                     passed 1 arguments, but takes just 0
  /usr/include/numa.h:406:26: error: macro "numa_get_run_node_mask_compat"
                                     passed 1 arguments, but takes just 0
  /usr/include/numa.h:347:1: error: Expected ; at end of declaration
  /usr/include/numa.h:347:1: error: got {
  /usr/include/numa.h:351:9: error: 'tp' has implicit type

It's hard to adjust defines to work with both versions of a header.
Just defining all the functions we actually use in OVS instead and
not including the original header.

Fixes: e8568993e062 ("netdev-afxdp: NUMA-aware memory allocation for XSK related memory.")
Reviewed-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2023-02-03 15:58:29 +01:00
Yi-Hung Wei
e8568993e0 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>
2020-01-18 02:11:39 +01:00