summaryrefslogtreecommitdiffstats
path: root/src/main_dpdk.h
diff options
context:
space:
mode:
authorIdo Barnea <ibarnea@cisco.com>2016-09-27 14:24:32 +0300
committerIdo Barnea <ibarnea@cisco.com>2016-10-05 10:45:29 +0300
commitefb8873783d59ae2e5a870a99f05e40ebf661c16 (patch)
treed1ad7c06f55a532ae1b1349a24bb0aa067def4a8 /src/main_dpdk.h
parent2223955b8eb3b378c1ab79e3735ed340852b04b9 (diff)
pre test: Code review fixes
Diffstat (limited to 'src/main_dpdk.h')
-rw-r--r--src/main_dpdk.h30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/main_dpdk.h b/src/main_dpdk.h
index bde10659..97994c47 100644
--- a/src/main_dpdk.h
+++ b/src/main_dpdk.h
@@ -18,6 +18,7 @@
#define MAIN_DPDK_H
#include <rte_ethdev.h>
+#include "pre_test.h"
#include "bp_sim.h"
enum {
@@ -25,9 +26,29 @@ enum {
MAIN_DPDK_RX_Q = 1,
};
-class CPhyEthIFStats {
+// These are statistics for packets we send, and do not expect to get back (Like ARP)
+// We reduce them from general statistics we report (and report them separately, so we can keep the assumption
+// that tx_pkts == rx_pkts and tx_bytes==rx_bytes
+class CPhyEthIgnoreStats {
+ friend class CPhyEthIF;
public:
+ uint64_t get_rx_arp() {return m_rx_arp;}
+ uint64_t get_tx_arp() {return m_tx_arp;}
+ private:
+ uint64_t ipackets; /**< Total number of successfully received packets. */
+ uint64_t ibytes; /**< Total number of successfully received bytes. */
+ uint64_t opackets; /**< Total number of successfully transmitted packets.*/
+ uint64_t obytes; /**< Total number of successfully transmitted bytes. */
+ uint64_t m_tx_arp; /**< Total number of successfully transmitted ARP packets */
+ uint64_t m_rx_arp; /**< Total number of successfully received ARP packets */
+
+ private:
+ void dump(FILE *fd);
+};
+
+class CPhyEthIFStats {
+ public:
uint64_t ipackets; /**< Total number of successfully received packets. */
uint64_t ibytes; /**< Total number of successfully received bytes. */
uint64_t f_ipackets; /**< Total number of successfully received packets - filter SCTP*/
@@ -38,6 +59,7 @@ class CPhyEthIFStats {
uint64_t oerrors; /**< Total number of failed transmitted packets. */
uint64_t imcasts; /**< Total number of multicast received packets. */
uint64_t rx_nombuf; /**< Total number of RX mbuf allocation failures. */
+ struct rte_eth_stats m_prev_stats;
uint64_t m_rx_per_flow_pkts [MAX_FLOW_STATS]; // Per flow RX pkts
uint64_t m_rx_per_flow_bytes[MAX_FLOW_STATS]; // Per flow RX bytes
// Previous fdir stats values read from driver. Since on xl710 this is 32 bit, we save old value, to handle wrap around.
@@ -71,7 +93,6 @@ class CPhyEthIF {
int reset_hw_flow_stats();
int get_flow_stats(rx_per_flow_t *rx_stats, tx_per_flow_t *tx_stats, int min, int max, bool reset);
int get_flow_stats_payload(rx_per_flow_t *rx_stats, tx_per_flow_t *tx_stats, int min, int max, bool reset);
- void get_stats_1g(CPhyEthIFStats *stats);
void rx_queue_setup(uint16_t rx_queue_id,
uint16_t nb_rx_desc,
unsigned int socket_id,
@@ -99,6 +120,7 @@ class CPhyEthIF {
void add_mac(char * mac);
bool get_promiscuous();
void dump_stats(FILE *fd);
+ void set_ignore_stats_base(CPreTestStats &pre_stats);
void update_counters();
void stats_clear();
uint8_t get_port_id(){
@@ -120,6 +142,9 @@ class CPhyEthIF {
CPhyEthIFStats & get_stats(){
return ( m_stats );
}
+ CPhyEthIgnoreStats & get_ignore_stats() {
+ return m_ignore_stats;
+ }
void flush_dp_rx_queue(void);
void flush_rx_queue(void);
int add_rx_flow_stat_rule(uint8_t port_id, uint16_t l3_type, uint8_t l4_proto
@@ -167,6 +192,7 @@ class CPhyEthIF {
CPPSMeasure m_pps_tx;
CPPSMeasure m_pps_rx;
CPhyEthIFStats m_stats;
+ CPhyEthIgnoreStats m_ignore_stats;
float m_last_tx_rate;
float m_last_rx_rate;
float m_last_tx_pps;