Class DpdkBackend¶
Defined in File dpdk_backend.h
Nested Relationships¶
Inheritance Relationships¶
Base Type¶
public switchml::Backend(Class Backend)
Class Documentation¶
-
class
switchml::DpdkBackend: public switchml::Backend¶ The backend that represents the dpdk version of switchml.
Public Types
-
typedef int32_t
DpdkPacketElement¶ A type representing a single element in the packet
Public Functions
-
struct switchml::DpdkBackend::DpdkPacketHdr __attribute__ ((__packed__))
-
DpdkBackend(Context &context, Config &config)¶ Call the super class constructor.
- Parameters
context – [in] The context
config – [in] The context configuration.
-
~DpdkBackend()¶
-
DpdkBackend(DpdkBackend const&) = delete¶
-
void
operator=(DpdkBackend const&) = delete¶
-
DpdkBackend(DpdkBackend&&) = default¶
-
DpdkBackend &
operator=(DpdkBackend&&) = default¶
-
virtual void
SetupWorker() override¶ Creates and starts the dpdk master thread.
Which in turn initializes the DPDK EAL and creates and starts all worker threads.
-
virtual void
CleanupWorker() override¶ Waits for the dpdk master thread to exit.
-
void
SetupSwitch()¶ Contacts the controller using the GRPC Client and tells it to create a UDP session.
This must not be called until the IP and MAC addresses of the switch and worker have been filled correctly.
-
struct E2eAddress &
GetSwitchE2eAddr()¶ Get a reference to the switch end to end address in big endian.
The reference can be used to modify the address.
- Returns
struct E2eAddress& a reference to the address object.
-
struct E2eAddress &
GetWorkerE2eAddr()¶ Get a reference to the worker end to end address in big endian.
The reference can be used to modify the address.
- Returns
struct E2eAddress& a reference to the address object.
-
std::vector<DpdkWorkerThread> &
GetWorkerThreads()¶ Get a list of the worker threads.
- Returns
std::vector<DpdkWorkerThread>
Public Members
-
struct switchml::DpdkBackend::E2eAddress __attribute__
-
struct
DpdkPacketHdr¶ The switchml dpdk packet header.
Public Members
-
uint8_t
job_type_size¶ This field is used to store both the job type and the packet’s size enum or category. The 4 MSBs are for the job type and the 4 LSBs are for the size.
-
uint8_t
short_job_id¶ The 8 LSBs of the id of the job associated with this packet. This is used by the client only to discard duplicates at the edge of switching from one job to another. Therefore we do not need the full length of the job id.
-
uint32_t
pkt_id¶ An id to identify a packet within a job slice. This is used by the client only.
-
uint16_t
switch_pool_index¶ The switch’s pool/slot index.
A pool or a slot in the switch is what is used to store the values of a packet. Think of the switch as a large array of pools or slots. Each packet sent addresses a particular pool/slot.
The MSB of this field is used to alternate between two sets of pools/slots to have a shadow copy for switch retransmissions.
-
uint8_t
-
struct
E2eAddress¶ A struct to store an end to end network address.
-
typedef int32_t