|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
92 return (item_data ==
i.item_data);
100 item_data = other.item_data;
101 item_rc = other.item_rc;
109 T&
data() {
return (item_data); }
114 const T&
data()
const {
return (item_data); }
138 bool need_hw_update =
false;
151 need_hw_update = (item_data != desired.
data() ||
rc_t::OK !=
rc());
153 item_data = desired.
data();
155 return (need_hw_update);
163 std::ostringstream os;
166 <<
"rc:" << item_rc.
to_string() <<
" data:" << item_data.to_string()
211 virtual void enqueue(std::shared_ptr<cmd>
c);
216 virtual void enqueue(std::queue<cmd*>&
c);
249 std::deque<std::shared_ptr<cmd>> m_queue;
256 std::map<cmd*, std::shared_ptr<cmd>> m_pending;
266 std::unique_ptr<std::thread> m_rx_thread;
309 static void enqueue(std::shared_ptr<cmd>
c);
314 static void enqueue(std::queue<cmd*>&
c);
345 static cmd_q* m_cmdQ;
361 static void disable();
367 static void enable();
A HW::item is data that is either to be written to or read from VPP/HW.
static rc_t write()
Write/Execute all commands hitherto enqueued.
void set(const rc_t &rc)
Set the HW return code - should only be called from the family of Command objects.
The VPP Object Model (VOM) library.
const static rc_t OK
The HW write was successfull.
The interface to writing objects into VPP OM.
static bool poll()
Blocking pool of the HW connection.
virtual bool connect()
Blocking Connect to VPP - call once at bootup.
virtual void enqueue(cmd *c)
Enqueue a command into the Q.
cmd_q & operator=(const cmd_q &f)
Copy assignement - only used in UT.
const T & data() const
Const reference to the data.
const static rc_t UNSET
The value un-set.
bool operator==(const item< T > &i) const
Comparison operator.
static void init()
Initialise the HW.
The pipe to VPP into which we write the commands.
A representation of the connection to VPP.
static void disconnect()
Disconnect to VPP.
~item()=default
Destructor.
sll srl srl sll sra u16x4 i
static void enqueue(cmd *f)
Enqueue A command for execution.
void enable()
Enable the passing of commands to VPP - undoes the disable.
std::string to_string() const
convert to string format for debug purposes
const std::string & to_string() const
convert to string format for debug purposes
rc_t rc() const
Get the HW return code.
item(const T &data)
Constructor.
T & data()
Return the data read/written.
item(const T &data, rc_t rc)
Constructor.
virtual rc_t write()
Write all the commands to HW.
void disable()
Disable the passing of commands to VPP.
static void read_stats()
read stats from stat segment
item(rc_t rc)
Constructor.
static bool connect()
Blocking Connect to VPP.
virtual void disconnect()
Disconnect to VPP.
item & operator=(const item &other)
Copy assignment.
bool update(const item &desired)
update the item to the desired state.
Error codes that VPP will return during a HW write.
A representation of a method call to VPP.
Stat reader: single interface to get stats.