summaryrefslogtreecommitdiffstats
path: root/src/stateless/cp/trex_stateless_port.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/stateless/cp/trex_stateless_port.h')
-rw-r--r--src/stateless/cp/trex_stateless_port.h84
1 files changed, 72 insertions, 12 deletions
diff --git a/src/stateless/cp/trex_stateless_port.h b/src/stateless/cp/trex_stateless_port.h
index e2a2aeba..d4ac4018 100644
--- a/src/stateless/cp/trex_stateless_port.h
+++ b/src/stateless/cp/trex_stateless_port.h
@@ -24,12 +24,15 @@ limitations under the License.
#include "common/basic_utils.h"
#include "internal_api/trex_platform_api.h"
#include "trex_dp_port_events.h"
+#include "trex_stateless_rx_defs.h"
#include "trex_stream.h"
class TrexStatelessCpToDpMsgBase;
class TrexStatelessCpToRxMsgBase;
class TrexStreamsGraphObj;
class TrexPortMultiplier;
+class RXPacketBuffer;
+
/**
* TRex port owner can perform
@@ -218,6 +221,7 @@ public:
*/
void push_remote(const std::string &pcap_filename,
double ipg_usec,
+ double min_ipg_sec,
double speedup,
uint32_t count,
double duration,
@@ -255,11 +259,8 @@ public:
* @author imarom (16-Sep-15)
*
* @param driver
- * @param speed
*/
- void get_properties(std::string &driver, uint32_t &speed);
-
-
+ void get_properties(std::string &driver);
/**
* encode stats as JSON
@@ -362,14 +363,71 @@ public:
double &bps_L2,
double &percentage);
+ void get_pci_info(std::string &pci_addr, int &numa_node);
- void get_macaddr(std::string &hw_macaddr,
- std::string &src_macaddr,
- std::string &dst_macaddr);
- void get_pci_info(std::string &pci_addr, int &numa_node);
+ /**
+ * enable RX capture on port
+ *
+ */
+ void start_rx_capture(const std::string &pcap_filename, uint64_t limit);
+
+ /**
+ * disable RX capture if on
+ *
+ */
+ void stop_rx_capture();
+
+ /**
+ * start RX queueing of packets
+ *
+ * @author imarom (11/7/2016)
+ *
+ * @param limit
+ */
+ void start_rx_queue(uint64_t limit);
+ /**
+ * stop RX queueing
+ *
+ * @author imarom (11/7/2016)
+ */
+ void stop_rx_queue();
+ /**
+ * fetch the RX queue packets from the queue
+ *
+ */
+ const RXPacketBuffer *get_rx_queue_pkts();
+
+ /**
+ * configures port for L2 mode
+ *
+ */
+ void set_l2_mode(const uint8_t *dest_mac);
+
+ /**
+ * configures port in L3 mode
+ *
+ */
+ void set_l3_mode(uint32_t src_ipv4, uint32_t dest_ipv4);
+ void set_l3_mode(uint32_t src_ipv4, uint32_t dest_ipv4, const uint8_t *resolved_mac);
+
+ /**
+ * generate a JSON describing the status
+ * of the RX features
+ *
+ */
+ Json::Value rx_features_to_json();
+
+ /**
+ * return the port attribute object
+ *
+ */
+ TRexPortAttr *getPortAttrObj() {
+ return m_platform_api->getPortAttrObj(m_port_id);
+ }
+
private:
bool is_core_active(int core_id);
@@ -401,7 +459,7 @@ private:
*
*/
void send_message_to_rx(TrexStatelessCpToRxMsgBase *msg);
-
+
/**
* when a port stops, perform various actions
*
@@ -456,6 +514,8 @@ private:
TrexPortOwner m_owner;
int m_pending_async_stop_event;
+ static const uint32_t MAX_STREAMS = 20000;
+
};
@@ -502,9 +562,9 @@ public:
static const std::initializer_list<std::string> g_types;
static const std::initializer_list<std::string> g_ops;
- mul_type_e m_type;
- mul_op_e m_op;
- double m_value;
+ mul_type_e m_type;
+ mul_op_e m_op;
+ double m_value;
};
#endif /* __TREX_STATELESS_PORT_H__ */