diff --git a/CMakeLists.txt b/CMakeLists.txt index ac4cc25..44195ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,6 +55,12 @@ else() set_property(GLOBAL PROPERTY INTERPROCEDURAL_OPTIMIZATION FALSE) endif () +# silence mode +option(GAPPP_SILENT "Do not print anything - for benchmark only?" OFF) +if (GAPPP_SILENT) + add_compile_definitions(GAPPP_SILENT) +endif() + # GPU direct option(GAPPP_GPU_DIRECT "Build with GPU direct support" ON) if (GAPPP_GPU_DIRECT) diff --git a/cuda-src/l3fwd.cu b/cuda-src/l3fwd.cu index a88d489..e40ae3d 100644 --- a/cuda-src/l3fwd.cu +++ b/cuda-src/l3fwd.cu @@ -94,7 +94,6 @@ namespace GAPPP { struct rte_ipv4_hdr *ip_hdr; ip_hdr = rte_pktmbuf_mtod_offset(packets[i], struct rte_ipv4_hdr *, sizeof(rte_ether_hdr)); unsigned int ip_dst = ip_hdr->dst_addr; - printf("Post IP addr\n"); cudaMemcpy((void *) (gpu_dst_ips + i), &ip_dst, sizeof(unsigned int), cudaMemcpyHostToDevice); } cudaDeviceSynchronize(); diff --git a/include/Logging.h b/include/Logging.h index b9639fb..c6ef9c5 100644 --- a/include/Logging.h +++ b/include/Logging.h @@ -34,8 +34,10 @@ namespace GAPPP { }; inline void whine(Severity sev, const std::string &message, const std::string &component = "???") { +#ifndef GAPPP_SILENT std::string print_out = fmt::format("[{}/{}] {}\n", component, sev_to_string(sev), message); std::cout << print_out << std::flush; +#endif if (unlikely(sev == Severity::CRIT)) { throw std::runtime_error(print_out); } diff --git a/src/Router.cpp b/src/Router.cpp index 8630602..00f3cef 100644 --- a/src/Router.cpp +++ b/src/Router.cpp @@ -401,6 +401,7 @@ namespace GAPPP { rte_pktmbuf_free(packets[i]); } whine(Severity::WARN, fmt::format("No TX buffer allocated for {}", id), GAPPP_LOG_ROUTER); + return 0; }; unsigned int ret = rte_ring_enqueue_burst(tx_ring, reinterpret_cast(packets), len, nullptr); if (ret < len) {