diff options
Diffstat (limited to 'src/bp_sim.cpp')
-rwxr-xr-x | src/bp_sim.cpp | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/bp_sim.cpp b/src/bp_sim.cpp index 62e8d822..c1df72fc 100755 --- a/src/bp_sim.cpp +++ b/src/bp_sim.cpp @@ -160,8 +160,8 @@ uint64_t CPlatformSocketInfoNoConfig::get_cores_mask(){ int i; int offset=0; /* master */ - uint32_t res=1; - uint32_t mask=(1<<(offset+1)); + uint64_t res=1; + uint64_t mask=(1LL<<(offset+1)); for (i=0; i<(cores_number-1); i++) { res |= mask ; mask = mask <<1; @@ -238,6 +238,13 @@ bool CPlatformSocketInfoConfig::init(){ } } + if (m_threads_per_dual_if > m_max_threads_per_dual_if) { + printf("ERROR: Maximum threads in platform section of config file is %d, unable to run with -c %d.\n", + m_max_threads_per_dual_if, m_threads_per_dual_if); + printf("Please increase the pool in config or use lower -c.\n"); + exit(1); + } + int j; for (j=0; j<m_threads_per_dual_if; j++) { @@ -381,14 +388,14 @@ uint64_t CPlatformSocketInfoConfig::get_cores_mask(){ printf(" ERROR phy threads can't be higher than 64 \n"); exit(1); } - mask |=(1<<i); + mask |=(1LL<<i); } } - mask |=(1<<m_platform->m_master_thread); + mask |=(1LL<<m_platform->m_master_thread); assert(m_platform->m_master_thread<64); if (m_rx_is_enabled) { - mask |=(1<<m_platform->m_rx_thread); + mask |=(1LL<<m_platform->m_rx_thread); assert(m_platform->m_rx_thread<64); } return (mask); @@ -1668,7 +1675,8 @@ void CFlowPktInfo::do_generate_new_mbuf_rxcheck(rte_mbuf_t * m, IPv6Header * ipv6=(IPv6Header *)(mp1 + 14); uint8_t save_header= ipv6->getNextHdr(); ipv6->setNextHdr(RX_CHECK_V6_OPT_TYPE); - ipv6->setHopLimit(TTL_RESERVE_DUPLICATE); + ipv6->setHopLimit(TTL_RESERVE_DUPLICATE); + ipv6->setTrafficClass(ipv6->getTrafficClass()|TOS_TTL_RESERVE_DUPLICATE); ipv6->setPayloadLen( ipv6->getPayloadLen() + sizeof(CRx_check_header)); rxhdr->m_option_type = save_header; @@ -1678,6 +1686,8 @@ void CFlowPktInfo::do_generate_new_mbuf_rxcheck(rte_mbuf_t * m, ipv4->setHeaderLength(current_opt_len+opt_len); ipv4->setTotalLength(ipv4->getTotalLength()+opt_len); ipv4->setTimeToLive(TTL_RESERVE_DUPLICATE); + ipv4->setTOS(ipv4->getTOS()|TOS_TTL_RESERVE_DUPLICATE); + rxhdr->m_option_type = RX_CHECK_V4_OPT_TYPE; rxhdr->m_option_len = RX_CHECK_V4_OPT_LEN; } @@ -2148,6 +2158,7 @@ void CCapFileFlowInfo::update_info(){ lp = GetPacket(1); assert(lp); lp->m_pkt_indication.setTTL(TTL_RESERVE_DUPLICATE); + lp->m_pkt_indication.setTOSReserve(); } } @@ -2234,6 +2245,9 @@ enum CCapFileFlowInfo::load_cap_file_err CCapFileFlowInfo::load_cap_file(std::st pkt_indication.setTTL(TTL_RESERVE_DUPLICATE-4); } + pkt_indication.clearTOSReserve(); + + // Validation for first packet in flow if (is_fif) { lpflow->flow_id = m_total_flows; @@ -4419,7 +4433,7 @@ void CFlowGenListPerThread::stop_stateless_simulation_file(){ } void CFlowGenListPerThread::start_stateless_daemon_simulation(){ - + CGlobalInfo::m_options.m_run_mode = CParserOption::RUN_MODE_INTERACTIVE; m_cur_time_sec = 0; /* if no pending CP messages - the core will simply be stuck forever */ @@ -4438,6 +4452,7 @@ bool CFlowGenListPerThread::set_stateless_next_node( CGenNodeStateless * cur_nod void CFlowGenListPerThread::start_stateless_daemon(CPreviewMode &preview){ + CGlobalInfo::m_options.m_run_mode = CParserOption::RUN_MODE_INTERACTIVE; m_cur_time_sec = 0; /* set per thread global info, for performance */ m_preview_mode = preview; |