summaryrefslogtreecommitdiffstats
path: root/src/stateless/cp/trex_stateless_port.cpp
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2016-01-07 23:58:22 +0200
committerHanoh Haim <hhaim@cisco.com>2016-01-07 23:58:22 +0200
commit8db09096b9dcf030b7dc744fbd7ee463d8e6fd1b (patch)
tree8de1422ac003e403889b2b248009431aa1176dd3 /src/stateless/cp/trex_stateless_port.cpp
parent7e37a0aabbd351aa899bf7bdb2327eaa61733095 (diff)
parent79b2a5ea59c3b420988891b9f3751579bfbe8e0e (diff)
Merge
Diffstat (limited to 'src/stateless/cp/trex_stateless_port.cpp')
-rw-r--r--src/stateless/cp/trex_stateless_port.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/stateless/cp/trex_stateless_port.cpp b/src/stateless/cp/trex_stateless_port.cpp
index aa34e87b..05283d5f 100644
--- a/src/stateless/cp/trex_stateless_port.cpp
+++ b/src/stateless/cp/trex_stateless_port.cpp
@@ -76,6 +76,11 @@ TrexStatelessPort::TrexStatelessPort(uint8_t port_id, const TrexPlatformApi *api
m_graph_obj = NULL;
}
+TrexStatelessPort::~TrexStatelessPort() {
+ if (m_graph_obj) {
+ delete m_graph_obj;
+ }
+}
/**
* acquire the port
@@ -589,6 +594,22 @@ TrexStatelessPort::validate(void) {
}
+
+void
+TrexStatelessPort::get_port_effective_rate(uint64_t &bps, uint64_t &pps) {
+
+ if (get_stream_count() == 0) {
+ return;
+ }
+
+ if (!m_graph_obj) {
+ generate_streams_graph();
+ }
+
+ bps = m_graph_obj->get_max_bps() * m_factor;
+ pps = m_graph_obj->get_max_pps() * m_factor;
+}
+
/************* Trex Port Owner **************/
TrexPortOwner::TrexPortOwner() {