diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main_dpdk.cpp | 1 | ||||
-rw-r--r-- | src/stateless/cp/trex_api_class.h | 30 | ||||
-rw-r--r-- | src/stateless/cp/trex_stateless.cpp | 2 |
3 files changed, 28 insertions, 5 deletions
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp index 652e6947..131e87ac 100644 --- a/src/main_dpdk.cpp +++ b/src/main_dpdk.cpp @@ -2368,6 +2368,7 @@ void CGlobalStats::dump_json(std::string & json, bool baseline,uint32_t stats_ti #define GET_FIELD_PORT(p,f) get_field_port(p,std::string(#f),lp->f) json+=GET_FIELD(m_cpu_util); + json+=GET_FIELD(m_rx_cpu_util); json+=GET_FIELD(m_platform_factor); json+=GET_FIELD(m_tx_bps); json+=GET_FIELD(m_rx_bps); diff --git a/src/stateless/cp/trex_api_class.h b/src/stateless/cp/trex_api_class.h index 78933d23..748d1478 100644 --- a/src/stateless/cp/trex_api_class.h +++ b/src/stateless/cp/trex_api_class.h @@ -75,20 +75,42 @@ public: m_handler = utl_generate_random_str(seed, 8); } + std::string ver(int major, int minor) { + std::stringstream ss; + ss << major << "." << minor; + return ss.str(); + } + + std::string get_server_ver() { + return ver(m_major, m_major); + } + std::string & verify_api(int major, int minor) { std::stringstream ss; ss << "API type '" << type_to_name(m_type) << "': "; - + assert(m_type < API_CLASS_TYPE_MAX); + bool fail = false; + /* for now a simple major check */ if (major < m_major) { - ss << "server has a major newer API version - server: '" << m_major << "', client: '" << major << "'"; - throw TrexAPIException(ss.str()); + ss << "server has a newer major API version"; + fail = true; } if (major > m_major) { - ss << "server has an older API version - server: '" << m_major << "', client: '" << major << "'"; + ss << "server has an older major API version"; + fail = true; + } + + if (minor > m_minor) { + ss << "client revision API is newer than server"; + fail = true; + } + + if (fail) { + ss << " - server: '" << get_server_ver() << "', client: '" << ver(major, minor) << "'"; throw TrexAPIException(ss.str()); } diff --git a/src/stateless/cp/trex_stateless.cpp b/src/stateless/cp/trex_stateless.cpp index f6f81b96..c86c5f65 100644 --- a/src/stateless/cp/trex_stateless.cpp +++ b/src/stateless/cp/trex_stateless.cpp @@ -54,7 +54,7 @@ TrexStateless::TrexStateless(const TrexStatelessCfg &cfg) { m_publisher = cfg.m_publisher; /* API core version */ - m_api_classes[APIClass::API_CLASS_TYPE_CORE].init(APIClass::API_CLASS_TYPE_CORE, 1, 0); + m_api_classes[APIClass::API_CLASS_TYPE_CORE].init(APIClass::API_CLASS_TYPE_CORE, 1, 1); } /** |