summaryrefslogtreecommitdiffstats
path: root/src/stateless
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2016-05-10 21:00:45 +0300
committerHanoh Haim <hhaim@cisco.com>2016-05-10 21:00:45 +0300
commit3a0c1c8333382ff8402b05ce47d17f100187df6f (patch)
tree1662f9a268241d1dd6faf3c7b3a8a008455e96b2 /src/stateless
parent2d37b9f98020a4458aaad1f3fd05ca5e408213e0 (diff)
cpu% without tsc
Diffstat (limited to 'src/stateless')
-rw-r--r--src/stateless/rx/trex_stateless_rx_core.cpp14
-rw-r--r--src/stateless/rx/trex_stateless_rx_core.h2
2 files changed, 11 insertions, 5 deletions
diff --git a/src/stateless/rx/trex_stateless_rx_core.cpp b/src/stateless/rx/trex_stateless_rx_core.cpp
index 2132fe9f..f7658e53 100644
--- a/src/stateless/rx/trex_stateless_rx_core.cpp
+++ b/src/stateless/rx/trex_stateless_rx_core.cpp
@@ -178,18 +178,18 @@ void CRxCoreStateless::flush_rx() {
for (i = 0; i < m_max_ports; i++) {
CLatencyManagerPerPort * lp = &m_ports[i];
rte_mbuf_t * m;
- m_cpu_dp_u.start_work();
/* try to read 64 packets clean up the queue */
uint16_t cnt_p = lp->m_io->rx_burst(rx_pkts, 64);
total_pkts += cnt_p;
if (cnt_p) {
+ m_cpu_dp_u.start_work1();
int j;
for (j = 0; j < cnt_p; j++) {
m = rx_pkts[j];
rte_pktmbuf_free(m);
}
/* commit only if there was work to do ! */
- m_cpu_dp_u.commit();
+ m_cpu_dp_u.commit1();
}/* if work */
}// all ports
}
@@ -200,11 +200,11 @@ int CRxCoreStateless::try_rx() {
for (i = 0; i < m_max_ports; i++) {
CLatencyManagerPerPort * lp = &m_ports[i];
rte_mbuf_t * m;
- m_cpu_dp_u.start_work();
/* try to read 64 packets clean up the queue */
uint16_t cnt_p = lp->m_io->rx_burst(rx_pkts, 64);
total_pkts += cnt_p;
if (cnt_p) {
+ m_cpu_dp_u.start_work1();
int j;
for (j = 0; j < cnt_p; j++) {
m = rx_pkts[j];
@@ -212,7 +212,7 @@ int CRxCoreStateless::try_rx() {
rte_pktmbuf_free(m);
}
/* commit only if there was work to do ! */
- m_cpu_dp_u.commit();
+ m_cpu_dp_u.commit1();
}/* if work */
}// all ports
return total_pkts;
@@ -249,7 +249,11 @@ void CRxCoreStateless::set_working_msg_ack(bool val) {
sanb_smp_memory_barrier();
}
-double CRxCoreStateless::get_cpu_util() {
+
+void CRxCoreStateless::update_cpu_util(){
m_cpu_cp_u.Update();
+}
+
+double CRxCoreStateless::get_cpu_util() {
return m_cpu_cp_u.GetVal();
}
diff --git a/src/stateless/rx/trex_stateless_rx_core.h b/src/stateless/rx/trex_stateless_rx_core.h
index b78256c2..a372a578 100644
--- a/src/stateless/rx/trex_stateless_rx_core.h
+++ b/src/stateless/rx/trex_stateless_rx_core.h
@@ -57,6 +57,8 @@ class CRxCoreStateless {
bool is_working() const {return (m_ack_start_work_msg == true);}
void set_working_msg_ack(bool val);
double get_cpu_util();
+ void update_cpu_util();
+
private:
void handle_cp_msg(TrexStatelessCpToRxMsgBase *msg);