From d4791e0535ef56688f421d6ac3dbd79c33a37508 Mon Sep 17 00:00:00 2001 From: imarom Date: Tue, 29 Mar 2016 15:24:24 +0300 Subject: RX stats two stage API (stop and remove RX filters) --- src/stateless/cp/trex_stateless_port.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/stateless/cp/trex_stateless_port.cpp') diff --git a/src/stateless/cp/trex_stateless_port.cpp b/src/stateless/cp/trex_stateless_port.cpp index 90589d7a..6a33fcee 100644 --- a/src/stateless/cp/trex_stateless_port.cpp +++ b/src/stateless/cp/trex_stateless_port.cpp @@ -271,6 +271,22 @@ TrexStatelessPort::stop_traffic(void) { common_port_stop_actions(false); } +/** + * remove all RX filters from port + * + * @author imarom (28-Mar-16) + */ +void +TrexStatelessPort::remove_rx_filters(void) { + /* only valid when IDLE or with streams and not TXing */ + verify_state(PORT_STATE_STREAMS); + + for (auto entry : m_stream_table) { + get_stateless_obj()->m_rx_flow_stat.stop_stream(entry.second); + } + +} + /** * when a port stops, perform various actions * @@ -287,9 +303,6 @@ TrexStatelessPort::common_port_stop_actions(bool async) { get_stateless_obj()->get_publisher()->publish_event(TrexPublisher::EVENT_PORT_STOPPED, data); } - for (auto entry : m_stream_table) { - get_stateless_obj()->m_rx_flow_stat.stop_stream(entry.second); - } } void -- cgit 1.2.3-korg