Fix the following error on NetBSD 7.0.
../lib/ovs-numa.c: In function 'ovs_numa_set_cpu_mask':
../lib/ovs-numa.c:555:9: error: array subscript has type 'char' [-Werror=char-subscripts]
Signed-off-by: YAMAMOTO Takashi <yamamoto@ovn.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
This option is used to initialize the ovs_numa module with a fake
configuration and to avoid pthread_setaffinity_np() calls. It will be
useful to test dpif-netdev with pmd threads.
Since it is only used for testing it is not documented in the man pages.
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
This commit moves the code that sets the pmd threads affinity from
netdev-dpdk to ovs-numa. There's one small part left in netdev-dpdk, to
set the lcore_id.
Now dpif-netdev will call both modules (ovs-numa and netdev-dpdk) when
starting a pmd thread.
This change will allow having a dummy implementation of the set affinity
call, for testing purposes.
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
Instead of having static inline stubs for non linux platform we can use
the implementations in ovs-numa.c. With one small change to
ovs_numa_dump_cores_on_numa(), they will behave exactly like the
stubs for the non-linux case, because 'found_numa_and_core' will be
false and the socket and cpu hmaps will be empty.
There are a few places where conditional compilation is required: the
code that parses the linux specific sysfs entries and its dependencies.
It requires opendir() and readdir() and doesn't make sense outside of
linux anyway.
This change is required to have a cross-platform ovs-numa dummy
implementation for testing.
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
This attempts to prevent namespace collisions with other list libraries
Signed-off-by: Ben Warren <ben@skyportsystems.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
If CONFIG_NUMA disabled in the system, PMD threads can't
be created:
|ovs_numa|INFO|Discovered 0 NUMA nodes and 0 CPU cores
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
DPDK lcore_id is unsigned. We need to support big values like
LCORE_ID_ANY (=UINT32_MAX). Therefore I am changing the type everywhere
in OVS.
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
This commit refines the ovs-numa module by eliminating
duplicated codes and exposing API for dumping the cores
on numa node.
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
A new function vlog_insert_module() is introduced to avoid using
list_insert() from the vlog.h header.
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
struct list is a common name and can't be used in public headers.
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
This commit adds support in ovs-numa module for reading a user
specified cpu mask, which configures the availability of the cores.
The cpu mask has the format of a hex string similar to the EAL '-c
COREMASK' option input or the 'taskset' mask input. The lowest order
bit corresponds to the first CPU core. Bit value '1' means the
corresponding core is available.
An upcoming patch will allow user to configure the mask via OVSDB.
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
This commit updates the pointer to 'struct numa_node'
when initializing the 'struct cpu_core'.
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Many of the ovs_numa_*() functions abort the program when the
input cpu socket or core id is invalid. This commit relaxes
the input check and makes these functions return OVS_*_UNSPEC
when the check fails.
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
'numa' and 'socket' are currently used interchangeably in ovs-numa.
But they are not always equivalent as some platform can have multiple
sockets on a numa node. To avoid confusion, this commit renames all
the 'cpu_socket' to 'numa_node'.
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
list_size() yields a size_t, not uint64_t, and these types are different on
32-bit targets.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>