diff options
author | imarom <imarom@cisco.com> | 2016-06-01 15:52:00 +0300 |
---|---|---|
committer | imarom <imarom@cisco.com> | 2016-06-02 13:45:12 +0300 |
commit | 3c4a29e15f3663f6413fbee2562d7d0aa4e2f80d (patch) | |
tree | c9742549ad7a8013f43077dceb5fa9eacf0aaadf /src/stateless/rx/trex_stateless_rx_core.cpp | |
parent | b639fb458fb2388164adaf45c4e947a2af2ca0e1 (diff) |
watchdog phase 2
Diffstat (limited to 'src/stateless/rx/trex_stateless_rx_core.cpp')
-rw-r--r-- | src/stateless/rx/trex_stateless_rx_core.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/stateless/rx/trex_stateless_rx_core.cpp b/src/stateless/rx/trex_stateless_rx_core.cpp index f9150ff7..95fcc1b0 100644 --- a/src/stateless/rx/trex_stateless_rx_core.cpp +++ b/src/stateless/rx/trex_stateless_rx_core.cpp @@ -76,6 +76,9 @@ void CRxCoreStateless::create(const CRxSlCfg &cfg) { m_ring_to_cp = cp_rx->getRingDpToCp(0); m_state = STATE_IDLE; + m_watchdog_handle = -1; + m_watchdog = NULL; + for (int i = 0; i < m_max_ports; i++) { CLatencyManagerPerPortStl * lp = &m_ports[i]; lp->m_io = cfg.m_ports[i]; @@ -93,7 +96,15 @@ void CRxCoreStateless::handle_cp_msg(TrexStatelessCpToRxMsgBase *msg) { delete msg; } +void CRxCoreStateless::tickle() { + m_watchdog->tickle(m_watchdog_handle); +} + bool CRxCoreStateless::periodic_check_for_cp_messages() { + + /* tickle the watchdog */ + tickle(); + /* fast path */ if ( likely ( m_ring_from_cp->isEmpty() ) ) { return false; @@ -140,11 +151,15 @@ void CRxCoreStateless::idle_state_loop() { } } -void CRxCoreStateless::start() { +void CRxCoreStateless::start(TrexWatchDog &watchdog) { int count = 0; int i = 0; bool do_try_rx_queue =CGlobalInfo::m_options.preview.get_vm_one_queue_enable() ? true : false; + /* register a watchdog handle on current core */ + m_watchdog = &watchdog; + m_watchdog_handle = watchdog.register_monitor("STL RX CORE", 1); + while (true) { if (m_state == STATE_WORKING) { i++; |