Skip to content

Commit

Permalink
ASTF PARSE at CP core for additional profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
jsmoon committed Aug 11, 2022
1 parent 0c8fb08 commit d057ff8
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions src/stx/astf/trex_astf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ void TrexAstf::start_transmit(cp_profile_id_t profile_id, const start_params_t &
m_opts->m_astf_client_mask = args.client_mask;
m_opts->preview.set_ipv6_mode_enable(args.ipv6);

if ( pid->profile_needs_parsing() || topo_needs_parsing() ) {
if ( pid->profile_needs_parsing() || topo_needs_parsing() || tunnel_topo_needs_parsing() ) {
pid->parse();
} else {
pid->build();
Expand Down Expand Up @@ -1064,8 +1064,29 @@ void TrexAstfPerProfile::parse() {

auto astf_db = CAstfDB::get_instance(m_dp_profile_id);

TrexCpToDpMsgBase *msg = new TrexAstfLoadDB(m_dp_profile_id, prof, topo, astf_db, tunnel_topo);
m_astf_obj->send_message_to_dp(0, msg);
if (topo || tunnel_topo || m_astf_obj->is_dp_core_state(TrexAstfDpCore::STATE_IDLE)) {
TrexCpToDpMsgBase *msg = new TrexAstfLoadDB(m_dp_profile_id, prof, topo, astf_db, tunnel_topo);
m_astf_obj->send_message_to_dp(0, msg);
} else {
string err = "";
bool rc;

astf_db->Create();

rc = astf_db->set_profile_one_msg(*prof, err);
if (!rc) {
dp_core_error("profile parsing error at CP: " + err);
return;
}

int num_dp_cores = CGlobalInfo::m_options.preview.getCores() * CGlobalInfo::m_options.get_expected_dual_ports();
CJsonData_err err_obj = astf_db->verify_data(num_dp_cores);
if (err_obj.is_error()) {
dp_core_error("Profile split to DP cores error at CP: " + err_obj.description());
} else {
dp_core_finished();
}
}
}

void TrexAstfPerProfile::build() {
Expand All @@ -1079,6 +1100,13 @@ void TrexAstfPerProfile::build() {
astf_db->set_client_cfg_db(m_astf_obj->get_client_db());
}

if (!m_astf_obj->is_dp_core_state(TrexAstfDpCore::STATE_IDLE)) {
auto num_ports = CGlobalInfo::m_options.get_expected_ports();
for (uint8_t port_id = 0; port_id < num_ports; port_id += 2) {
astf_db->get_db_ro(CGlobalInfo::m_socket.port_to_socket(port_id));
}
}

TrexCpToDpMsgBase *msg = new TrexAstfDpCreateTcp(m_dp_profile_id, m_factor, astf_db);
m_astf_obj->send_message_to_all_dp(msg);
}
Expand Down

0 comments on commit d057ff8

Please sign in to comment.