File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
src/plugins/input/nfb/src Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -60,21 +60,19 @@ int NdpReader::init_interface(const std::string& interface)
6060 return 1 ;
6161 }
6262
63- struct bitmask * bits = nullptr ;
6463 int node_id;
6564 rx_handle = ndp_open_rx_queue (dev_handle, channel);
6665 if (!rx_handle) {
6766 error_msg = std::string () + " error opening NDP queue of NFB device" ;
6867 return 1 ;
6968 }
70- if (((node_id = ndp_queue_get_numa_node (rx_handle)) >= 0 )
71- && // OPTIONAL: bind thread to correct NUMA node
72- ((bits = numa_allocate_nodemask ()) != nullptr )) {
73- (void ) numa_bitmask_setbit (bits, node_id);
74- numa_bind (bits);
75- numa_free_nodemask (bits);
69+ if ((node_id = ndp_queue_get_numa_node (rx_handle)) >= 0 ) {
70+ // allow memory to be allocated on other nodes if preferred is unavailable
71+ constexpr int PREFERRED_NODE_POLICY = 0 ;
72+ numa_set_bind_policy (PREFERRED_NODE_POLICY);
73+ numa_set_preferred (node_id);
7674 } else {
77- error_msg = std::string () + " warning - NUMA node binding failed\n " ;
75+ error_msg = " warning - NUMA node detection failed\n " ;
7876 return 1 ;
7977 }
8078 if (ndp_queue_start (rx_handle)) { // start capturing data from NDP queue
You can’t perform that action at this time.
0 commit comments