summaryrefslogtreecommitdiffstats
path: root/src/stateless
diff options
context:
space:
mode:
authorIdo Barnea <ibarnea@cisco.com>2016-12-01 17:52:44 +0200
committerIdo Barnea <ibarnea@cisco.com>2016-12-04 11:24:28 +0200
commit4477491bf7d052d9d140508e645b673f7dc87a65 (patch)
tree48961cf27f602df4a7fec3cbeb865c1b851480e8 /src/stateless
parentc9028e25cd49b9bf69ea72432429f3d3a149153e (diff)
Merge stateless rx core changes with Itay's changes
Signed-off-by: Ido Barnea <ibarnea@cisco.com>
Diffstat (limited to 'src/stateless')
-rw-r--r--src/stateless/rx/trex_stateless_rx_core.cpp15
-rw-r--r--src/stateless/rx/trex_stateless_rx_core.h30
-rw-r--r--src/stateless/rx/trex_stateless_rx_defs.h3
-rw-r--r--src/stateless/rx/trex_stateless_rx_port_mngr.cpp9
-rw-r--r--src/stateless/rx/trex_stateless_rx_port_mngr.h6
5 files changed, 28 insertions, 35 deletions
diff --git a/src/stateless/rx/trex_stateless_rx_core.cpp b/src/stateless/rx/trex_stateless_rx_core.cpp
index d6dcd3f4..f2061bf7 100644
--- a/src/stateless/rx/trex_stateless_rx_core.cpp
+++ b/src/stateless/rx/trex_stateless_rx_core.cpp
@@ -69,7 +69,6 @@ void CRFC2544Info::export_data(rfc2544_info_t_ &obj) {
void CRxCoreStateless::create(const CRxSlCfg &cfg) {
m_capture = false;
m_max_ports = cfg.m_max_ports;
- m_num_crc_fix_bytes = cfg.m_num_crc_fix_bytes;
CMessagingManager * cp_rx = CMsgIns::Ins()->getCpRx();
@@ -88,7 +87,8 @@ void CRxCoreStateless::create(const CRxSlCfg &cfg) {
m_rx_port_mngr[i].create(cfg.m_ports[i],
m_rfc2544,
&m_err_cntrs,
- &m_cpu_dp_u);
+ &m_cpu_dp_u,
+ cfg.m_num_crc_fix_bytes);
}
}
@@ -232,6 +232,17 @@ void CRxCoreStateless::capture_pkt(rte_mbuf_t *m) {
}
+int CRxCoreStateless::process_all_pending_pkts(bool flush_rx) {
+
+ int total_pkts = 0;
+ for (int i = 0; i < m_max_ports; i++) {
+ total_pkts += m_rx_port_mngr[i].process_all_pending_pkts(flush_rx);
+ }
+
+ return total_pkts;
+
+}
+
void CRxCoreStateless::reset_rx_stats(uint8_t port_id) {
m_rx_port_mngr[port_id].clear_stats();
}
diff --git a/src/stateless/rx/trex_stateless_rx_core.h b/src/stateless/rx/trex_stateless_rx_core.h
index 900abf2b..cd16bb8a 100644
--- a/src/stateless/rx/trex_stateless_rx_core.h
+++ b/src/stateless/rx/trex_stateless_rx_core.h
@@ -29,12 +29,6 @@
class TrexStatelessCpToRxMsgBase;
-<<<<<<< HEAD
-/**
- * RFC 2544 implementation
- *
- */
-=======
class CCPortLatencyStl {
public:
void reset();
@@ -44,28 +38,6 @@ class CCPortLatencyStl {
rx_per_flow_t m_rx_pg_stat_payload[MAX_FLOW_STATS_PAYLOAD];
};
-class CLatencyManagerPerPortStl {
-public:
- CCPortLatencyStl m_port;
- CPortLatencyHWBase * m_io;
-};
-
-class CRxSlCfg {
- public:
- CRxSlCfg (){
- m_max_ports = 0;
- m_cps = 0.0;
- m_num_crc_fix_bytes = 0;
- }
-
- public:
- uint32_t m_max_ports;
- double m_cps;
- CPortLatencyHWBase * m_ports[TREX_MAX_PORTS];
- uint8_t m_num_crc_fix_bytes;
-};
-
->>>>>>> f4198c7... take care of extra Ethernet FCS bytes handed to software in e1000
class CRFC2544Info {
public:
void create();
@@ -206,8 +178,6 @@ class CRxCoreStateless {
private:
TrexMonitor m_monitor;
uint32_t m_max_ports;
- // compensate for the fact that hardware send us packets without Ethernet CRC, and we report with it
- uint8_t m_num_crc_fix_bytes;
bool m_capture;
state_e m_state;
CNodeRing *m_ring_from_cp;
diff --git a/src/stateless/rx/trex_stateless_rx_defs.h b/src/stateless/rx/trex_stateless_rx_defs.h
index 3e5d2c38..aefcc133 100644
--- a/src/stateless/rx/trex_stateless_rx_defs.h
+++ b/src/stateless/rx/trex_stateless_rx_defs.h
@@ -27,6 +27,7 @@
class CPortLatencyHWBase;
+
/**
* general SL cfg
*
@@ -36,12 +37,14 @@ class CRxSlCfg {
CRxSlCfg (){
m_max_ports = 0;
m_cps = 0.0;
+ m_num_crc_fix_bytes = 0;
}
public:
uint32_t m_max_ports;
double m_cps;
CPortLatencyHWBase * m_ports[TREX_MAX_PORTS];
+ uint8_t m_num_crc_fix_bytes;
};
/**
diff --git a/src/stateless/rx/trex_stateless_rx_port_mngr.cpp b/src/stateless/rx/trex_stateless_rx_port_mngr.cpp
index bd8650a4..afc6827c 100644
--- a/src/stateless/rx/trex_stateless_rx_port_mngr.cpp
+++ b/src/stateless/rx/trex_stateless_rx_port_mngr.cpp
@@ -416,9 +416,11 @@ void
RXPortManager::create(CPortLatencyHWBase *io,
CRFC2544Info *rfc2544,
CRxCoreErrCntrs *err_cntrs,
- CCpuUtlDp *cpu_util) {
+ CCpuUtlDp *cpu_util,
+ uint8_t crc_bytes_num) {
m_io = io;
m_cpu_dp_u = cpu_util;
+ m_num_crc_fix_bytes = crc_bytes_num;
/* init features */
m_latency.create(rfc2544, err_cntrs);
@@ -459,6 +461,11 @@ int RXPortManager::process_all_pending_pkts(bool flush_rx) {
rte_mbuf_t *m = rx_pkts[j];
if (!flush_rx) {
+ // patch relevant only for e1000 driver
+ if (m_num_crc_fix_bytes) {
+ rte_pktmbuf_trim(m, m_num_crc_fix_bytes);
+ }
+
handle_pkt(m);
}
diff --git a/src/stateless/rx/trex_stateless_rx_port_mngr.h b/src/stateless/rx/trex_stateless_rx_port_mngr.h
index 6af90f8b..c049cb56 100644
--- a/src/stateless/rx/trex_stateless_rx_port_mngr.h
+++ b/src/stateless/rx/trex_stateless_rx_port_mngr.h
@@ -276,7 +276,8 @@ public:
void create(CPortLatencyHWBase *io,
CRFC2544Info *rfc2544,
CRxCoreErrCntrs *err_cntrs,
- CCpuUtlDp *cpu_util);
+ CCpuUtlDp *cpu_util,
+ uint8_t crc_bytes_num);
void clear_stats() {
m_latency.reset_stats();
@@ -402,7 +403,8 @@ private:
RXLatency m_latency;
RXPacketRecorder m_recorder;
RXQueue m_queue;
-
+ // compensate for the fact that hardware send us packets without Ethernet CRC, and we report with it
+ uint8_t m_num_crc_fix_bytes;
CCpuUtlDp *m_cpu_dp_u;
CPortLatencyHWBase *m_io;