aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vom/hw.cpp
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2017-11-28 22:29:13 -0800
committerNeale Ranns <nranns@cisco.com>2017-11-29 07:42:52 +0000
commita2ee029d0772e894911c84fb8a0cab5f253e145b (patch)
tree167d07ee3b3a482ef494f420ceef13a9657d4274 /src/vpp-api/vom/hw.cpp
parente80ae9ea8ed04c82c151a548916926b5dbfe8ecb (diff)
VOM: logging, populate and stats fixes
logging: allow a client to register a callback handler to recieve log messages that way the client can maintain a correctly sequenced log populate: fix the creation of interface and the setting of the handle stats: the reset promise idea is not defined behaviour. Use an eanble/disable command pair Change-Id: I347720bb65df2874c7619e722d593bc863ee2bf1 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'src/vpp-api/vom/hw.cpp')
-rw-r--r--src/vpp-api/vom/hw.cpp51
1 files changed, 5 insertions, 46 deletions
diff --git a/src/vpp-api/vom/hw.cpp b/src/vpp-api/vom/hw.cpp
index 4150d5f481f..91faf9d4db0 100644
--- a/src/vpp-api/vom/hw.cpp
+++ b/src/vpp-api/vom/hw.cpp
@@ -77,20 +77,6 @@ HW::cmd_q::enqueue(std::queue<cmd*>& cmds)
}
void
-HW::cmd_q::dequeue(cmd* c)
-{
- c->retire(m_conn);
- m_pending.erase(c);
-}
-
-void
-HW::cmd_q::dequeue(std::shared_ptr<cmd> c)
-{
- c->retire(m_conn);
- m_pending.erase(c.get());
-}
-
-void
HW::cmd_q::connect()
{
if (m_connected) {
@@ -144,33 +130,18 @@ HW::cmd_q::write()
* ince a async event can be recieved before the command
* completes
*/
- m_pending[c.get()] = c;
-
rc = c->issue(m_conn);
- if (rc_t::INPROGRESS == rc) {
+ if (rc_t::OK == rc) {
/*
- * this command completes asynchronously
- * leave the command in the pending store
+ * move to the next
*/
} else {
/*
- * the command completed, remove from the pending store
+ * barf out without issuing the rest
*/
- m_pending.erase(c.get());
-
- if (rc_t::OK == rc) {
- /*
- * move to the next
- */
- } else {
- /*
- * barf out without issuing the rest
- */
- VOM_LOG(log_level_t::ERROR) << "Failed to execute: "
- << c->to_string();
- break;
- }
+ VOM_LOG(log_level_t::ERROR) << "Failed to execute: " << c->to_string();
+ break;
}
} else {
/*
@@ -233,18 +204,6 @@ HW::enqueue(std::queue<cmd*>& cmds)
}
void
-HW::dequeue(cmd* cmd)
-{
- m_cmdQ->dequeue(cmd);
-}
-
-void
-HW::dequeue(std::shared_ptr<cmd> cmd)
-{
- m_cmdQ->dequeue(cmd);
-}
-
-void
HW::connect()
{
m_cmdQ->connect();