mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-21 13:54:15 -07:00
Add multi-core concurrent packet processing
This commit is contained in:
parent
ac6d532651
commit
683d332abc
12 changed files with 400 additions and 190 deletions
|
@ -20,6 +20,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
#include <stdexcept>
|
||||
#include <thread>
|
||||
|
||||
#include "../node/Constants.hpp"
|
||||
#include "../node/MulticastGroup.hpp"
|
||||
|
@ -34,6 +35,7 @@ class BSDEthernetTap : public EthernetTap
|
|||
public:
|
||||
BSDEthernetTap(
|
||||
const char *homePath,
|
||||
unsigned int concurrency,
|
||||
const MAC &mac,
|
||||
unsigned int mtu,
|
||||
unsigned int metric,
|
||||
|
@ -62,6 +64,7 @@ public:
|
|||
private:
|
||||
void (*_handler)(void *,void *,uint64_t,const MAC &,const MAC &,unsigned int,unsigned int,const void *,unsigned int);
|
||||
void *_arg;
|
||||
unsigned int _concurrency;
|
||||
uint64_t _nwid;
|
||||
Thread _thread;
|
||||
std::string _dev;
|
||||
|
@ -73,6 +76,7 @@ private:
|
|||
volatile bool _enabled;
|
||||
mutable std::vector<InetAddress> _ifaddrs;
|
||||
mutable uint64_t _lastIfAddrsUpdate;
|
||||
std::vector<std::thread> _rxThreads;
|
||||
};
|
||||
|
||||
} // namespace ZeroTier
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue