summaryrefslogtreecommitdiffstats
path: root/src/stateless
diff options
context:
space:
mode:
Diffstat (limited to 'src/stateless')
-rw-r--r--src/stateless/trex_stateless_api.h9
-rw-r--r--src/stateless/trex_stream.cpp9
-rw-r--r--src/stateless/trex_stream_api.h34
3 files changed, 28 insertions, 24 deletions
diff --git a/src/stateless/trex_stateless_api.h b/src/stateless/trex_stateless_api.h
index 50cc3947..6406a946 100644
--- a/src/stateless/trex_stateless_api.h
+++ b/src/stateless/trex_stateless_api.h
@@ -29,7 +29,7 @@ limitations under the License.
/**
* generic exception for errors
- *
+ * TODO: move this to a better place
*/
class TrexException : public std::runtime_error
{
@@ -42,7 +42,7 @@ public:
};
/**
- *
+ * describes a stateless port
*
* @author imarom (31-Aug-15)
*/
@@ -52,12 +52,15 @@ public:
TrexStatelessPort(uint8_t port_id) : m_port_id(port_id) {
}
+ /**
+ * access the stream table
+ *
+ */
TrexStreamTable *get_stream_table() {
return &m_stream_table;
}
private:
- /* a stream table per port */
TrexStreamTable m_stream_table;
uint8_t m_port_id;
};
diff --git a/src/stateless/trex_stream.cpp b/src/stateless/trex_stream.cpp
index 1a78ab34..5bc9421f 100644
--- a/src/stateless/trex_stream.cpp
+++ b/src/stateless/trex_stream.cpp
@@ -27,11 +27,10 @@ limitations under the License.
TrexStream::TrexStream(uint8_t port_id, uint32_t stream_id) : m_port_id(port_id), m_stream_id(stream_id) {
/* default values */
- m_isg_usec = 0;
- m_next_stream_id = -1;
- m_loop_count = 0;
- m_enable = false;
- m_start = false;
+ m_isg_usec = 0;
+ m_next_stream_id = -1;
+ m_enabled = false;
+ m_self_start = false;
m_pkt = NULL;
m_pkt_len = 0;
diff --git a/src/stateless/trex_stream_api.h b/src/stateless/trex_stream_api.h
index 7ae25c6e..bae82862 100644
--- a/src/stateless/trex_stream_api.h
+++ b/src/stateless/trex_stream_api.h
@@ -39,6 +39,7 @@ public:
TrexStream(uint8_t port_id, uint32_t stream_id);
virtual ~TrexStream() = 0;
+ /* defines the min max per packet supported */
static const uint32_t MIN_PKT_SIZE_BYTES = 1;
static const uint32_t MAX_PKT_SIZE_BYTES = 9000;
@@ -51,11 +52,10 @@ private:
/* config fields */
double m_isg_usec;
uint32_t m_next_stream_id;
- uint32_t m_loop_count;
/* indicators */
- bool m_enable;
- bool m_start;
+ bool m_enabled;
+ bool m_self_start;
/* pkt */
uint8_t *m_pkt;
@@ -90,35 +90,37 @@ protected:
* single burst
*
*/
-class TrexStreamSingleBurst : public TrexStream {
+class TrexStreamBurst : public TrexStream {
public:
- TrexStreamSingleBurst(uint8_t port_id, uint32_t stream_id, uint32_t packets, uint32_t pps) : TrexStream(port_id, stream_id), m_pps(pps), m_packets(packets) {
+ TrexStreamBurst(uint8_t port_id, uint32_t stream_id, uint32_t total_pkts, uint32_t pps) :
+ TrexStream(port_id, stream_id),
+ m_total_pkts(total_pkts),
+ m_pps(pps) {
}
+
protected:
- uint32_t m_pps;
- uint32_t m_packets;
-
+ uint32_t m_total_pkts;
+ uint32_t m_pps;
};
/**
* multi burst
*
*/
-class TrexStreamMultiBurst : public TrexStream {
+class TrexStreamMultiBurst : public TrexStreamBurst {
public:
- TrexStreamMultiBurst(uint8_t port_id,
+ TrexStreamMultiBurst(uint8_t port_id,
uint32_t stream_id,
- uint32_t pps,
- double ibg_usec,
uint32_t pkts_per_burst,
- uint32_t num_bursts) : TrexStream(port_id, stream_id), m_pps(pps), m_ibg_usec(ibg_usec), m_num_bursts(num_bursts), m_pkts_per_burst(pkts_per_burst) {
+ uint32_t pps,
+ uint32_t num_bursts,
+ double ibg_usec) : TrexStreamBurst(port_id, stream_id, pkts_per_burst, pps), m_num_bursts(num_bursts), m_ibg_usec(ibg_usec) {
}
protected:
- uint32_t m_pps;
- double m_ibg_usec;
uint32_t m_num_bursts;
- uint32_t m_pkts_per_burst;
+ double m_ibg_usec;
+
};
/**