rx_arping for 10g mode (#359)

* test for rx_arping

* arping ip and interface from client interface

* apring thread added to thread ids

* clean code for thread for arping

* removing the assumption that udpip1 fill be updated along with udpip2

* review, replacing syscall(sys_gettid) with gettid()
This commit is contained in:
Dhanya Thattil
2022-02-04 10:12:57 +01:00
committed by GitHub
parent dae77a50e6
commit 771b1e7877
23 changed files with 316 additions and 39 deletions

View File

@ -107,6 +107,7 @@ void Implementation::SetupFifoStructure() {
* ************************************************/
void Implementation::setDetectorType(const detectorType d) {
detType = d;
switch (detType) {
case GOTTHARD:
@ -320,9 +321,33 @@ std::array<pid_t, NUM_RX_THREAD_IDS> Implementation::getThreadIds() const {
retval[id++] = 0;
}
}
retval[NUM_RX_THREAD_IDS - 1] = arping.GetThreadId();
return retval;
}
bool Implementation::getArping() const { return arping.IsRunning(); }
pid_t Implementation::getArpingThreadId() const { return arping.GetThreadId(); }
void Implementation::setArping(const bool i,
const std::vector<std::string> ips) {
if (i != arping.IsRunning()) {
if (!i) {
arping.StopThread();
} else {
// setup interface
for (int i = 0; i != numUDPInterfaces; ++i) {
// ignore eiger with 2 interfaces (only udp port)
if (i == 1 && (numUDPInterfaces == 1 || detType == EIGER)) {
break;
}
arping.SetInterfacesAndIps(i, eth[i], ips[i]);
}
arping.StartThread();
}
}
}
/**************************************************
* *
* File Parameters *