IBReceiver: Pin to NUMA node

This commit is contained in:
2023-04-06 20:58:25 +02:00
parent 428beaa75b
commit 8fea8bac3b
4 changed files with 22 additions and 5 deletions

View File

@@ -9,6 +9,10 @@
#include <numaif.h>
#endif
#ifdef JFJOCH_USE_NUMA_H
#include <numa.h>
#endif
#include "../common/JFJochException.h"
#include "RawJFUDPPacket.h"
@@ -75,11 +79,16 @@ IBReceiver::IBReceiver(IBContext &context, ProcessJFPacket &process, uint64_t ma
qp.PostReceiveWR(*buffer.GetMemoryRegion(), i, buffer.GetLocation(i), BUFFER_SIZE);
for (int i = 0; i < nthreads; i++)
futures.emplace_back(std::async(std::launch::async, &IBReceiver::Run, this, &process));
futures.emplace_back(std::async(std::launch::async, &IBReceiver::Run, this, &process, numa_node));
futures.emplace_back(std::async(std::launch::async, &IBReceiver::Arp, this, mac_addr, ipv4));
}
void IBReceiver::Run(ProcessJFPacket *process) {
void IBReceiver::Run(ProcessJFPacket *process, uint8_t numa_node) {
#ifdef JFJOCH_USE_NUMA_H
if (numa_available() != -1)
numa_run_on_node(numa_node);
#endif
while (!cancel) {
int64_t i;
size_t size;