Simplify packet critical path. Plus more platform fixes
This commit is contained in:
parent
e734019216
commit
b813ea70a5
7 changed files with 31 additions and 27 deletions
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "Node.hpp"
|
||||
#include "RuntimeEnvironment.hpp"
|
||||
#include "Constants.hpp"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -28,6 +29,16 @@ PacketMultiplexer::PacketMultiplexer(const RuntimeEnvironment* renv)
|
|||
|
||||
void PacketMultiplexer::putFrame(void* tPtr, uint64_t nwid, void** nuptr, const MAC& source, const MAC& dest, unsigned int etherType, unsigned int vlanId, const void* data, unsigned int len, unsigned int flowId)
|
||||
{
|
||||
#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__WINDOWS__)
|
||||
RR->node->putFrame(tPtr,nwid,nuptr,source,dest,etherType,vlanId,(const void *)data,len);
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (!_enabled) {
|
||||
RR->node->putFrame(tPtr,nwid,nuptr,source,dest,etherType,vlanId,(const void *)data,len);
|
||||
return;
|
||||
}
|
||||
|
||||
PacketRecord* packet;
|
||||
_rxPacketVector_m.lock();
|
||||
if (_rxPacketVector.empty()) {
|
||||
|
@ -56,9 +67,10 @@ void PacketMultiplexer::putFrame(void* tPtr, uint64_t nwid, void** nuptr, const
|
|||
|
||||
void PacketMultiplexer::setUpPostDecodeReceiveThreads(unsigned int concurrency, bool cpuPinningEnabled)
|
||||
{
|
||||
if (! RR->node->getMultithreadingEnabled()) {
|
||||
return;
|
||||
}
|
||||
#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__WINDOWS__)
|
||||
return;
|
||||
#endif
|
||||
_enabled = true;
|
||||
_concurrency = concurrency;
|
||||
bool _enablePinning = cpuPinningEnabled;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue