summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIdo Barnea <ibarnea@cisco.com>2016-06-20 12:56:17 +0300
committerIdo Barnea <ibarnea@cisco.com>2016-06-20 12:57:02 +0300
commit35efdda889977a7b0bf5d1cda213d0e7ffcd4367 (patch)
treef4b1ff50b1d7e30d637f0aba893610e0fb1b60e4 /src
parent0bcd7377e8d476a0eb8f7d7f55f59e0c6df91f28 (diff)
Add 4 bytes for each packet rx/tx bytes in flow stats, to artificially count ethernet CRC
Diffstat (limited to 'src')
-rw-r--r--src/main_dpdk.cpp2
-rw-r--r--src/stateless/rx/trex_stateless_rx_core.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp
index ef1668ab..3dd020ae 100644
--- a/src/main_dpdk.cpp
+++ b/src/main_dpdk.cpp
@@ -2074,7 +2074,7 @@ int CCoreEthIFStateless::send_node_flow_stat(rte_mbuf *m, CGenNodeStateless * no
}
tx_per_flow_t *lp_s = &lp_stats->m_tx_per_flow[hw_id];
lp_s->add_pkts(1);
- lp_s->add_bytes(mi->pkt_len);
+ lp_s->add_bytes(mi->pkt_len + 4); // We add 4 because of ethernet CRC
if (hw_id >= MAX_FLOW_STATS) {
fsp_head->time_stamp = os_get_hr_tick_64();
diff --git a/src/stateless/rx/trex_stateless_rx_core.cpp b/src/stateless/rx/trex_stateless_rx_core.cpp
index 847dbc97..a622ee7a 100644
--- a/src/stateless/rx/trex_stateless_rx_core.cpp
+++ b/src/stateless/rx/trex_stateless_rx_core.cpp
@@ -235,7 +235,7 @@ void CRxCoreStateless::handle_rx_pkt(CLatencyManagerPerPortStl *lp, rte_mbuf_t *
curr_rfc2544.set_seq(pkt_seq + 1);
}
lp->m_port.m_rx_pg_stat_payload[hw_id].add_pkts(1);
- lp->m_port.m_rx_pg_stat_payload[hw_id].add_bytes(m->pkt_len);
+ lp->m_port.m_rx_pg_stat_payload[hw_id].add_bytes(m->pkt_len + 4); // +4 for ethernet CRC
uint64_t d = (os_get_hr_tick_64() - fsp_head->time_stamp );
dsec_t ctime = ptime_convert_hr_dsec(d);
curr_rfc2544.add_sample(ctime);
@@ -243,7 +243,7 @@ void CRxCoreStateless::handle_rx_pkt(CLatencyManagerPerPortStl *lp, rte_mbuf_t *
} else {
hw_id = get_hw_id(ip_id);
lp->m_port.m_rx_pg_stat[hw_id].add_pkts(1);
- lp->m_port.m_rx_pg_stat[hw_id].add_bytes(m->pkt_len);
+ lp->m_port.m_rx_pg_stat[hw_id].add_bytes(m->pkt_len + 4); // +4 for ethernet CRC
}
}
}