Merge in SNORT/snort3 from ~DZIKRATY/snort3:add_version_check_for_numactl to master
Squashed commit of the following:
commit
3bdbc66908dce164db28ec693021224e38d8263d
Author: Denys Zikratyi -X (dzikraty - SOFTSERVE INC at Cisco) <dzikraty@cisco.com>
Date: Wed Feb 26 07:13:27 2025 -0500
build: add version check for numactl
-find_path(NUMA_INCLUDE_DIRS numa.h)
-find_library(NUMA_LIBRARIES NAMES numa)
+find_package(PkgConfig)
+pkg_check_modules(PC_NUMA numa>=2.0.14)
-if(NUMA_INCLUDE_DIRS AND NUMA_LIBRARIES)
- set(NUMA_FOUND TRUE)
- set(NUMA_LIBRARIES ${NUMA_LIBRARIES})
- set(NUMA_INCLUDE_DIRS ${NUMA_INCLUDE_DIRS})
-endif()
-
-if (NOT NUMA_FOUND)
- find_package(PkgConfig)
- pkg_check_modules(PC_NUMA libnuma)
+if(PC_NUMA_FOUND)
+ find_path(NUMA_INCLUDE_DIRS
+ numa.h
+ HINTS ${NUMA_INCLUDE_DIR_HINT} ${PC_NUMA_INCLUDEDIR}
+ )
+ find_library(NUMA_LIBRARIES
+ NAMES numa
+ HINTS ${NUMA_LIBRARIES_DIR_HINT} ${PC_NUMA_LIBDIR}
+ )
- if(PC_NUMA_FOUND)
+ if(NUMA_INCLUDE_DIRS AND NUMA_LIBRARIES)
set(NUMA_FOUND TRUE)
- set(NUMA_INCLUDE_DIRS ${PC_NUMA_INCLUDEDIR} ${PC_NUMA_INCLUDE_DIRS})
- set(NUMA_LIBRARIES ${PC_NUMA_LIBDIR} ${PC_NUMA_LIBRARY_DIRS})
+ set(NUMA_LIBRARIES ${NUMA_LIBRARIES})
+ set(NUMA_INCLUDE_DIRS ${NUMA_INCLUDE_DIRS})
endif()
endif()
+
if(NUMA_FOUND)
set(HAVE_NUMA "1")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(NUMA DEFAULT_MSG NUMA_LIBRARIES NUMA_INCLUDE_DIRS)
-mark_as_advanced(NUMA_INCLUDE_DIRS NUMA_LIBRARIES)
\ No newline at end of file
+mark_as_advanced(NUMA_INCLUDE_DIRS NUMA_LIBRARIES)
--with-libml-libraries=DIR
libml library directory
--without-libml build Snort ML with mock of LibML
+ --with-libnuma-includes=DIR
+ libnuma include directory
+ --with-libnuma-libraries=DIR
+ libnuma library directory
Some influential variable definitions:
SIGNAL_SNORT_RELOAD=<int>
--without-libml)
append_cache_entry USE_LIBML_MOCK BOOL true
;;
+ --with-libnuma-includes=*)
+ append_cache_entry NUMA_INCLUDE_DIR_HINT PATH $optarg
+ ;;
+ --with-libnuma-libraries=*)
+ append_cache_entry NUMA_LIBRARIES_DIR_HINT PATH $optarg
+ ;;
SIGNAL_SNORT_RELOAD=*)
append_cache_entry SIGNAL_SNORT_RELOAD STRING $optarg
;;
the Linux kernel. Preferred memory mode support for NUMA systems
has been added. set_mempolicy() is used to establish the memory policy
for packet threads operating on different nodes within a NUMA system.
-The libnuma-dev library must be installed to enable this support.
-In systems without NUMA architecture, this feature will not affect system
-performance or behavior. This, alongside with libhwloc, presents an efficient
-cross-platform mechanism for thread configuration and managing CPU affinity
-of threads, not only considering CPU architecture but also memory access policies,
-providing a more balanced and optimized execution environment.
+The libnuma-dev library, version 2.0.14 or higher, must be installed to
+enable this support. In systems without NUMA architecture, this feature
+will not affect system performance or behavior. This, alongside with libhwloc,
+presents an efficient cross-platform mechanism for thread configuration and
+managing CPU affinity of threads, not only considering CPU architecture but
+also memory access policies, providing a more balanced and optimized
+execution environment.
use of get_relative_instance_number() in thread.cc: