├── utils ├── network │ ├── tcp_client.h │ └── tcp_server.h ├── proto │ └── dma_connect.proto ├── gflags_common.h ├── hdr_histogram.h ├── log.cpp ├── numautil.h ├── hdr_histogram.cpp └── bench │ └── simple_reporter.h ├── test_suite ├── roofline │ ├── roofline.cpp │ ├── CMakeLists.txt │ └── main.cpp ├── channel_bench │ ├── build_app │ ├── main.cpp │ └── CMakeLists.txt ├── build_app ├── memory_bench │ ├── memory_bench.cpp │ ├── CMakeLists.txt │ └── main.cpp ├── regex_bench │ ├── compile.sh │ ├── CMakeLists.txt │ ├── rules.txt │ ├── regex_bench.h │ └── main.cpp ├── compress_bench │ ├── Readme.md │ ├── CMakeLists.txt │ ├── compress_bench.h │ └── main.cpp ├── ec_bench │ ├── sw │ │ ├── ec_bench_sw_amd64 │ │ ├── ec_bench_sw_arm64 │ │ └── Makefile │ ├── CMakeLists.txt │ └── ec_bench.h ├── small_bank │ ├── run.sh │ └── CMakeLists.txt ├── dma_copy_bench │ ├── dma_copy_bench.cpp │ └── CMakeLists.txt ├── dma_local_to_local_sample │ └── CMakeLists.txt ├── gdr_bench │ ├── CMakeLists.txt │ ├── main.cpp │ └── gdr_bench.h └── rdma_bench │ └── CMakeLists.txt ├── third_party ├── HdrHistogram │ ├── test │ │ ├── test_tagged_missing_histogram.txt │ │ ├── test_tagged_invalid_histogram.txt │ │ ├── test_tagged_invalid_tag_key.txt │ │ ├── test_tagged_invalid_timestamp.txt │ │ ├── minunit.c │ │ ├── hdr_test_util.h │ │ └── minunit.h │ ├── ide │ │ └── codestyle.jar │ ├── lib │ │ └── benchmark-1.6.1.zip │ ├── .gitmodules │ ├── config.cmake.in │ ├── include │ │ ├── hdr │ │ │ ├── hdr_histogram_version.h │ │ │ ├── hdr_time.h │ │ │ └── hdr_thread.h │ │ └── CMakeLists.txt │ ├── hdr_histogram.pc.in │ ├── src │ │ ├── hdr_malloc.h │ │ └── hdr_tests.h │ ├── examples │ │ └── CMakeLists.txt │ ├── cmake │ │ └── JoinPaths.cmake │ └── .gitignore ├── json │ ├── cmake │ │ ├── pkg-config.pc.in │ │ ├── config.cmake.in │ │ └── nlohmann_jsonConfigVersion.cmake.in │ ├── include │ │ └── nlohmann │ │ │ └── detail │ │ │ ├── meta │ │ │ ├── call_std │ │ │ │ ├── begin.hpp │ │ │ │ └── end.hpp │ │ │ ├── identity_tag.hpp │ │ │ ├── void_t.hpp │ │ │ └── std_fs.hpp │ │ │ ├── input │ │ │ └── position_t.hpp │ │ │ └── iterators │ │ │ └── internal_iterator.hpp │ └── LICENSE.MIT ├── eRPC │ ├── src │ │ ├── transport_impl │ │ │ ├── fake │ │ │ │ └── fake_transport.cc │ │ │ ├── dpdk │ │ │ │ ├── dpdk_externs.cc │ │ │ │ └── dpdk_externs.h │ │ │ └── transport.cc │ │ ├── util │ │ │ ├── test_printf.h │ │ │ ├── tls_registry.h │ │ │ ├── tls_registry.cc │ │ │ ├── numautils.h │ │ │ ├── barrier.h │ │ │ ├── rand.h │ │ │ ├── spin_lock_mutex.h │ │ │ ├── udp_server.h │ │ │ ├── buffer.h │ │ │ ├── pmem.h │ │ │ ├── mt_queue.h │ │ │ ├── fixed_queue.h │ │ │ ├── mempool.h │ │ │ └── hdr_histogram_wrapper.h │ │ ├── cc │ │ │ └── timely_sweep_params.h │ │ ├── config.h.in │ │ ├── rpc_impl │ │ │ └── rpc_fault_inject.cc │ │ └── req_handle.h │ └── .gitignore └── asio │ └── include │ └── asio │ ├── unyield.hpp │ ├── yield.hpp │ ├── ts │ ├── io_context.hpp │ ├── buffer.hpp │ ├── net.hpp │ ├── timer.hpp │ ├── socket.hpp │ └── executor.hpp │ ├── io_service_strand.hpp │ ├── buffered_stream_fwd.hpp │ ├── version.hpp │ ├── buffered_read_stream_fwd.hpp │ ├── buffered_write_stream_fwd.hpp │ ├── signal_set.hpp │ ├── detail │ ├── limits.hpp │ ├── cstddef.hpp │ ├── date_time_fwd.hpp │ ├── dependent_type.hpp │ ├── win_iocp_thread_info.hpp │ ├── impl │ │ ├── thread_context.ipp │ │ ├── posix_mutex.ipp │ │ └── posix_tss_ptr.ipp │ ├── assert.hpp │ ├── operation.hpp │ ├── array_fwd.hpp │ ├── array.hpp │ ├── noncopyable.hpp │ ├── fd_set_adapter.hpp │ ├── null_fenced_block.hpp │ ├── scheduler_thread_info.hpp │ ├── resolve_op.hpp │ ├── signal_init.hpp │ ├── exception.hpp │ ├── functional.hpp │ ├── wait_op.hpp │ ├── future.hpp │ ├── timer_scheduler.hpp │ ├── regex_fwd.hpp │ ├── null_mutex.hpp │ └── scheduler_task.hpp │ ├── static_thread_pool.hpp │ ├── ssl.hpp │ ├── streambuf.hpp │ ├── io_service.hpp │ ├── ssl │ ├── impl │ │ └── src.hpp │ ├── detail │ │ └── openssl_types.hpp │ └── stream_base.hpp │ ├── impl │ ├── system_context.hpp │ ├── executor.ipp │ └── multiple_exceptions.ipp │ ├── associator.hpp │ ├── stream_file.hpp │ ├── basic_streambuf_fwd.hpp │ ├── readable_pipe.hpp │ ├── writable_pipe.hpp │ ├── experimental │ ├── append.hpp │ ├── prepend.hpp │ ├── as_tuple.hpp │ └── deferred.hpp │ ├── random_access_file.hpp │ ├── serial_port.hpp │ ├── posix │ ├── descriptor.hpp │ └── stream_descriptor.hpp │ ├── execution │ └── impl │ │ ├── bad_executor.ipp │ │ └── receiver_invocation_error.ipp │ ├── windows │ ├── stream_handle.hpp │ ├── object_handle.hpp │ ├── random_access_handle.hpp │ └── overlapped_handle.hpp │ ├── ip │ ├── host_name.hpp │ ├── resolver_query_base.hpp │ └── impl │ │ └── basic_endpoint.hpp │ ├── deadline_timer.hpp │ ├── steady_timer.hpp │ └── system_timer.hpp ├── flexio ├── dpa_send │ ├── dpa_send.cpp │ ├── common │ │ └── dpa_send_common.h │ ├── dpa_send.h │ └── CMakeLists.txt ├── dpa_send_ntp │ ├── dpa_send_ntp.cpp │ ├── common │ │ └── dpa_send_ntp_common.h │ ├── dpa_send_ntp.h │ └── CMakeLists.txt ├── bench │ ├── compute │ │ ├── dhrystone │ │ │ └── dhrystone_main.c │ │ ├── bench_cross.h │ │ ├── device │ │ │ └── bench_compute_device.c │ │ └── meson.build │ ├── memory │ │ ├── bench_memory_cross.h │ │ └── bench_cache_no_dpa.cpp │ ├── mt_memory │ │ ├── mt_memory_cross.h │ │ └── meson.build │ └── timer │ │ ├── meson.build │ │ └── bench_timer.cpp ├── dpa_refactor │ ├── dpa_refactor.cpp │ ├── common │ │ └── dpa_refactor_common.h │ ├── dpa_refactor.h │ └── CMakeLists.txt ├── dpa_refactor_ddio │ ├── dpa_refactor.cpp │ ├── common │ │ └── dpa_refactor_common.h │ └── dpa_refactor.h ├── dpa_refactor_test_hostrq │ ├── dpa_refactor.cpp │ ├── common │ │ └── dpa_refactor_common.h │ ├── dpa_refactor.h │ └── CMakeLists.txt ├── dpa_refactor_workingset │ ├── dpa_refactor_workingset.cpp │ ├── common │ │ └── dpa_refactor_workingset_common.h │ └── dpa_refactor_workingset.h ├── dpa_refactor_random_access │ ├── dpa_refactor_random_access.cpp │ ├── common │ │ └── dpa_refactor_random_access_common.h │ └── dpa_refactor_random_access.h ├── dpa_send_mt │ ├── dpa_send_mt.cpp │ ├── common │ │ └── dpa_send_common.h │ ├── dpa_send_mt.h │ └── CMakeLists.txt ├── dpa_refactor_mt │ ├── dpa_refactor_mt.cpp │ ├── common │ │ └── dpa_refactor_common.h │ ├── dpa_refactor_mt.h │ └── CMakeLists.txt ├── dpa_kv_aggregation │ ├── dpa_kv_aggregation.cpp │ ├── common │ │ └── dpa_kv_aggregation_common.h │ ├── dpa_kv_aggregation.h │ └── CMakeLists.txt ├── dpa_network_function │ ├── dpa_network_function.cpp │ ├── common │ │ └── dpa_network_function_common.h │ └── dpa_network_function.h ├── roofline │ ├── roofline.h │ └── CMakeLists.txt └── dpa_small_bank │ ├── dpa_small_bank_server.h │ └── dpa_small_bank_client.h ├── docker-compose.yml ├── .gitignore ├── scripts ├── yelp_dataset │ └── yelp_academic_handle.py ├── copy_to_host.py └── dpa_data_process.py ├── Dockerfile ├── wrapper ├── wrapper_pcc.h ├── wrapper_pe.cpp ├── wrapper_mmap.h ├── wrapper_buffer.cpp ├── wrapper_dma.cpp ├── wrapper_pe.h └── wrapper_ctx.h └── LICENSE /utils/network/tcp_client.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test_suite/roofline/roofline.cpp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test_suite/channel_bench/build_app: -------------------------------------------------------------------------------- 1 | sync -------------------------------------------------------------------------------- /test_suite/build_app: -------------------------------------------------------------------------------- 1 | dma_copy_bench 2 | -------------------------------------------------------------------------------- /test_suite/memory_bench/memory_bench.cpp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /third_party/HdrHistogram/test/test_tagged_missing_histogram.txt: -------------------------------------------------------------------------------- 1 | Tag=a7.133a,7.133,0.999,0.459 -------------------------------------------------------------------------------- /test_suite/regex_bench/compile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rxpc -V bf3 -f ./rules.txt -p 0.001 -o /tmp/rules -------------------------------------------------------------------------------- /test_suite/compress_bench/Readme.md: -------------------------------------------------------------------------------- 1 | ### Test File 2 | 3 | https://sun.aei.polsl.pl//~sdeor/corpus/silesia.zip 4 | -------------------------------------------------------------------------------- /third_party/HdrHistogram/test/test_tagged_invalid_histogram.txt: -------------------------------------------------------------------------------- 1 | Tag=a7.133a,7.133,0.999,0.459,HISTFAAAAEJ42pNpmSzMwMCgwAABT -------------------------------------------------------------------------------- /flexio/dpa_send/dpa_send.cpp: -------------------------------------------------------------------------------- 1 | #include "dpa_send.h" 2 | 3 | DEFINE_string(device_name, "", "device name for select ib device"); -------------------------------------------------------------------------------- /test_suite/ec_bench/sw/ec_bench_sw_amd64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC4ML/BenchBF3/HEAD/test_suite/ec_bench/sw/ec_bench_sw_amd64 -------------------------------------------------------------------------------- /test_suite/ec_bench/sw/ec_bench_sw_arm64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC4ML/BenchBF3/HEAD/test_suite/ec_bench/sw/ec_bench_sw_arm64 -------------------------------------------------------------------------------- /flexio/dpa_send_ntp/dpa_send_ntp.cpp: -------------------------------------------------------------------------------- 1 | #include "dpa_send_ntp.h" 2 | 3 | DEFINE_string(device_name, "", "device name for select ib device"); -------------------------------------------------------------------------------- /third_party/HdrHistogram/ide/codestyle.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC4ML/BenchBF3/HEAD/third_party/HdrHistogram/ide/codestyle.jar -------------------------------------------------------------------------------- /flexio/bench/compute/dhrystone/dhrystone_main.c: -------------------------------------------------------------------------------- 1 | #include "dhrystone.h" 2 | 3 | int main(){ 4 | dhrystone_bench(0); 5 | return 0; 6 | } -------------------------------------------------------------------------------- /flexio/dpa_refactor/dpa_refactor.cpp: -------------------------------------------------------------------------------- 1 | #include "dpa_refactor.h" 2 | 3 | DEFINE_string(device_name, "", "device name for select ib device"); -------------------------------------------------------------------------------- /flexio/dpa_refactor_ddio/dpa_refactor.cpp: -------------------------------------------------------------------------------- 1 | #include "dpa_refactor.h" 2 | 3 | DEFINE_string(device_name, "", "device name for select ib device"); -------------------------------------------------------------------------------- /third_party/HdrHistogram/lib/benchmark-1.6.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC4ML/BenchBF3/HEAD/third_party/HdrHistogram/lib/benchmark-1.6.1.zip -------------------------------------------------------------------------------- /flexio/dpa_refactor_test_hostrq/dpa_refactor.cpp: -------------------------------------------------------------------------------- 1 | #include "dpa_refactor.h" 2 | 3 | DEFINE_string(device_name, "", "device name for select ib device"); -------------------------------------------------------------------------------- /flexio/bench/compute/bench_cross.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct ComputeArg{ 4 | int stream_id; 5 | }; 6 | 7 | #define DPA_DHRYSTONE_NUMBER_OF_RUNS 500000 8 | -------------------------------------------------------------------------------- /flexio/dpa_refactor_workingset/dpa_refactor_workingset.cpp: -------------------------------------------------------------------------------- 1 | #include "dpa_refactor_workingset.h" 2 | 3 | DEFINE_string(device_name, "", "device name for select ib device"); -------------------------------------------------------------------------------- /third_party/HdrHistogram/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "test/vendor/google/benchmark"] 2 | path = test/vendor/google/benchmark 3 | url = https://github.com/google/benchmark.git 4 | -------------------------------------------------------------------------------- /flexio/dpa_refactor_random_access/dpa_refactor_random_access.cpp: -------------------------------------------------------------------------------- 1 | #include "dpa_refactor_random_access.h" 2 | 3 | DEFINE_string(device_name, "", "device name for select ib device"); -------------------------------------------------------------------------------- /third_party/json/cmake/pkg-config.pc.in: -------------------------------------------------------------------------------- 1 | Name: ${PROJECT_NAME} 2 | Description: JSON for Modern C++ 3 | Version: ${PROJECT_VERSION} 4 | Cflags: -I${CMAKE_INSTALL_FULL_INCLUDEDIR} 5 | -------------------------------------------------------------------------------- /third_party/HdrHistogram/test/test_tagged_invalid_tag_key.txt: -------------------------------------------------------------------------------- 1 | Ta=a7.133a,7.133,0.999,0.459,HISTFAAAAEJ42pNpmSzMwMCgwAABTBDKD8hndjPYsYDB/gNEhEtMQEBBTk5MQERCRkBEQEWlh9FJbg9jE+MS5ig1LhYmADkkCcE= -------------------------------------------------------------------------------- /third_party/HdrHistogram/test/test_tagged_invalid_timestamp.txt: -------------------------------------------------------------------------------- 1 | Tag=a7.133a,7.1a33,0.999,0.459,HISTFAAAAEJ42pNpmSzMwMCgwAABTBDKD8hndjPYsYDB/gNEhEtMQEBBTk5MQERCRkBEQEWlh9FJbg9jE+MS5ig1LhYmADkkCcE= -------------------------------------------------------------------------------- /utils/network/tcp_server.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | #include "common.hpp" 8 | 9 | namespace DOCA { 10 | } -------------------------------------------------------------------------------- /test_suite/small_bank/run.sh: -------------------------------------------------------------------------------- 1 | sudo ../bin_host/smallbank_client -server_addr 172.25.2.23:31851 -concurrency 128 -client_num 3 2 | sudo ../bin_host/smallbank_server -server_addr 172.25.2.24:31851 -server_num 3 3 | -------------------------------------------------------------------------------- /third_party/HdrHistogram/config.cmake.in: -------------------------------------------------------------------------------- 1 | include(CMakeFindDependencyMacro) 2 | 3 | find_dependency(ZLIB) 4 | find_dependency(Threads) 5 | 6 | include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake) 7 | -------------------------------------------------------------------------------- /test_suite/ec_bench/sw/Makefile: -------------------------------------------------------------------------------- 1 | LDFLAGS_COMMON := -s -w 2 | 3 | GOARCH=amd64 go build -ldflags "-s -w" -o build/ec_bench_sw_amd64 ./main.go 4 | GOARCH=arm64 go build -ldflags "-s -w" -o build/ec_bench_sw_arm64 ./main.go -------------------------------------------------------------------------------- /flexio/dpa_send_mt/dpa_send_mt.cpp: -------------------------------------------------------------------------------- 1 | #include "dpa_send_mt.h" 2 | 3 | DEFINE_string(device_name, "", "device name for select ib device"); 4 | 5 | DEFINE_uint64(begin_thread, 0, "begin thread number, which means use DPA core [begin_thread, begin_thread + g_thread_num]"); -------------------------------------------------------------------------------- /third_party/eRPC/src/transport_impl/fake/fake_transport.cc: -------------------------------------------------------------------------------- 1 | #ifdef ERPC_FAKE 2 | #include "fake_transport.h" 3 | #include 4 | 5 | namespace erpc { 6 | 7 | constexpr size_t FakeTransport::kMaxDataPerPkt; 8 | 9 | } // namespace erpc 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /flexio/dpa_refactor_mt/dpa_refactor_mt.cpp: -------------------------------------------------------------------------------- 1 | #include "dpa_refactor_mt.h" 2 | 3 | DEFINE_string(device_name, "", "device name for select ib device"); 4 | 5 | DEFINE_uint64(begin_thread, 0, "begin thread number, which means use DPA core [begin_thread, begin_thread + g_thread_num]"); -------------------------------------------------------------------------------- /test_suite/ec_bench/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(EC_BENCH) 2 | 3 | set(SAMPLE_NAME ec_bench) 4 | 5 | set(APP_ADDITIONAL_SOURCES) 6 | 7 | add_executable(${SAMPLE_NAME} ./main.cpp ec_bench.cpp ${UTILSOURCES} ${APP_ADDITIONAL_SOURCES}) 8 | 9 | target_link_libraries(${SAMPLE_NAME} ${LIBRARIES}) -------------------------------------------------------------------------------- /flexio/dpa_kv_aggregation/dpa_kv_aggregation.cpp: -------------------------------------------------------------------------------- 1 | #include "dpa_kv_aggregation.h" 2 | 3 | DEFINE_string(device_name, "", "device name for select ib device"); 4 | 5 | DEFINE_uint64(begin_thread, 0, "begin thread number, which means use DPA core [begin_thread, begin_thread + g_thread_num]"); -------------------------------------------------------------------------------- /flexio/dpa_network_function/dpa_network_function.cpp: -------------------------------------------------------------------------------- 1 | #include "dpa_network_function.h" 2 | 3 | DEFINE_string(device_name, "", "device name for select ib device"); 4 | 5 | DEFINE_uint64(begin_thread, 0, "begin thread number, which means use DPA core [begin_thread, begin_thread + g_thread_num]"); -------------------------------------------------------------------------------- /test_suite/dma_copy_bench/dma_copy_bench.cpp: -------------------------------------------------------------------------------- 1 | #include "dma_copy_bench.h" 2 | 3 | DEFINE_uint32(bind_offset, 0, "bind to offset core and thread ID"); 4 | 5 | DEFINE_uint32(bind_numa, 0, "bind to numa node"); 6 | 7 | bool stop_flag = false; 8 | 9 | void ctrl_c_handler(int) { stop_flag = true; } -------------------------------------------------------------------------------- /test_suite/regex_bench/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(REGEX_BENCH) 2 | 3 | set(SAMPLE_NAME regex_bench) 4 | 5 | set(APP_ADDITIONAL_SOURCES) 6 | 7 | add_executable(${SAMPLE_NAME} ./main.cpp ./regex_bench.cpp ${UTILSOURCES} ${APP_ADDITIONAL_SOURCES}) 8 | 9 | target_link_libraries(${SAMPLE_NAME} ${LIBRARIES}) -------------------------------------------------------------------------------- /utils/proto/dma_connect.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package dma_connect; 4 | 5 | option optimize_for = LITE_RUNTIME; 6 | 7 | message doca_conn_info { 8 | 9 | repeated bytes exports = 1; 10 | repeated uint64 buffers_ptr = 2; 11 | repeated uint64 buffers_size = 3; 12 | } -------------------------------------------------------------------------------- /test_suite/memory_bench/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(MEMORY_BENCH) 2 | 3 | set(SAMPLE_NAME memory_bench) 4 | 5 | set(APP_ADDITIONAL_SOURCES memory_bench.cpp) 6 | 7 | add_executable(${SAMPLE_NAME} ./main.cpp ${UTILSOURCES} ${APP_ADDITIONAL_SOURCES}) 8 | 9 | target_link_libraries(${SAMPLE_NAME} ${LIBRARIES}) -------------------------------------------------------------------------------- /test_suite/compress_bench/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(COMPRESS_BENCH) 2 | 3 | set(SAMPLE_NAME compress_bench) 4 | 5 | set(APP_ADDITIONAL_SOURCES) 6 | 7 | add_executable(${SAMPLE_NAME} ./main.cpp compress_bench.cpp ${UTILSOURCES} ${APP_ADDITIONAL_SOURCES}) 8 | 9 | target_link_libraries(${SAMPLE_NAME} ${LIBRARIES}) -------------------------------------------------------------------------------- /third_party/eRPC/src/util/test_printf.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #define test_printf(...) \ 5 | do { \ 6 | printf("[ ] "); \ 7 | printf(__VA_ARGS__); \ 8 | fflush(stderr); \ 9 | fflush(stdout); \ 10 | } while (0) 11 | -------------------------------------------------------------------------------- /test_suite/regex_bench/rules.txt: -------------------------------------------------------------------------------- 1 | # Email 2 | subset_id = 1 3 | 1, /[\w\.+-]+@[\w\.-]+\.[\w\.-]+/ 4 | 5 | # URI 6 | subset_id = 2 7 | 1, /[\w]+:\/\/[^/\s?#]+[^\s?#]+(?:\?[^\s#]*)?(?:#[^\s]*)?/ 8 | 9 | #IPV4 10 | subset_id = 3 11 | 1, /(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9])/ -------------------------------------------------------------------------------- /third_party/eRPC/src/cc/timely_sweep_params.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * @file timely-sweep-params.h 5 | * @brief Timely parameters that need to be sweeped 6 | */ 7 | static constexpr bool kPatched = false; ///< Patch from ECN-vs-delay 8 | static constexpr double kEwmaAlpha = 0.46; 9 | static constexpr double kBeta = 0.26; 10 | -------------------------------------------------------------------------------- /test_suite/dma_local_to_local_sample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(DMA_LOCAL_TO_LOCAL_SAMPLE) 2 | 3 | set(SAMPLE_NAME dma_local_sample) 4 | 5 | set(APP_ADDITIONAL_SOURCES "") 6 | 7 | add_executable(${SAMPLE_NAME} dma_local_sample_main.cpp dma_local_sample.cpp ${UTILSOURCES} ${APP_ADDITIONAL_SOURCES}) 8 | 9 | target_link_libraries(${SAMPLE_NAME} ${LIBRARIES}) -------------------------------------------------------------------------------- /flexio/dpa_refactor_mt/common/dpa_refactor_common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "common_cross.h" 4 | 5 | #define LOG_SQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 6 | #define LOG_RQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 7 | #define LOG_CQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 8 | 9 | #define LOG_WQ_DATA_ENTRY_BSIZE 11 /* WQ buffer logarithmic size */ 10 | -------------------------------------------------------------------------------- /flexio/dpa_refactor/common/dpa_refactor_common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "common_cross.h" 4 | 5 | #define LOG_SQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 6 | #define LOG_RQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 7 | #define LOG_CQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 8 | 9 | #define LOG_WQ_DATA_ENTRY_BSIZE 10 /* WQ buffer logarithmic size */ 10 | -------------------------------------------------------------------------------- /third_party/eRPC/src/transport_impl/dpdk/dpdk_externs.cc: -------------------------------------------------------------------------------- 1 | #ifdef ERPC_DPDK 2 | 3 | #include "dpdk_externs.h" 4 | #include "dpdk_transport.h" 5 | 6 | namespace erpc { 7 | 8 | std::mutex g_dpdk_lock; 9 | bool g_dpdk_initialized; 10 | bool g_port_initialized[RTE_MAX_ETHPORTS]; 11 | DpdkTransport::ownership_memzone_t *g_memzone; 12 | 13 | } // namespace erpc 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /flexio/dpa_network_function/common/dpa_network_function_common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "common_cross.h" 4 | 5 | #define LOG_SQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 6 | #define LOG_RQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 7 | #define LOG_CQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 8 | 9 | #define LOG_WQ_DATA_ENTRY_BSIZE 11 /* WQ buffer logarithmic size */ 10 | -------------------------------------------------------------------------------- /flexio/dpa_refactor_ddio/common/dpa_refactor_common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "common_cross.h" 4 | 5 | #define LOG_SQ_RING_DEPTH 10 /* 2^7 entries, max is 2^15 */ 6 | #define LOG_RQ_RING_DEPTH 10 /* 2^7 entries, max is 2^15 */ 7 | #define LOG_CQ_RING_DEPTH 10 /* 2^7 entries, max is 2^15 */ 8 | 9 | #define LOG_WQ_DATA_ENTRY_BSIZE 10 /* WQ buffer logarithmic size */ 10 | -------------------------------------------------------------------------------- /test_suite/dma_copy_bench/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(DMA_COPY_BENCH) 2 | 3 | set(SAMPLE_NAME dma_copy_bench) 4 | 5 | set(APP_ADDITIONAL_SOURCES ./dma_copy_bench.cpp ${CMAKE_SOURCE_DIR}/utils/proto/dma_connect.pb.cc) 6 | 7 | add_executable(${SAMPLE_NAME} ./main.cpp ./exporter.cpp ./importer.cpp ${UTILSOURCES} ${APP_ADDITIONAL_SOURCES}) 8 | 9 | target_link_libraries(${SAMPLE_NAME} ${LIBRARIES}) -------------------------------------------------------------------------------- /flexio/dpa_refactor_test_hostrq/common/dpa_refactor_common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "common_cross.h" 4 | 5 | #define LOG_SQ_RING_DEPTH 11 /* 2^7 entries, max is 2^15 */ 6 | #define LOG_RQ_RING_DEPTH 11 /* 2^7 entries, max is 2^15 */ 7 | #define LOG_CQ_RING_DEPTH 11 /* 2^7 entries, max is 2^15 */ 8 | 9 | #define LOG_WQ_DATA_ENTRY_BSIZE 10 /* WQ buffer logarithmic size */ 10 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | 3 | services: 4 | doca-dev: 5 | image: doca-dev 6 | container_name: doca-dev 7 | privileged: true 8 | restart: unless-stopped 9 | network_mode: "host" 10 | ulimits: 11 | memlock: -1 12 | devices: 13 | - /dev:/dev 14 | ports: 15 | - "2222:22" 16 | volumes: 17 | - ./:/root/dev 18 | - /dev:/dev 19 | -------------------------------------------------------------------------------- /test_suite/roofline/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(ROOFLINE) 2 | 3 | set(SAMPLE_NAME roofline) 4 | 5 | set(APP_ADDITIONAL_SOURCES roofline.cpp) 6 | 7 | # don't use vectorize instruction in this test 8 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-tree-vectorize") 9 | 10 | add_executable(${SAMPLE_NAME} ./main.cpp ${UTILSOURCES} ${APP_ADDITIONAL_SOURCES}) 11 | 12 | target_link_libraries(${SAMPLE_NAME} ${LIBRARIES}) -------------------------------------------------------------------------------- /test_suite/small_bank/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(small_bank) 2 | 3 | set(PROGRAMS client server) 4 | 5 | set(APP_ADDITIONAL_SOURCES ${UTILSOURCES}) 6 | 7 | foreach (project_name IN LISTS PROGRAMS) 8 | add_executable(smallbank_${project_name} ${CMAKE_CURRENT_SOURCE_DIR}/${project_name}/${project_name}.cpp ${APP_ADDITIONAL_SOURCES}) 9 | target_link_libraries(smallbank_${project_name} erpc ${LIBRARIES}) 10 | endforeach () 11 | -------------------------------------------------------------------------------- /third_party/HdrHistogram/include/hdr/hdr_histogram_version.h: -------------------------------------------------------------------------------- 1 | /** 2 | * hdr_histogram_version.h 3 | * Written by Marco Ippolito, Michael Barker and released to the public domain, 4 | * as explained at http://creativecommons.org/publicdomain/zero/1.0/ 5 | */ 6 | 7 | #ifndef HDR_HISTOGRAM_VERSION_H 8 | #define HDR_HISTOGRAM_VERSION_H 9 | 10 | #define HDR_HISTOGRAM_VERSION "0.11.8" 11 | 12 | #endif // HDR_HISTOGRAM_VERSION_H 13 | -------------------------------------------------------------------------------- /flexio/dpa_refactor_workingset/common/dpa_refactor_workingset_common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "common_cross.h" 4 | 5 | #define LOG_SQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 6 | #define LOG_RQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 7 | #define LOG_CQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 8 | 9 | #define LOG_WQ_DATA_ENTRY_BSIZE 11 /* WQ buffer logarithmic size */ 10 | 11 | #define MAGIC_NUMBER 0xfffffffffffffffe 12 | -------------------------------------------------------------------------------- /third_party/HdrHistogram/hdr_histogram.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | libdir=@libdir_for_pc_file@ 3 | includedir=@includedir_for_pc_file@ 4 | 5 | Name: @PROJECT_NAME@ 6 | Description: @CMAKE_PROJECT_DESCRIPTION@ 7 | URL: @CMAKE_PROJECT_HOMEPAGE_URL@ 8 | Version: @PROJECT_VERSION@ 9 | Requires.private: @PC_REQUIRES_PRIVATE_ZLIB@ 10 | Cflags: -I${includedir} 11 | Libs: -L${libdir} -l@PROJECT_NAME@ 12 | Libs.private: -pthread -lm -lrt -L${libdir} 13 | -------------------------------------------------------------------------------- /flexio/dpa_refactor_random_access/common/dpa_refactor_random_access_common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "common_cross.h" 4 | 5 | #define LOG_SQ_RING_DEPTH 12 /* 2^7 entries, max is 2^15 */ 6 | #define LOG_RQ_RING_DEPTH 12 /* 2^7 entries, max is 2^15 */ 7 | #define LOG_CQ_RING_DEPTH 12 /* 2^7 entries, max is 2^15 */ 8 | 9 | #define LOG_WQ_DATA_ENTRY_BSIZE 11 /* WQ buffer logarithmic size */ 10 | 11 | #define MAGIC_NUMBER 0xfffffffffffffffe 12 | 13 | // #define ARRAY_SIZE 1048576 14 | -------------------------------------------------------------------------------- /third_party/HdrHistogram/include/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | configure_file(hdr/hdr_histogram_version.h hdr/hdr_histogram_version.h @ONLY) 2 | 3 | set(HDR_HISTOGRAM_PUBLIC_HEADERS 4 | hdr/hdr_histogram.h 5 | hdr/hdr_histogram_log.h 6 | hdr/hdr_interval_recorder.h 7 | hdr/hdr_thread.h 8 | hdr/hdr_time.h 9 | hdr/hdr_writer_reader_phaser.h 10 | hdr/hdr_histogram_version.h) 11 | 12 | install( 13 | FILES ${HDR_HISTOGRAM_PUBLIC_HEADERS} 14 | DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hdr) 15 | -------------------------------------------------------------------------------- /third_party/asio/include/asio/unyield.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // unyield.hpp 3 | // ~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifdef reenter 12 | # undef reenter 13 | #endif 14 | 15 | #ifdef yield 16 | # undef yield 17 | #endif 18 | 19 | #ifdef fork 20 | # undef fork 21 | #endif 22 | -------------------------------------------------------------------------------- /third_party/eRPC/src/config.h.in: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace erpc { 5 | 6 | // Pick a transport. This is hard to control from CMake. 7 | class IBTransport; 8 | class RawTransport; 9 | class DpdkTransport; 10 | class FakeTransport; 11 | 12 | #define CTransport ${CONFIG_TRANSPORT} 13 | static constexpr size_t kHeadroom = ${CONFIG_HEADROOM}; 14 | static constexpr size_t kIsRoCE = ${CONFIG_IS_ROCE}; 15 | static constexpr size_t kIsAzure = ${CONFIG_IS_AZURE}; 16 | } // namespace erpc 17 | -------------------------------------------------------------------------------- /third_party/eRPC/src/util/tls_registry.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "common.h" 5 | 6 | namespace erpc { 7 | 8 | class TlsRegistry { 9 | public: 10 | TlsRegistry() : cur_etid_(0) {} 11 | std::atomic cur_etid_; 12 | 13 | /// Initialize all the thread-local registry members 14 | void init(); 15 | 16 | /// Reset all members 17 | void reset(); 18 | 19 | /// Return the eRPC thread ID of the caller 20 | size_t get_etid() const; 21 | }; 22 | } // namespace erpc 23 | -------------------------------------------------------------------------------- /third_party/eRPC/src/transport_impl/transport.cc: -------------------------------------------------------------------------------- 1 | #include "transport.h" 2 | #include "util/huge_alloc.h" 3 | 4 | namespace erpc { 5 | 6 | Transport::Transport(TransportType transport_type, uint8_t rpc_id, 7 | uint8_t phy_port, size_t numa_node, FILE *trace_file) 8 | : transport_type_(transport_type), 9 | rpc_id_(rpc_id), 10 | phy_port_(phy_port), 11 | numa_node_(numa_node), 12 | trace_file_(trace_file) {} 13 | 14 | Transport::~Transport() {} 15 | 16 | } // namespace erpc 17 | -------------------------------------------------------------------------------- /flexio/bench/compute/device/bench_compute_device.c: -------------------------------------------------------------------------------- 1 | #include "wrapper_flexio/wrapper_flexio_device.h" 2 | #include "wrapper_flexio/common_cross.h" 3 | #include "../dhrystone/dhrystone.h" 4 | #include "../bench_cross.h" 5 | 6 | __FLEXIO_ENTRY_POINT_START 7 | __dpa_rpc__ uint64_t bench_func(uint64_t arg_daddr){ 8 | struct ComputeArg* arg = (struct ComputeArg*)arg_daddr; 9 | int stream_id = arg->stream_id; 10 | LOG_F(stream_id, "Bench func, with stream id:%d\n", stream_id); 11 | dhrystone_bench(stream_id); 12 | // sleep_(1); 13 | return 0; 14 | } 15 | __FLEXIO_ENTRY_POINT_END 16 | -------------------------------------------------------------------------------- /flexio/dpa_kv_aggregation/common/dpa_kv_aggregation_common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "common_cross.h" 4 | 5 | #define LOG_SQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 6 | #define LOG_RQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 7 | #define LOG_CQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 8 | 9 | #define LOG_WQ_DATA_ENTRY_BSIZE 11 /* WQ buffer logarithmic size */ 10 | 11 | static const size_t entry_size = 65536; 12 | 13 | #define STOP_NUMBER 5000000 14 | 15 | #define MAX_ELEMENT_NUM 1 16 | struct kv_element { 17 | uint64_t key; 18 | uint64_t value; 19 | }; 20 | -------------------------------------------------------------------------------- /test_suite/compress_bench/compress_bench.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "wrapper_buffer.h" 4 | #include "wrapper_ctx.h" 5 | #include "wrapper_device.h" 6 | #include "wrapper_mmap.h" 7 | #include "wrapper_workq.h" 8 | #include "wrapper_compress.h" 9 | #include "hs_clock.h" 10 | #include 11 | 12 | 13 | DECLARE_string(input_path); 14 | 15 | 16 | class compress_config { 17 | public: 18 | std::string pci_address; 19 | std::string input_str; 20 | size_t batch_size; 21 | }; 22 | 23 | 24 | doca_error_t compress_bench(compress_config &config, bool is_lz4); -------------------------------------------------------------------------------- /third_party/json/include/nlohmann/detail/meta/call_std/begin.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.11.2 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | NLOHMANN_JSON_NAMESPACE_BEGIN 14 | 15 | NLOHMANN_CAN_CALL_STD_FUNC_IMPL(begin); 16 | 17 | NLOHMANN_JSON_NAMESPACE_END 18 | -------------------------------------------------------------------------------- /third_party/json/include/nlohmann/detail/meta/call_std/end.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.11.2 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | NLOHMANN_JSON_NAMESPACE_BEGIN 14 | 15 | NLOHMANN_CAN_CALL_STD_FUNC_IMPL(end); 16 | 17 | NLOHMANN_JSON_NAMESPACE_END 18 | -------------------------------------------------------------------------------- /utils/gflags_common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | DECLARE_string(g_pci_address); 6 | 7 | DECLARE_string(g_rep_pci_address); 8 | 9 | DECLARE_string(g_ibdev_name); 10 | 11 | DECLARE_string(g_sample_text); 12 | 13 | DECLARE_string(g_network_address); 14 | 15 | DECLARE_uint32(g_thread_num); 16 | 17 | DECLARE_bool(g_is_exported); 18 | 19 | DECLARE_bool(g_is_server); 20 | 21 | DECLARE_bool(g_is_read); 22 | 23 | DECLARE_uint32(g_payload); 24 | 25 | DECLARE_uint32(g_batch_size); 26 | 27 | DECLARE_uint32(g_mmap_length); 28 | 29 | DECLARE_uint32(g_life_time); 30 | -------------------------------------------------------------------------------- /third_party/HdrHistogram/test/minunit.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "minunit.h" 4 | 5 | bool compare_double(double a, double b, double delta) 6 | { 7 | if (fabs(a - b) < delta) 8 | { 9 | return true; 10 | } 11 | 12 | printf("[compare_double] fabs(%f, %f) < %f == false\n", a, b, delta); 13 | return false; 14 | } 15 | 16 | bool compare_int64(int64_t a, int64_t b) 17 | { 18 | if (a == b) 19 | { 20 | return true; 21 | } 22 | 23 | printf("[compare_int64] %" PRIu64 " == %" PRIu64 " == false\n", a, b); 24 | return false; 25 | } 26 | -------------------------------------------------------------------------------- /third_party/asio/include/asio/yield.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // yield.hpp 3 | // ~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #include "coroutine.hpp" 12 | 13 | #ifndef reenter 14 | # define reenter(c) ASIO_CORO_REENTER(c) 15 | #endif 16 | 17 | #ifndef yield 18 | # define yield ASIO_CORO_YIELD 19 | #endif 20 | 21 | #ifndef fork 22 | # define fork ASIO_CORO_FORK 23 | #endif 24 | -------------------------------------------------------------------------------- /third_party/eRPC/src/util/tls_registry.cc: -------------------------------------------------------------------------------- 1 | #include "tls_registry.h" 2 | #include "common.h" 3 | 4 | namespace erpc { 5 | 6 | thread_local bool tls_initialized = false; 7 | thread_local size_t etid = SIZE_MAX; 8 | 9 | void TlsRegistry::init() { 10 | assert(!tls_initialized); 11 | tls_initialized = true; 12 | etid = cur_etid_++; 13 | } 14 | 15 | void TlsRegistry::reset() { 16 | tls_initialized = false; 17 | etid = SIZE_MAX; 18 | cur_etid_ = 0; 19 | } 20 | 21 | size_t TlsRegistry::get_etid() const { 22 | assert(tls_initialized); 23 | return etid; 24 | } 25 | 26 | } // namespace erpc 27 | -------------------------------------------------------------------------------- /flexio/bench/memory/bench_memory_cross.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "wrapper_flexio/common_cross.h" 4 | 5 | #define COPY_FROM_HOST 0 6 | #define POSIX_MEM_ALIGN 1 7 | 8 | const char* MemTypeStr[] = { 9 | "COPY_FROM_HOST", 10 | "POSIX_MEM_ALIGN" 11 | }; 12 | 13 | #define MEMORY_TYPE COPY_FROM_HOST 14 | 15 | #define LOOPS 1 16 | #define STRIDE 16 17 | #define EXPAND_SIZE 1 18 | 19 | size_t THREAD_MEM_SIZE = 1024UL*1024*256; 20 | 21 | struct MemoryArg 22 | { 23 | int stream_id; 24 | uint32_t window_id; 25 | uint32_t mkey; 26 | void *haddr; 27 | 28 | DevP(uint64_t) data; 29 | }; 30 | -------------------------------------------------------------------------------- /flexio/roofline/roofline.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "common_cross.h" 4 | 5 | #if defined(__x86_64__) || defined(__aarch64__) 6 | 7 | #elif defined(__riscv) 8 | 9 | #endif 10 | 11 | 12 | #define HOST_MEM 0 13 | #define PRIVATE_MEM 1 14 | 15 | const char *MemTypeStr[] = { 16 | "HOST_MEM", 17 | "PRIVATE_MEM" 18 | }; 19 | 20 | 21 | struct MemoryArg { 22 | int stream_id; 23 | uint32_t window_id; 24 | uint32_t mkey; 25 | int mem_type; 26 | size_t size; 27 | int compute_count; 28 | size_t loop; 29 | 30 | void *haddr; 31 | DevP(uint64_t) ddata; 32 | 33 | }; 34 | -------------------------------------------------------------------------------- /test_suite/regex_bench/regex_bench.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "wrapper_buffer.h" 4 | #include "wrapper_ctx.h" 5 | #include "wrapper_device.h" 6 | #include "wrapper_mmap.h" 7 | #include "wrapper_workq.h" 8 | #include "wrapper_regex.h" 9 | #include "hs_clock.h" 10 | #include 11 | 12 | 13 | DECLARE_string(input_path); 14 | 15 | DECLARE_string(rule_path); 16 | 17 | 18 | class regex_config { 19 | public: 20 | std::string pci_address; 21 | std::string input_str; 22 | std::string rule_str; 23 | size_t batch_size; 24 | }; 25 | 26 | doca_error_t regex_bench(regex_config &config); -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | /build 34 | /clang-target 35 | /build_host 36 | /build_dpu 37 | /lib* 38 | /bin* 39 | /bin_host 40 | /bin_dpu 41 | .vscode/ 42 | .idea/ 43 | **/core.* 44 | /log 45 | /doca-sample 46 | /doca-application -------------------------------------------------------------------------------- /flexio/bench/mt_memory/mt_memory_cross.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "wrapper_flexio/common_cross.h" 4 | 5 | #if defined(__x86_64__) || defined(__aarch64__) 6 | 7 | #elif defined(__riscv) 8 | 9 | #endif 10 | 11 | 12 | #define HOST_MEM 0 13 | #define PRIVATE_MEM 1 14 | 15 | const char* MemTypeStr[] = { 16 | "HOST_MEM", 17 | "PRIVATE_MEM" 18 | }; 19 | 20 | #define EXPAND_SIZE 1 21 | 22 | struct MemoryArg{ 23 | int stream_id; 24 | uint32_t window_id; 25 | uint32_t mkey; 26 | int mem_type; 27 | size_t size; 28 | int stride; 29 | size_t loop; 30 | 31 | void* haddr; 32 | DevP(uint64_t) ddata; 33 | 34 | }; 35 | -------------------------------------------------------------------------------- /third_party/asio/include/asio/ts/io_context.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // ts/io_context.hpp 3 | // ~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_TS_IO_CONTEXT_HPP 12 | #define ASIO_TS_IO_CONTEXT_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/io_context.hpp" 19 | 20 | #endif // ASIO_TS_IO_CONTEXT_HPP 21 | -------------------------------------------------------------------------------- /test_suite/gdr_bench/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(GDR_BENCH) 2 | 3 | set(SAMPLE_NAME gdr_bench) 4 | 5 | set(APP_ADDITIONAL_SOURCES ${CMAKE_SOURCE_DIR}/utils/proto/dma_connect.pb.cc) 6 | 7 | if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") 8 | find_package(CUDAToolkit REQUIRED) 9 | include_directories(${CUDA_INCLUDE_DIRS}) 10 | endif() 11 | 12 | add_executable(${SAMPLE_NAME} ./main.cpp ./exporter.cpp ./importer.cpp ${UTILSOURCES} ${APP_ADDITIONAL_SOURCES}) 13 | 14 | target_link_libraries(${SAMPLE_NAME} ${LIBRARIES}) 15 | 16 | if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") 17 | target_link_libraries(${SAMPLE_NAME} CUDA::cudart CUDA::cuda_driver) 18 | endif() -------------------------------------------------------------------------------- /third_party/json/include/nlohmann/detail/meta/identity_tag.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.11.2 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | NLOHMANN_JSON_NAMESPACE_BEGIN 14 | namespace detail 15 | { 16 | 17 | // dispatching helper struct 18 | template struct identity_tag {}; 19 | 20 | } // namespace detail 21 | NLOHMANN_JSON_NAMESPACE_END 22 | -------------------------------------------------------------------------------- /utils/hdr_histogram.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace DOCA { 4 | class Histogram { 5 | public: 6 | explicit Histogram(int64_t lowest, int64_t highest, int sigfigs, double scale = 1); 7 | 8 | explicit Histogram(int64_t lowest, int64_t highest, double scale = 1); 9 | 10 | ~Histogram(); 11 | 12 | void reset(); 13 | 14 | void print(FILE *stream, int32_t ticks); 15 | 16 | void print_csv(FILE *stream, int32_t ticks); 17 | 18 | void record(int64_t value, int64_t count = 0); 19 | 20 | private: 21 | hdr_histogram *latency_hist; 22 | double scale_value{1}; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /third_party/asio/include/asio/io_service_strand.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // io_service_strand.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_IO_SERVICE_STRAND_HPP 12 | #define ASIO_IO_SERVICE_STRAND_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/io_context_strand.hpp" 19 | 20 | #endif // ASIO_IO_SERVICE_STRAND_HPP 21 | -------------------------------------------------------------------------------- /test_suite/rdma_bench/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(RDMA_BENCH) 2 | 3 | set(SAMPLE_NAME rdma_send_bench) 4 | 5 | set(APP_ADDITIONAL_SOURCES ${CMAKE_SOURCE_DIR}/utils/proto/dma_connect.pb.cc) 6 | 7 | add_executable(${SAMPLE_NAME} ./main.cpp ./sender.cpp ./receiver.cpp ./rdma_bench.cpp ${UTILSOURCES} ${APP_ADDITIONAL_SOURCES}) 8 | 9 | ### discard not initialized field 10 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-field-initializers -Wno-old-style-cast") 11 | 12 | add_executable(rdma_recv_control ./receive_control.cpp ${UTILSOURCES} ${APP_ADDITIONAL_SOURCES}) 13 | 14 | target_link_libraries(${SAMPLE_NAME} ${LIBRARIES}) 15 | 16 | target_link_libraries(rdma_recv_control ${LIBRARIES}) -------------------------------------------------------------------------------- /flexio/dpa_send_mt/common/dpa_send_common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "common_cross.h" 4 | 5 | #define LOG_SQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 6 | #define LOG_RQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 7 | #define LOG_CQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 8 | 9 | #define LOG_WQ_DATA_ENTRY_BSIZE 10 /* WQ buffer logarithmic size */ 10 | 11 | __attribute__((unused)) static struct ether_addr DST_ADDR = { {0xA0, 0x88, 0xC2, 0x32, 0x04, 0x30} }; 12 | 13 | // bf2 mac addr 14 | __attribute__((unused)) static struct ether_addr SRC_ADDR = { {0x02, 0x01, 0x01, 0x01, 0x01, 0x01} }; 15 | 16 | __attribute__((unused)) static struct ether_addr DST_DPA_ADDR = { {0x01, 0x01, 0x01, 0x01, 0x01, 0x01} }; 17 | -------------------------------------------------------------------------------- /third_party/HdrHistogram/src/hdr_malloc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * hdr_malloc.h 3 | * Written by Filipe Oliveira and released to the public domain, 4 | * as explained at http://creativecommons.org/publicdomain/zero/1.0/ 5 | * 6 | * Allocator selection. 7 | * 8 | * This file is used in order to change the HdrHistogram allocator at compile time. 9 | * Just define the following defines to what you want to use. Also add 10 | * the include of your alternate allocator if needed (not needed in order 11 | * to use the default libc allocator). */ 12 | 13 | #ifndef HDR_MALLOC_H__ 14 | #define HDR_MALLOC_H__ 15 | #define hdr_malloc malloc 16 | #define hdr_calloc calloc 17 | #define hdr_realloc realloc 18 | #define hdr_free free 19 | #endif 20 | -------------------------------------------------------------------------------- /third_party/eRPC/src/util/numautils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | namespace erpc { 7 | 8 | /// Return the number of logical cores per NUMA node 9 | size_t num_lcores_per_numa_node(); 10 | 11 | /// Return a list of logical cores in \p numa_node 12 | std::vector get_lcores_for_numa_node(size_t numa_node); 13 | 14 | /// Bind this thread to the core with index numa_local_index on the socket = 15 | /// numa_node 16 | void bind_to_core(std::thread &thread, size_t numa_node, 17 | size_t numa_local_index); 18 | 19 | /// Reset this process's core mask to be all cores 20 | void clear_affinity_for_process(); 21 | 22 | } // namespace erpc 23 | -------------------------------------------------------------------------------- /third_party/json/include/nlohmann/detail/meta/void_t.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.11.2 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | NLOHMANN_JSON_NAMESPACE_BEGIN 14 | namespace detail 15 | { 16 | 17 | template struct make_void 18 | { 19 | using type = void; 20 | }; 21 | template using void_t = typename make_void::type; 22 | 23 | } // namespace detail 24 | NLOHMANN_JSON_NAMESPACE_END 25 | -------------------------------------------------------------------------------- /utils/log.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct doca_log_backend *app_logger = nullptr; 4 | struct doca_log_backend *sdk_logger = nullptr; 5 | static int __unused = []() { 6 | if (app_logger != nullptr || sdk_logger != nullptr) { 7 | return 0; 8 | } 9 | doca_error_t result = doca_log_backend_create_with_file(stdout, &app_logger); 10 | if (result != DOCA_SUCCESS) { 11 | return -1; 12 | } 13 | result = doca_log_backend_create_with_file_sdk(stderr, &sdk_logger); 14 | if (result != DOCA_SUCCESS) { 15 | return -1; 16 | } 17 | doca_log_backend_set_level_lower_limit(app_logger, DOCA_LOG_LEVEL_INFO); 18 | doca_log_backend_set_sdk_level(sdk_logger, DOCA_LOG_LEVEL_WARNING); 19 | return 0; 20 | }(); -------------------------------------------------------------------------------- /test_suite/regex_bench/main.cpp: -------------------------------------------------------------------------------- 1 | #include "regex_bench.h" 2 | #include "gflags_common.h" 3 | #include "utils_common.h" 4 | 5 | int main(int argc, char **argv) { 6 | 7 | doca_error_t result; 8 | /* Create a logger backend that prints to the standard output */ 9 | 10 | gflags::ParseCommandLineFlags(&argc, &argv, true); 11 | 12 | regex_config config; 13 | config.pci_address = FLAGS_g_pci_address; 14 | config.input_str = get_file_contents(FLAGS_input_path.c_str()); 15 | config.rule_str = get_file_contents(FLAGS_rule_path.c_str()); 16 | config.batch_size = FLAGS_g_batch_size; 17 | 18 | result = regex_bench(config); 19 | if (result != DOCA_SUCCESS) { 20 | return EXIT_FAILURE; 21 | } 22 | return EXIT_SUCCESS; 23 | } -------------------------------------------------------------------------------- /third_party/HdrHistogram/src/hdr_tests.h: -------------------------------------------------------------------------------- 1 | #ifndef HDR_TESTS_H 2 | #define HDR_TESTS_H 3 | 4 | /* These are functions used in tests and are not intended for normal usage. */ 5 | 6 | #include 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | int32_t counts_index_for(const struct hdr_histogram* h, int64_t value); 13 | int hdr_encode_compressed(struct hdr_histogram* h, uint8_t** compressed_histogram, size_t* compressed_len); 14 | int hdr_decode_compressed(uint8_t* buffer, size_t length, struct hdr_histogram** histogram); 15 | void hdr_base64_decode_block(const char* input, uint8_t* output); 16 | void hdr_base64_encode_block(const uint8_t* input, char* output); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /third_party/asio/include/asio/ts/buffer.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // ts/buffer.hpp 3 | // ~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_TS_BUFFER_HPP 12 | #define ASIO_TS_BUFFER_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/buffer.hpp" 19 | #include "asio/completion_condition.hpp" 20 | #include "asio/read.hpp" 21 | #include "asio/write.hpp" 22 | #include "asio/read_until.hpp" 23 | 24 | #endif // ASIO_TS_BUFFER_HPP 25 | -------------------------------------------------------------------------------- /third_party/asio/include/asio/buffered_stream_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // buffered_stream_fwd.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_BUFFERED_STREAM_FWD_HPP 12 | #define ASIO_BUFFERED_STREAM_FWD_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | namespace asio { 19 | 20 | template 21 | class buffered_stream; 22 | 23 | } // namespace asio 24 | 25 | #endif // ASIO_BUFFERED_STREAM_FWD_HPP 26 | -------------------------------------------------------------------------------- /third_party/asio/include/asio/version.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // version.hpp 3 | // ~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_VERSION_HPP 12 | #define ASIO_VERSION_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | // ASIO_VERSION % 100 is the sub-minor version 19 | // ASIO_VERSION / 100 % 1000 is the minor version 20 | // ASIO_VERSION / 100000 is the major version 21 | #define ASIO_VERSION 102800 // 1.28.0 22 | 23 | #endif // ASIO_VERSION_HPP 24 | -------------------------------------------------------------------------------- /third_party/eRPC/src/transport_impl/dpdk/dpdk_externs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file dpdk_externs.h 3 | * 4 | * @brief Externs for DPDK transport implementation. These globals are shared 5 | * among different DpdkTransport objects 6 | */ 7 | #pragma once 8 | 9 | #ifdef ERPC_DPDK 10 | 11 | #include "dpdk_transport.h" 12 | 13 | #include 14 | #include 15 | #include "common.h" 16 | 17 | namespace erpc { 18 | 19 | extern std::mutex g_dpdk_lock; 20 | extern bool g_dpdk_initialized; 21 | extern bool g_port_initialized[RTE_MAX_ETHPORTS]; 22 | 23 | /// If the DPDK management daemon exists, this is a pointer to the memzone 24 | /// created by the daemon. Else, it's a normal heap pointer. 25 | extern DpdkTransport::ownership_memzone_t *g_memzone; 26 | } // namespace erpc 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /test_suite/compress_bench/main.cpp: -------------------------------------------------------------------------------- 1 | #include "compress_bench.h" 2 | #include "gflags_common.h" 3 | 4 | DOCA_LOG_REGISTER(MAIN) 5 | 6 | int main(int argc, char **argv) 7 | { 8 | doca_error_t result; 9 | 10 | gflags::ParseCommandLineFlags(&argc, &argv, true); 11 | 12 | compress_config config; 13 | config.pci_address = FLAGS_g_pci_address; 14 | config.input_str = FLAGS_input_path.c_str(); 15 | config.batch_size = FLAGS_g_batch_size; 16 | 17 | result = compress_bench(config, false); 18 | if (result != DOCA_SUCCESS) 19 | { 20 | return EXIT_FAILURE; 21 | } 22 | 23 | // result = compress_bench(config, true); 24 | // if (result != DOCA_SUCCESS) { 25 | // return EXIT_FAILURE; 26 | // } 27 | 28 | return EXIT_SUCCESS; 29 | } -------------------------------------------------------------------------------- /third_party/asio/include/asio/buffered_read_stream_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // buffered_read_stream_fwd.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_BUFFERED_READ_STREAM_FWD_HPP 12 | #define ASIO_BUFFERED_READ_STREAM_FWD_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | namespace asio { 19 | 20 | template 21 | class buffered_read_stream; 22 | 23 | } // namespace asio 24 | 25 | #endif // ASIO_BUFFERED_READ_STREAM_FWD_HPP 26 | -------------------------------------------------------------------------------- /third_party/json/cmake/config.cmake.in: -------------------------------------------------------------------------------- 1 | include(FindPackageHandleStandardArgs) 2 | set(${CMAKE_FIND_PACKAGE_NAME}_CONFIG ${CMAKE_CURRENT_LIST_FILE}) 3 | find_package_handle_standard_args(@PROJECT_NAME@ CONFIG_MODE) 4 | 5 | if(NOT TARGET @PROJECT_NAME@::@NLOHMANN_JSON_TARGET_NAME@) 6 | include("${CMAKE_CURRENT_LIST_DIR}/@NLOHMANN_JSON_TARGETS_EXPORT_NAME@.cmake") 7 | if((NOT TARGET @NLOHMANN_JSON_TARGET_NAME@) AND 8 | (NOT @PROJECT_NAME@_FIND_VERSION OR 9 | @PROJECT_NAME@_FIND_VERSION VERSION_LESS 3.2.0)) 10 | add_library(@NLOHMANN_JSON_TARGET_NAME@ INTERFACE IMPORTED) 11 | set_target_properties(@NLOHMANN_JSON_TARGET_NAME@ PROPERTIES 12 | INTERFACE_LINK_LIBRARIES @PROJECT_NAME@::@NLOHMANN_JSON_TARGET_NAME@ 13 | ) 14 | endif() 15 | endif() 16 | -------------------------------------------------------------------------------- /third_party/asio/include/asio/buffered_write_stream_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // buffered_write_stream_fwd.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_BUFFERED_WRITE_STREAM_FWD_HPP 12 | #define ASIO_BUFFERED_WRITE_STREAM_FWD_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | namespace asio { 19 | 20 | template 21 | class buffered_write_stream; 22 | 23 | } // namespace asio 24 | 25 | #endif // ASIO_BUFFERED_WRITE_STREAM_FWD_HPP 26 | -------------------------------------------------------------------------------- /third_party/eRPC/src/util/barrier.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erpc { 4 | 5 | static void memory_barrier() { asm volatile("" ::: "memory"); } 6 | 7 | static void lfence() { asm volatile("lfence" ::: "memory"); } 8 | 9 | static void sfence() { asm volatile("sfence" ::: "memory"); } 10 | 11 | static void mfence() { asm volatile("mfence" ::: "memory"); } 12 | 13 | static void pause() { asm volatile("pause"); } 14 | 15 | static void clflush(volatile void* p) { asm volatile("clflush (%0)" ::"r"(p)); } 16 | 17 | static void cpuid(unsigned int* eax, unsigned int* ebx, unsigned int* ecx, 18 | unsigned int* edx) { 19 | asm volatile("cpuid" 20 | : "=a"(*eax), "=b"(*ebx), "=c"(*ecx), "=d"(*edx) 21 | : "0"(*eax), "2"(*ecx)); 22 | } 23 | 24 | } // namespace erpc 25 | -------------------------------------------------------------------------------- /third_party/asio/include/asio/ts/net.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // ts/net.hpp 3 | // ~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_TS_NET_HPP 12 | #define ASIO_TS_NET_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/ts/netfwd.hpp" 19 | #include "asio/ts/executor.hpp" 20 | #include "asio/ts/io_context.hpp" 21 | #include "asio/ts/timer.hpp" 22 | #include "asio/ts/buffer.hpp" 23 | #include "asio/ts/socket.hpp" 24 | #include "asio/ts/internet.hpp" 25 | 26 | #endif // ASIO_TS_NET_HPP 27 | -------------------------------------------------------------------------------- /third_party/asio/include/asio/ts/timer.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // ts/timer.hpp 3 | // ~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_TS_TIMER_HPP 12 | #define ASIO_TS_TIMER_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/chrono.hpp" 19 | 20 | #include "asio/wait_traits.hpp" 21 | #include "asio/basic_waitable_timer.hpp" 22 | #include "asio/system_timer.hpp" 23 | #include "asio/steady_timer.hpp" 24 | #include "asio/high_resolution_timer.hpp" 25 | 26 | #endif // ASIO_TS_TIMER_HPP 27 | -------------------------------------------------------------------------------- /third_party/eRPC/src/util/rand.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace erpc { 6 | 7 | class SlowRand { 8 | std::random_device rand_dev_; // Non-pseudorandom seed for twister 9 | std::mt19937_64 mt_; 10 | std::uniform_int_distribution dist_; 11 | 12 | public: 13 | SlowRand() : mt_(rand_dev_()), dist_(0, UINT64_MAX) {} 14 | 15 | inline uint64_t next_u64() { return dist_(mt_); } 16 | }; 17 | 18 | class FastRand { 19 | public: 20 | uint64_t seed_; 21 | 22 | /// Create a FastRand using a seed from SlowRand 23 | FastRand() { 24 | SlowRand slow_rand; 25 | seed_ = slow_rand.next_u64(); 26 | } 27 | 28 | inline uint32_t next_u32() { 29 | seed_ = seed_ * 1103515245 + 12345; 30 | return static_cast(seed_ >> 32); 31 | } 32 | }; 33 | 34 | } // namespace erpc 35 | -------------------------------------------------------------------------------- /flexio/dpa_send_mt/dpa_send_mt.h: -------------------------------------------------------------------------------- 1 | #include "wrapper_flexio.hpp" 2 | #include "common/dpa_send_common.h" 3 | #include "gflags_common.h" 4 | 5 | extern "C" 6 | { 7 | flexio_func_t dpa_send_mt_device_event_handler; 8 | flexio_func_t dpa_send_mt_device_init; 9 | flexio_func_t dpa_send_mt_deivce_first_packet; 10 | flexio_func_t dpa_send_mt_stop; 11 | extern struct flexio_app *dpa_send_mt_device; 12 | } 13 | 14 | #define TARGET_MAC 0x020101010101 15 | 16 | DECLARE_string(device_name); 17 | 18 | DECLARE_uint64(begin_thread); 19 | 20 | class dpa_send_mt_config { 21 | public: 22 | FLEX::CQ *rq_cq; 23 | FLEX::CQ *sq_cq; 24 | FLEX::SQ *sq; 25 | FLEX::RQ *rq; 26 | 27 | FLEX::dr_flow_rule *rx_flow_rule; 28 | 29 | FLEX::dr_flow_rule *tx_flow_root_rule; 30 | FLEX::dr_flow_rule *tx_flow_rule; 31 | }; 32 | -------------------------------------------------------------------------------- /utils/numautil.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace DOCA { 10 | 11 | /// Return the number of logical cores per NUMA node 12 | size_t num_lcores_per_numa_node(); 13 | 14 | /// Return a list of logical cores in \p numa_node 15 | std::vector get_lcores_for_numa_node(size_t numa_node); 16 | 17 | /// Bind this thread to the core with index numa_local_index on the socket = 18 | /// numa_node 19 | void bind_to_core(std::thread &thread, size_t numa_node, 20 | size_t numa_local_index); 21 | 22 | int get_2M_huagepages_free(size_t numa_node); 23 | 24 | int get_2M_huagepages_nr(size_t numa_node); 25 | 26 | void *get_huge_mem(uint32_t numa_node, size_t size); 27 | } -------------------------------------------------------------------------------- /third_party/asio/include/asio/signal_set.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // signal_set.hpp 3 | // ~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_SIGNAL_SET_HPP 12 | #define ASIO_SIGNAL_SET_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | #include "asio/basic_signal_set.hpp" 20 | 21 | namespace asio { 22 | 23 | /// Typedef for the typical usage of a signal set. 24 | typedef basic_signal_set<> signal_set; 25 | 26 | } // namespace asio 27 | 28 | #endif // ASIO_SIGNAL_SET_HPP 29 | -------------------------------------------------------------------------------- /third_party/eRPC/src/util/spin_lock_mutex.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | namespace erpc 4 | { 5 | class spin_lock_mutex final 6 | { 7 | private: 8 | std::atomic_flag flag = ATOMIC_FLAG_INIT; 9 | 10 | public: 11 | template 12 | void lock(WhileIdleFunc idle_work = [] {}) 13 | { 14 | while (flag.test_and_set(std::memory_order_acquire)) 15 | { 16 | idle_work(); 17 | } 18 | } 19 | 20 | void unlock() 21 | { 22 | flag.clear(std::memory_order_release); 23 | } 24 | 25 | spin_lock_mutex() = default; 26 | spin_lock_mutex(const spin_lock_mutex &) = delete; 27 | spin_lock_mutex &operator=(const spin_lock_mutex &) = delete; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /third_party/json/cmake/nlohmann_jsonConfigVersion.cmake.in: -------------------------------------------------------------------------------- 1 | # This is essentially cmake's BasicConfigVersion-SameMajorVersion.cmake.in but 2 | # without the 32/64-bit check. Since json is a header-only library, it doesn't 3 | # matter if it was built on a different platform than what it is used on (see 4 | # https://github.com/nlohmann/json/issues/1697). 5 | set(PACKAGE_VERSION "@PROJECT_VERSION@") 6 | 7 | if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) 8 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 9 | else() 10 | 11 | if(PACKAGE_FIND_VERSION_MAJOR STREQUAL "@PROJECT_VERSION_MAJOR@") 12 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 13 | else() 14 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 15 | endif() 16 | 17 | if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) 18 | set(PACKAGE_VERSION_EXACT TRUE) 19 | endif() 20 | endif() 21 | -------------------------------------------------------------------------------- /third_party/asio/include/asio/detail/limits.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/limits.hpp 3 | // ~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_LIMITS_HPP 12 | #define ASIO_DETAIL_LIMITS_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_BOOST_LIMITS) 21 | # include 22 | #else // defined(ASIO_HAS_BOOST_LIMITS) 23 | # include 24 | #endif // defined(ASIO_HAS_BOOST_LIMITS) 25 | 26 | #endif // ASIO_DETAIL_LIMITS_HPP 27 | -------------------------------------------------------------------------------- /flexio/dpa_network_function/dpa_network_function.h: -------------------------------------------------------------------------------- 1 | #include "wrapper_flexio.hpp" 2 | #include "common/dpa_network_function_common.h" 3 | #include "gflags_common.h" 4 | 5 | extern "C" 6 | { 7 | flexio_func_t dpa_network_function_device_event_handler; 8 | flexio_func_t dpa_network_function_device_init; 9 | extern struct flexio_app *dpa_network_function_device; 10 | } 11 | 12 | #define TARGET_MAC 0xa088c2320440 13 | // #define TARGET_MAC 0x010101010101 14 | 15 | DECLARE_string(device_name); 16 | 17 | DECLARE_uint64(begin_thread); 18 | 19 | class dpa_network_function_config { 20 | public: 21 | FLEX::CQ *rq_cq; 22 | FLEX::CQ *sq_cq; 23 | FLEX::SQ *sq; 24 | FLEX::RQ *rq; 25 | 26 | FLEX::dr_flow_rule *rx_flow_rule; 27 | 28 | FLEX::dr_flow_rule *tx_flow_root_rule; 29 | FLEX::dr_flow_rule *tx_flow_rule; 30 | }; 31 | -------------------------------------------------------------------------------- /test_suite/channel_bench/main.cpp: -------------------------------------------------------------------------------- 1 | #include "channel_bench.h" 2 | #include "gflags_common.h" 3 | 4 | int main(int argc, char **argv) { 5 | gflags::ParseCommandLineFlags(&argc, &argv, true); 6 | channel_config config; 7 | config.rep_pci_addrss = FLAGS_g_rep_pci_address; 8 | config.pci_address = FLAGS_g_pci_address; 9 | config.is_server = FLAGS_g_is_server; 10 | config.is_sender = FLAGS_g_is_exported; 11 | config.is_read = FLAGS_g_is_read; 12 | config.thread_count = FLAGS_g_thread_num; 13 | config.payload = FLAGS_g_payload; 14 | config.batch_size = FLAGS_g_batch_size; 15 | config.mmap_length = FLAGS_g_mmap_length; 16 | config.life_time = FLAGS_g_life_time; 17 | 18 | 19 | if (config.is_server) { 20 | bootstrap_server(config); 21 | } else { 22 | bootstrap_client(config); 23 | } 24 | } -------------------------------------------------------------------------------- /scripts/yelp_dataset/yelp_academic_handle.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | global_data = {} 4 | global_id = 0 5 | with open('C:\\Users\\ChenXuzheng\\Downloads\\yelp_dataset-2\\yelp_academic_dataset_review.json', 'r', encoding='utf-8') as json_file, open("yelp_academic_result_cool.txt","w",encoding='utf-8') as output_file: 6 | json_data = json_file.readline() 7 | while json_data is not None and json_data != "": 8 | json_obj = json.loads(json_data) 9 | now_id = 0 10 | if json_obj['user_id'] not in global_data: 11 | global_data[json_obj['user_id']] = global_id 12 | now_id = global_id 13 | global_id += 1 14 | else: 15 | now_id = global_data[json_obj['user_id']] 16 | output_file.write("{} {}\n".format(now_id, json_obj['cool'])) 17 | json_data = json_file.readline() 18 | 19 | -------------------------------------------------------------------------------- /test_suite/memory_bench/main.cpp: -------------------------------------------------------------------------------- 1 | #include "memory_bench.h" 2 | 3 | 4 | int main(int argc, char **argv) { 5 | gflags::ParseCommandLineFlags(&argc, &argv, true); 6 | 7 | element *data = nullptr; 8 | 9 | size_t memsize = sizeof(element) * FLAGS_elem * FLAGS_thread; 10 | assert(posix_memalign(reinterpret_cast(&data), 64, memsize) == 0); 11 | memset(data, 0x00, memsize); 12 | for (size_t i = 0; i < memsize / sizeof(element); i++) { 13 | data[i] = 0; 14 | } 15 | bw_list.resize(FLAGS_thread); 16 | 17 | 18 | auto runner = DOCA::bench_runner(FLAGS_thread); 19 | 20 | runner.run(benchmark_memory_ronly_loop, static_cast(data)); 21 | 22 | sleep(1); 23 | start_flag = true; 24 | 25 | runner.stop(); 26 | 27 | printf("Total sum %-15f MB/s\n", std::accumulate(bw_list.begin(), bw_list.end(), 0.0)); 28 | } -------------------------------------------------------------------------------- /flexio/dpa_send/common/dpa_send_common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "common_cross.h" 4 | 5 | #define LOG_SQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 6 | #define LOG_RQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 7 | #define LOG_CQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 8 | 9 | #define LOG_WQ_DATA_ENTRY_BSIZE 10 /* WQ buffer logarithmic size */ 10 | 11 | __attribute__((unused)) static struct ether_addr SRC_ADDR = { {0x02, 0x01, 0x01, 0x01, 0x01, 0x01} }; 12 | 13 | // host2 mac addr 14 | // __attribute__((unused)) static struct ether_addr DST_ADDR = { {0xa0, 0x88, 0xc2, 0x32, 0x04, 0x30} }; 15 | 16 | // bf2 bond0 mac addr 17 | // __attribute__((unused)) static struct ether_addr DST_ADDR = { {0xa0, 0x88, 0xc2, 0x32, 0x04, 0x40} }; 18 | 19 | // DPA (fake) mac addr 20 | __attribute__((unused)) static struct ether_addr DST_ADDR = { {0x01, 0x01, 0x01, 0x01, 0x01, 0x01} }; 21 | -------------------------------------------------------------------------------- /flexio/bench/timer/meson.build: -------------------------------------------------------------------------------- 1 | SAMPLE_NAME='bench_timer' 2 | 3 | device_source_file = ' '+dev_wrapper_srcs 4 | 5 | # Build device code ./build_flexio_device.sh 6 | dpa_code = custom_target('BENCH_TIMER', 7 | command : [device_builder, 8 | SAMPLE_NAME + '_device', 9 | device_source_file, 10 | meson.current_build_dir(), 11 | dev_inc_dir], 12 | output : SAMPLE_NAME + '_device.a') 13 | #The flexio_app variable in the code must be the same with the above SAMPLE_NAME+'_device' 14 | dpa_dependency = static_library(SAMPLE_NAME + '_device', link_with : dpa_code) 15 | 16 | 17 | #Build host code 18 | 19 | srcs = [ 20 | SAMPLE_NAME + '.cpp', 21 | wrapper_srcs, 22 | ] 23 | 24 | executable(SAMPLE_NAME, 25 | srcs, 26 | link_with: [dpa_dependency], 27 | dependencies: sample_dependencies, 28 | include_directories: [top_inc,util_dir], 29 | ) -------------------------------------------------------------------------------- /flexio/dpa_send_ntp/common/dpa_send_ntp_common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "common_cross.h" 4 | 5 | #define LOG_SQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 6 | #define LOG_RQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 7 | #define LOG_CQ_RING_DEPTH 7 /* 2^7 entries, max is 2^15 */ 8 | 9 | #define LOG_WQ_DATA_ENTRY_BSIZE 10 /* WQ buffer logarithmic size */ 10 | 11 | __attribute__((unused)) static struct ether_addr SRC_ADDR = { {0x02, 0x01, 0x01, 0x01, 0x01, 0x01} }; 12 | 13 | // host2 mac addr 14 | // __attribute__((unused)) static struct ether_addr DST_ADDR = { {0xa0, 0x88, 0xc2, 0x32, 0x04, 0x30} }; 15 | 16 | // bf2 bond0 mac addr 17 | // __attribute__((unused)) static struct ether_addr DST_ADDR = { {0xa0, 0x88, 0xc2, 0x32, 0x04, 0x40} }; 18 | 19 | // DPA (fake) mac addr 20 | __attribute__((unused)) static struct ether_addr DST_ADDR = { {0x01, 0x01, 0x01, 0x01, 0x01, 0x01} }; 21 | -------------------------------------------------------------------------------- /flexio/dpa_kv_aggregation/dpa_kv_aggregation.h: -------------------------------------------------------------------------------- 1 | #include "wrapper_flexio.hpp" 2 | #include "common/dpa_kv_aggregation_common.h" 3 | #include "gflags_common.h" 4 | 5 | extern "C" 6 | { 7 | flexio_func_t dpa_kv_aggregation_device_event_handler; 8 | flexio_func_t dpa_kv_aggregation_device_init; 9 | flexio_func_t dpa_kv_aggregation_device_stop_time; 10 | extern struct flexio_app *dpa_kv_aggregation_device; 11 | } 12 | 13 | // #define TARGET_MAC 0xa088c2320440 14 | #define TARGET_MAC 0x010101010101 15 | 16 | DECLARE_string(device_name); 17 | 18 | DECLARE_uint64(begin_thread); 19 | 20 | class dpa_kv_aggregation_config { 21 | public: 22 | FLEX::CQ *rq_cq; 23 | FLEX::CQ *sq_cq; 24 | FLEX::SQ *sq; 25 | FLEX::RQ *rq; 26 | 27 | FLEX::dr_flow_rule *rx_flow_rule; 28 | 29 | FLEX::dr_flow_rule *tx_flow_root_rule; 30 | FLEX::dr_flow_rule *tx_flow_rule; 31 | }; 32 | -------------------------------------------------------------------------------- /third_party/HdrHistogram/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (HDR_LOG_ENABLED) 2 | add_executable(hdr_decoder 3 | hdr_decoder.c) 4 | target_link_libraries(hdr_decoder 5 | PRIVATE 6 | $<$:hdr_histogram_static> 7 | $<$>:hdr_histogram>) 8 | install( 9 | TARGETS hdr_decoder 10 | EXPORT ${PROJECT_NAME}-targets 11 | DESTINATION ${CMAKE_INSTALL_BINDIR}) 12 | 13 | if(CMAKE_SYSTEM_NAME MATCHES "Linux") 14 | find_package(Threads) 15 | 16 | add_executable(hiccup 17 | hiccup.c) 18 | target_link_libraries(hiccup 19 | PRIVATE 20 | hdr_histogram 21 | Threads::Threads) 22 | install( 23 | TARGETS hiccup 24 | EXPORT ${PROJECT_NAME}-targets 25 | DESTINATION ${CMAKE_INSTALL_BINDIR}) 26 | endif() 27 | endif() -------------------------------------------------------------------------------- /third_party/asio/include/asio/detail/cstddef.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/cstddef.hpp 3 | // ~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_CSTDDEF_HPP 12 | #define ASIO_DETAIL_CSTDDEF_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | #include 20 | 21 | namespace asio { 22 | 23 | #if defined(ASIO_HAS_NULLPTR) 24 | using std::nullptr_t; 25 | #else // defined(ASIO_HAS_NULLPTR) 26 | struct nullptr_t {}; 27 | #endif // defined(ASIO_HAS_NULLPTR) 28 | 29 | } // namespace asio 30 | 31 | #endif // ASIO_DETAIL_CSTDDEF_HPP 32 | -------------------------------------------------------------------------------- /third_party/asio/include/asio/static_thread_pool.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // static_thread_pool.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_STATIC_THREAD_POOL_HPP 12 | #define ASIO_STATIC_THREAD_POOL_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | #include "asio/thread_pool.hpp" 20 | 21 | #include "asio/detail/push_options.hpp" 22 | 23 | namespace asio { 24 | 25 | typedef thread_pool static_thread_pool; 26 | 27 | } // namespace asio 28 | 29 | #include "asio/detail/pop_options.hpp" 30 | 31 | #endif // ASIO_STATIC_THREAD_POOL_HPP 32 | -------------------------------------------------------------------------------- /third_party/asio/include/asio/ssl.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // ssl.hpp 3 | // ~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_SSL_HPP 12 | #define ASIO_SSL_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/ssl/context.hpp" 19 | #include "asio/ssl/context_base.hpp" 20 | #include "asio/ssl/error.hpp" 21 | #include "asio/ssl/rfc2818_verification.hpp" 22 | #include "asio/ssl/host_name_verification.hpp" 23 | #include "asio/ssl/stream.hpp" 24 | #include "asio/ssl/stream_base.hpp" 25 | #include "asio/ssl/verify_context.hpp" 26 | #include "asio/ssl/verify_mode.hpp" 27 | 28 | #endif // ASIO_SSL_HPP 29 | -------------------------------------------------------------------------------- /third_party/asio/include/asio/streambuf.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // streambuf.hpp 3 | // ~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_STREAMBUF_HPP 12 | #define ASIO_STREAMBUF_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if !defined(ASIO_NO_IOSTREAM) 21 | 22 | #include "asio/basic_streambuf.hpp" 23 | 24 | namespace asio { 25 | 26 | /// Typedef for the typical usage of basic_streambuf. 27 | typedef basic_streambuf<> streambuf; 28 | 29 | } // namespace asio 30 | 31 | #endif // !defined(ASIO_NO_IOSTREAM) 32 | 33 | #endif // ASIO_STREAMBUF_HPP 34 | -------------------------------------------------------------------------------- /third_party/asio/include/asio/ts/socket.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // ts/socket.hpp 3 | // ~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_TS_SOCKET_HPP 12 | #define ASIO_TS_SOCKET_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/socket_base.hpp" 19 | #include "asio/basic_socket.hpp" 20 | #include "asio/basic_datagram_socket.hpp" 21 | #include "asio/basic_stream_socket.hpp" 22 | #include "asio/basic_socket_acceptor.hpp" 23 | #include "asio/basic_socket_streambuf.hpp" 24 | #include "asio/basic_socket_iostream.hpp" 25 | #include "asio/connect.hpp" 26 | 27 | #endif // ASIO_TS_SOCKET_HPP 28 | -------------------------------------------------------------------------------- /flexio/dpa_small_bank/dpa_small_bank_server.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "gflags_common.h" 4 | #include "wrapper_flexio.hpp" 5 | #include "common/dpa_small_bank_common.h" 6 | 7 | DEFINE_uint64(concurrency, 0, "Concurrency for each request, 1 means sync methods, >1 means async methods"); 8 | 9 | DEFINE_string(device_name, "", "device name for select ib device"); 10 | 11 | extern "C" 12 | { 13 | flexio_func_t dpa_small_bank_server_device_init; 14 | flexio_func_t dpa_small_bank_server_device_event_handler; 15 | extern struct flexio_app *dpa_small_bank_server_device; 16 | } 17 | 18 | #define TARGET_MAC 0x010101010101 19 | 20 | class dpa_small_bank_server_config { 21 | public: 22 | FLEX::CQ *rq_cq; 23 | FLEX::CQ *sq_cq; 24 | FLEX::SQ *sq; 25 | FLEX::RQ *rq; 26 | 27 | FLEX::dr_flow_rule *rx_flow_rule; 28 | 29 | FLEX::dr_flow_rule *tx_flow_root_rule; 30 | FLEX::dr_flow_rule *tx_flow_rule; 31 | }; 32 | -------------------------------------------------------------------------------- /third_party/eRPC/src/rpc_impl/rpc_fault_inject.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * @file rpc_fault_inject.cc 3 | * @brief Functions to allow users to inject faults into eRPC 4 | */ 5 | #include "rpc.h" 6 | 7 | namespace erpc { 8 | 9 | template 10 | void Rpc::fault_inject_check_ok() const { 11 | rt_assert(kTesting, "Faults disabled"); 12 | rt_assert(in_dispatch(), "Non-creator threads can't inject faults."); 13 | } 14 | 15 | template 16 | void Rpc::fault_inject_fail_resolve_rinfo_st() { 17 | fault_inject_check_ok(); 18 | faults_.fail_resolve_rinfo_ = true; 19 | } 20 | 21 | template 22 | void Rpc::fault_inject_set_pkt_drop_prob_st(double p) { 23 | fault_inject_check_ok(); 24 | assert(p == 0.0 || (p >= 1.0 / 1000000000 && p < .95)); 25 | faults_.pkt_drop_prob_ = p; 26 | faults_.pkt_drop_thresh_billion_ = p * 1000000000; 27 | } 28 | 29 | FORCE_COMPILE_TRANSPORTS 30 | 31 | } // namespace erpc 32 | -------------------------------------------------------------------------------- /third_party/json/include/nlohmann/detail/meta/std_fs.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.11.2 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | #if JSON_HAS_EXPERIMENTAL_FILESYSTEM 14 | #include 15 | NLOHMANN_JSON_NAMESPACE_BEGIN 16 | namespace detail 17 | { 18 | namespace std_fs = std::experimental::filesystem; 19 | } // namespace detail 20 | NLOHMANN_JSON_NAMESPACE_END 21 | #elif JSON_HAS_FILESYSTEM 22 | #include 23 | NLOHMANN_JSON_NAMESPACE_BEGIN 24 | namespace detail 25 | { 26 | namespace std_fs = std::filesystem; 27 | } // namespace detail 28 | NLOHMANN_JSON_NAMESPACE_END 29 | #endif 30 | -------------------------------------------------------------------------------- /third_party/HdrHistogram/cmake/JoinPaths.cmake: -------------------------------------------------------------------------------- 1 | # This module provides function for joining paths 2 | # known from most languages 3 | # 4 | # SPDX-License-Identifier: (MIT OR CC0-1.0) 5 | # Copyright 2020 Jan Tojnar 6 | # https://github.com/jtojnar/cmake-snips 7 | # 8 | # Modelled after Python’s os.path.join 9 | # https://docs.python.org/3.7/library/os.path.html#os.path.join 10 | # Windows not supported 11 | function(join_paths joined_path first_path_segment) 12 | set(temp_path "${first_path_segment}") 13 | foreach(current_segment IN LISTS ARGN) 14 | if(NOT ("${current_segment}" STREQUAL "")) 15 | if(IS_ABSOLUTE "${current_segment}") 16 | set(temp_path "${current_segment}") 17 | else() 18 | set(temp_path "${temp_path}/${current_segment}") 19 | endif() 20 | endif() 21 | endforeach() 22 | set(${joined_path} "${temp_path}" PARENT_SCOPE) 23 | endfunction() 24 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nvcr.io/nvidia/doca/doca:2.7.0-devel 2 | 3 | # RUN sed -i 's/ports.ubuntu.com/mirrors.zju.edu.cn/g' /etc/apt/sources.list 4 | 5 | # Install SSH server 6 | RUN apt-get update && \ 7 | DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends openssh-server unzip libgflags-dev libz-dev liblz4-dev && \ 8 | rm -rf /var/lib/apt/lists/* 9 | 10 | 11 | RUN echo 'root:cxz123' | chpasswd 12 | 13 | RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v3.20.3/protobuf-cpp-3.20.3.zip && unzip protobuf-cpp-3.20.3.zip && cd protobuf-3.20.3 && ./configure && make -j&& make install && ldconfig 14 | 15 | # Configure SSH server 16 | RUN mkdir /var/run/sshd && \ 17 | sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \ 18 | sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config 19 | 20 | 21 | EXPOSE 22 22 | CMD ["/usr/sbin/sshd", "-D"] -------------------------------------------------------------------------------- /flexio/dpa_refactor_mt/dpa_refactor_mt.h: -------------------------------------------------------------------------------- 1 | #include "wrapper_flexio.hpp" 2 | #include "common/dpa_refactor_common.h" 3 | #include "gflags_common.h" 4 | 5 | extern "C" 6 | { 7 | flexio_func_t dpa_refactor_mt_device_event_handler; 8 | flexio_func_t dpa_refactor_mt_device_init; 9 | extern struct flexio_app *dpa_refactor_mt_device; 10 | } 11 | 12 | // port bf_1 bond_0 mac 13 | // #define TARGET_MAC 0xa088c2320440 14 | 15 | // port host_1 ens21f0np0 mac 16 | // #define TARGET_MAC 0xa088c2320430 17 | 18 | // test for dst mac 19 | #define TARGET_MAC 0x010101010101 20 | 21 | DECLARE_string(device_name); 22 | 23 | DECLARE_uint64(begin_thread); 24 | 25 | class dpa_refactor_mt_config { 26 | public: 27 | FLEX::CQ *rq_cq; 28 | FLEX::CQ *sq_cq; 29 | FLEX::SQ *sq; 30 | FLEX::RQ *rq; 31 | 32 | FLEX::dr_flow_rule *rx_flow_rule; 33 | 34 | FLEX::dr_flow_rule *tx_flow_root_rule; 35 | FLEX::dr_flow_rule *tx_flow_rule; 36 | }; 37 | -------------------------------------------------------------------------------- /flexio/dpa_send/dpa_send.h: -------------------------------------------------------------------------------- 1 | #include "wrapper_flexio.hpp" 2 | #include "common/dpa_send_common.h" 3 | #include "gflags_common.h" 4 | 5 | extern "C" 6 | { 7 | flexio_func_t dpa_send_device_event_handler; 8 | flexio_func_t dpa_send_device_init; 9 | flexio_func_t dpa_send_deivce_first_packet; 10 | extern struct flexio_app *dpa_send_device; 11 | } 12 | 13 | DECLARE_string(device_name); 14 | 15 | class dpa_send_config { 16 | public: 17 | std::string device_name; 18 | FLEX::Context *ctx; 19 | 20 | FLEX::CQ *rq_cq; 21 | FLEX::CQ *sq_cq; 22 | FLEX::SQ *sq; 23 | FLEX::RQ *rq; 24 | 25 | FLEX::DR *rx_dr; 26 | FLEX::DR *tx_dr; 27 | 28 | FLEX::dr_flow_table *rx_flow_table; 29 | FLEX::dr_flow_rule *rx_flow_rule; 30 | 31 | FLEX::dr_flow_table *tx_flow_root_table; 32 | FLEX::dr_flow_rule *tx_flow_root_rule; 33 | FLEX::dr_flow_table *tx_flow_table; 34 | FLEX::dr_flow_rule *tx_flow_rule; 35 | }; 36 | -------------------------------------------------------------------------------- /third_party/asio/include/asio/io_service.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // io_service.hpp 3 | // ~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_IO_SERVICE_HPP 12 | #define ASIO_IO_SERVICE_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/io_context.hpp" 19 | 20 | #include "asio/detail/push_options.hpp" 21 | 22 | namespace asio { 23 | 24 | #if !defined(ASIO_NO_DEPRECATED) 25 | /// Typedef for backwards compatibility. 26 | typedef io_context io_service; 27 | #endif // !defined(ASIO_NO_DEPRECATED) 28 | 29 | } // namespace asio 30 | 31 | #include "asio/detail/pop_options.hpp" 32 | 33 | #endif // ASIO_IO_SERVICE_HPP 34 | -------------------------------------------------------------------------------- /third_party/asio/include/asio/detail/date_time_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/date_time_fwd.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_DATE_TIME_FWD_HPP 12 | #define ASIO_DETAIL_DATE_TIME_FWD_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | namespace boost { 21 | namespace date_time { 22 | 23 | template 24 | class base_time; 25 | 26 | } // namespace date_time 27 | namespace posix_time { 28 | 29 | class ptime; 30 | 31 | } // namespace posix_time 32 | } // namespace boost 33 | 34 | #endif // ASIO_DETAIL_DATE_TIME_FWD_HPP 35 | -------------------------------------------------------------------------------- /third_party/asio/include/asio/ssl/impl/src.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // impl/ssl/src.hpp 3 | // ~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_SSL_IMPL_SRC_HPP 12 | #define ASIO_SSL_IMPL_SRC_HPP 13 | 14 | #define ASIO_SOURCE 15 | 16 | #include "asio/detail/config.hpp" 17 | 18 | #if defined(ASIO_HEADER_ONLY) 19 | # error Do not compile Asio library source with ASIO_HEADER_ONLY defined 20 | #endif 21 | 22 | #include "asio/ssl/impl/context.ipp" 23 | #include "asio/ssl/impl/error.ipp" 24 | #include "asio/ssl/detail/impl/engine.ipp" 25 | #include "asio/ssl/detail/impl/openssl_init.ipp" 26 | #include "asio/ssl/impl/host_name_verification.ipp" 27 | #include "asio/ssl/impl/rfc2818_verification.ipp" 28 | 29 | #endif // ASIO_SSL_IMPL_SRC_HPP 30 | -------------------------------------------------------------------------------- /flexio/dpa_send_ntp/dpa_send_ntp.h: -------------------------------------------------------------------------------- 1 | #include "wrapper_flexio.hpp" 2 | #include "common/dpa_send_ntp_common.h" 3 | #include "gflags_common.h" 4 | 5 | extern "C" 6 | { 7 | flexio_func_t dpa_send_ntp_device_event_handler; 8 | flexio_func_t dpa_send_ntp_device_init; 9 | flexio_func_t dpa_send_ntp_deivce_first_packet; 10 | extern struct flexio_app *dpa_send_ntp_device; 11 | } 12 | 13 | DECLARE_string(device_name); 14 | 15 | class dpa_send_ntp_config { 16 | public: 17 | std::string device_name; 18 | FLEX::Context *ctx; 19 | 20 | FLEX::CQ *rq_cq; 21 | FLEX::CQ *sq_cq; 22 | FLEX::SQ *sq; 23 | FLEX::RQ *rq; 24 | 25 | FLEX::DR *rx_dr; 26 | FLEX::DR *tx_dr; 27 | 28 | FLEX::dr_flow_table *rx_flow_table; 29 | FLEX::dr_flow_rule *rx_flow_rule; 30 | 31 | FLEX::dr_flow_table *tx_flow_root_table; 32 | FLEX::dr_flow_rule *tx_flow_root_rule; 33 | FLEX::dr_flow_table *tx_flow_table; 34 | FLEX::dr_flow_rule *tx_flow_rule; 35 | }; 36 | -------------------------------------------------------------------------------- /third_party/asio/include/asio/impl/system_context.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // impl/system_context.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_IMPL_SYSTEM_CONTEXT_HPP 12 | #define ASIO_IMPL_SYSTEM_CONTEXT_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/system_executor.hpp" 19 | 20 | #include "asio/detail/push_options.hpp" 21 | 22 | namespace asio { 23 | 24 | inline system_context::executor_type 25 | system_context::get_executor() ASIO_NOEXCEPT 26 | { 27 | return system_executor(); 28 | } 29 | 30 | } // namespace asio 31 | 32 | #include "asio/detail/pop_options.hpp" 33 | 34 | #endif // ASIO_IMPL_SYSTEM_CONTEXT_HPP 35 | -------------------------------------------------------------------------------- /wrapper/wrapper_pcc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "wrapper_interface.h" 4 | #include "wrapper_device.h" 5 | 6 | namespace DOCA { 7 | 8 | class pcc : public Base<::doca_pcc> { 9 | public: 10 | explicit pcc(dev *dev); 11 | 12 | ~pcc() noexcept(false) override; 13 | 14 | // return min_num_threads and max_num_threads 15 | std::pair get_num_threads(); 16 | 17 | void set_app(doca_pcc_app *app); 18 | 19 | void set_thread_affinity(uint32_t num_threads, uint32_t *affinity_configs); 20 | 21 | void start(); 22 | 23 | void stop(); 24 | 25 | doca_error_t wait(int wait_time); 26 | 27 | doca_pcc_process_state_t get_process_state(); 28 | 29 | inline ::doca_pcc *get_inner_ptr() override { 30 | return inner_pcc; 31 | } 32 | 33 | [[nodiscard]] std::string get_type_name() const override; 34 | 35 | private: 36 | ::doca_pcc *inner_pcc{}; 37 | }; 38 | } -------------------------------------------------------------------------------- /flexio/bench/memory/bench_cache_no_dpa.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "bench_cache_cross.h" 8 | 9 | int main(int argc, char **argv) 10 | { 11 | 12 | struct element *data; 13 | long *sizes; 14 | long *times, *bws; 15 | 16 | assert(sizes = (long *)malloc(timeslots * sizeof(long))); 17 | memset(sizes, 0x00, (timeslots * sizeof(long))); 18 | assert(times = (long *)malloc(timeslots * sizeof(long))); 19 | memset(times, 0x00, (timeslots * sizeof(long))); 20 | assert(bws = (long *)malloc(timeslots * sizeof(long))); 21 | memset(bws, 0x00, (timeslots * sizeof(long))); 22 | 23 | assert(data = (struct element *)malloc(memsize)); 24 | memset(data, 0x00, memsize); 25 | 26 | initialize_sizes(sizes); 27 | 28 | std::thread t = std::thread(do_read_only, sizes, data, times, bws); 29 | DOCA::bind_to_core(t, 0, 1); 30 | t.join(); 31 | } -------------------------------------------------------------------------------- /third_party/asio/include/asio/associator.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // associator.hpp 3 | // ~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_ASSOCIATOR_HPP 12 | #define ASIO_ASSOCIATOR_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #include "asio/detail/push_options.hpp" 21 | 22 | namespace asio { 23 | 24 | /// Used to generically specialise associators for a type. 25 | template