summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2015-10-25 15:36:13 +0200
committerHanoh Haim <hhaim@cisco.com>2015-10-25 15:36:13 +0200
commit29550cab54a8d49647f0f2c34b04cc2fc97daaea (patch)
tree4eb9157aaef903b54034647051d0da1923faf271 /src
parentd4828d6829137971c58a0e56b67a58154a8d6415 (diff)
cp works now. no DP, no RPC integration
Diffstat (limited to 'src')
-rwxr-xr-xsrc/bp_gtest.cpp4
-rwxr-xr-xsrc/main.cpp6
-rwxr-xr-xsrc/main_dpdk.cpp49
3 files changed, 14 insertions, 45 deletions
diff --git a/src/bp_gtest.cpp b/src/bp_gtest.cpp
index a529d637..d0bc27bc 100755
--- a/src/bp_gtest.cpp
+++ b/src/bp_gtest.cpp
@@ -205,7 +205,7 @@ public:
}
}
- lpt->generate_erf(buf,CGlobalInfo::m_options.preview);
+ lpt->start_generate_stateful(buf,CGlobalInfo::m_options.preview);
lpt->m_node_gen.DumpHist(stdout);
cmp.d_sec = m_time_diff;
@@ -2105,7 +2105,7 @@ public:
int i;
for (i=0; i<m_threads; i++) {
lpt=fl.m_threads_info[i];
- lpt->generate_erf("t1",CGlobalInfo::m_options.preview);
+ lpt->start_generate_stateful("t1",CGlobalInfo::m_options.preview);
}
fl.Delete();
return (true);
diff --git a/src/main.cpp b/src/main.cpp
index 96789cdd..0321761f 100755
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -234,7 +234,7 @@ void * thread_task(void *info){
char buf[100];
sprintf(buf,"my%d.erf",obj->thread_id);
volatile int i;
- lpt->generate_erf(buf,*obj->preview_info);
+ lpt->start_generate_stateful(buf,*obj->preview_info);
lpt->m_node_gen.DumpHist(stdout);
printf("end thread %d \n",obj->thread_id);
}
@@ -325,7 +325,7 @@ void test_load_list_of_cap_files(CParserOption * op){
lpt=fl.m_threads_info[i];
char buf[100];
sprintf(buf,"my%d.erf",i);
- lpt->generate_erf(buf,op->preview);
+ lpt->start_generate_stateful(buf,op->preview);
lpt->m_node_gen.DumpHist(stdout);
}
//sprintf(buf,"my%d.erf",7);
@@ -353,7 +353,7 @@ int load_list_of_cap_files(CParserOption * op){
lpt->set_vif(&erf_vif);
if ( (op->preview.getVMode() >1) || op->preview.getFileWrite() ) {
- lpt->generate_erf(op->out_file,op->preview);
+ lpt->start_generate_stateful(op->out_file,op->preview);
}
lpt->m_node_gen.DumpHist(stdout);
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp
index 177c0cc9..fd2d01c3 100755
--- a/src/main_dpdk.cpp
+++ b/src/main_dpdk.cpp
@@ -3428,12 +3428,9 @@ int CGlobalTRex::ixgbe_start(void){
bool CGlobalTRex::Create(){
bool is_stateless = get_is_stateless();
- /* hack - need to refactor */
- if (!is_stateless) {
- if ( !m_zmq_publisher.Create( CGlobalInfo::m_options.m_zmq_port,
- !CGlobalInfo::m_options.preview.get_zmq_publish_enable() ) ){
- return (false);
- }
+ if ( !m_zmq_publisher.Create( CGlobalInfo::m_options.m_zmq_port,
+ !CGlobalInfo::m_options.preview.get_zmq_publish_enable() ) ){
+ return (false);
}
/* We load the YAML twice,
@@ -4173,6 +4170,7 @@ int CGlobalTRex::start_master_stateless(){
+
int CGlobalTRex::start_send_master(){
int i;
for (i=0; i<BP_MAX_CORES; i++) {
@@ -4256,18 +4254,6 @@ static int latency_one_lcore(__attribute__((unused)) void *dummy)
}
-static int stateless_entry(__attribute__((unused)) void *dummy) {
- CPlatformSocketInfo * lpsock=&CGlobalInfo::m_socket;
- physical_thread_id_t phy_id = rte_lcore_id();
-
- if (lpsock->thread_phy_is_master( phy_id )) {
- TrexStateless::get_instance().launch_control_plane();
- } else {
- TrexStateless::get_instance().launch_on_dp_core(phy_id);
- }
-
- return (0);
-}
static int slave_one_lcore(__attribute__((unused)) void *dummy)
{
@@ -4477,7 +4463,7 @@ int sim_load_list_of_cap_files(CParserOption * op){
static int
-launch_stateless_trex() {
+launch_stateless_trex_thread() {
CPlatformSocketInfo *lpsock=&CGlobalInfo::m_socket;
CParserOption *lpop= &CGlobalInfo::m_options;
CPlatformYamlInfo *cg=&global_platform_cfg_info;
@@ -4485,26 +4471,15 @@ launch_stateless_trex() {
TrexStatelessCfg cfg;
TrexRpcServerConfig rpc_req_resp_cfg(TrexRpcServerConfig::RPC_PROT_TCP, global_platform_cfg_info.m_zmq_rpc_port);
- TrexRpcServerConfig rpc_async_cfg(TrexRpcServerConfig::RPC_PROT_TCP, 5051);
cfg.m_dp_core_count = lpop->preview.getCores();
cfg.m_port_count = lpop->m_expected_portd;
cfg.m_rpc_req_resp_cfg = &rpc_req_resp_cfg;
- cfg.m_rpc_async_cfg = &rpc_async_cfg;
+ cfg.m_rpc_async_cfg = NULL;
cfg.m_rpc_server_verbose = true;
TrexStateless::configure(cfg);
-
- printf("\nStarting T-Rex Stateless\n");
printf("Starting RPC Server...\n\n");
-
- rte_eal_mp_remote_launch(stateless_entry, NULL, CALL_MASTER);
-
- unsigned lcore_id;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
- if (rte_eal_wait_lcore(lcore_id) < 0)
- return -1;
- }
return (0);
}
@@ -4576,9 +4551,9 @@ int main_test(int argc , char * argv[]){
}
/* patch here */
- /*if (is_stateless) {
- return launch_stateless_trex();
- }*/
+ if (is_stateless) {
+ launch_stateless_trex_thread();
+ }
if (po->preview.get_is_rx_check_enable() && (po->m_rx_check_sampe< get_min_sample_rate()) ) {
po->m_rx_check_sampe = get_min_sample_rate();
@@ -4608,12 +4583,6 @@ int main_test(int argc , char * argv[]){
g_trex.start_send_master();
}
- // TBD remove
- //g_trex.test_latency();
- /* test seding */
- //while (1) {
- //}
-
/* TBD_FDIR */
#if 0