memset(m_rx_cant_count_err, 0, sizeof(m_rx_cant_count_err));
memset(m_tx_cant_count_err, 0, sizeof(m_tx_cant_count_err));
m_num_ports = 0; // need to call create to init
+ m_mode = FLOW_STAT_MODE_NORMAL;
}
CFlowStatRuleMgr::~CFlowStatRuleMgr() {
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();
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);
}
}
}
+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();
}
class TrexStatelessCpToRxMsgBase;
-<<<<<<< HEAD
-/**
- * RFC 2544 implementation
- *
- */
-=======
class CCPortLatencyStl {
public:
void reset();
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();
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;
class CPortLatencyHWBase;
+
/**
* general SL cfg
*
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;
};
/**
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);
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);
}
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();
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;