This patch adds new class distributed_device which is responsible for initializing HW device and it is shared between all cpus. Old device class responsibility becomes managing rx/tx queue pair and it is local per cpu. Each cpu have to call distributed_device::init_local_queue() to create its own device. The logic to distribute cpus between available queues (in case there is no enough queues for each cpu) is in the distributed_device currently and not really implemented yet, so only one queue or queues == cpus scenarios are supported currently, but this can be fixed later. The plan is to rename "distributed_device" to "device" and "device" to "queue_pair" in later patches.
14 lines
217 B
C++
14 lines
217 B
C++
#ifndef PROXY_HH_
|
|
#define PROXY_HH_
|
|
|
|
#include <memory>
|
|
#include "net.hh"
|
|
#include "packet.hh"
|
|
|
|
namespace net {
|
|
|
|
std::unique_ptr<device> create_proxy_net_device(unsigned master_cpu, distributed_device* dev);
|
|
|
|
}
|
|
#endif
|