mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-14 06:10:40 +01:00

CRC32c is used in SCTP for integrity checking, and the third_party/crc32c library (https://github.com/google/crc32c) which has been optimized for SSE42 and arm64 and has a much faster fallback implementation for other architectures. Running ./out/Release/dcsctp_benchmark Run on (12 X 4500 MHz CPU s) CPU Caches: L1 Data 32 KiB (x6) L1 Instruction 32 KiB (x6) L2 Unified 1024 KiB (x6) L3 Unified 8448 KiB (x1) Load Average: 11.01, 17.53, 17.11 ------------------------------------------------------------------------------ Benchmark Time CPU Iterations UserCounters... ------------------------------------------------------------------------------ BM_PumpData/1 676 ns 676 ns 1034087 bytes_per_second=1.41063M/s items_per_second=1.47916M/s BM_PumpData/8 671 ns 671 ns 1041809 bytes_per_second=11.3643M/s items_per_second=1.48955M/s BM_PumpData/128 725 ns 725 ns 967170 bytes_per_second=168.398M/s items_per_second=1.37952M/s BM_PumpData/512 800 ns 800 ns 873854 bytes_per_second=610.125M/s items_per_second=1.24954M/s BM_PumpData/1024 911 ns 911 ns 775785 bytes_per_second=1072.2M/s items_per_second=1097.93k/s BM_PumpData/2048 1988 ns 1988 ns 352444 bytes_per_second=982.409M/s items_per_second=502.993k/s BM_PumpData/4096 3893 ns 3893 ns 179999 bytes_per_second=1003.31M/s items_per_second=256.848k/s BM_PumpData/8192 7477 ns 7477 ns 92790 bytes_per_second=1044.88M/s items_per_second=133.745k/s BM_PumpData/65536 97156 ns 97153 ns 7089 bytes_per_second=643.318M/s items_per_second=10.2931k/s BM_EchoServer/1 634 ns 634 ns 1130860 bytes_per_second=1.50512M/s items_per_second=1.57823M/s BM_EchoServer/8 614 ns 614 ns 1136372 bytes_per_second=12.4286M/s items_per_second=1.62904M/s BM_EchoServer/128 644 ns 644 ns 1073464 bytes_per_second=189.618M/s items_per_second=1.55335M/s BM_EchoServer/512 734 ns 734 ns 949487 bytes_per_second=665.181M/s items_per_second=1.36229M/s BM_EchoServer/1024 836 ns 836 ns 838010 bytes_per_second=1.14046G/s items_per_second=1.19586M/s BM_EchoServer/2048 1939 ns 1939 ns 345067 bytes_per_second=1007.27M/s items_per_second=515.724k/s BM_EchoServer/4096 3984 ns 3983 ns 176047 bytes_per_second=980.737M/s items_per_second=251.069k/s BM_EchoServer/8192 7486 ns 7484 ns 95780 bytes_per_second=1043.85M/s items_per_second=133.613k/s BM_EchoServer/65536 92360 ns 92346 ns 7821 bytes_per_second=676.805M/s items_per_second=10.8289k/s No-Presubmit: True Bug: webrtc:12614 Change-Id: Iff21035ee78b263ee0e4b0fe3d07eea24064b921 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215002 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Victor Costan <pwnall@chromium.org> Reviewed-by: Florent Castelli <orphis@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33842}
318 lines
9.7 KiB
Text
318 lines
9.7 KiB
Text
# Copyright (c) 2021 The WebRTC project authors. All Rights Reserved.
|
|
#
|
|
# Use of this source code is governed by a BSD-style license
|
|
# that can be found in the LICENSE file in the root of the source
|
|
# tree. An additional intellectual property rights grant can be found
|
|
# in the file PATENTS. All contributing project authors may
|
|
# be found in the AUTHORS file in the root of the source tree.
|
|
|
|
import("../../../webrtc.gni")
|
|
|
|
group("packet") {
|
|
deps = [ ":bounded_io" ]
|
|
}
|
|
|
|
rtc_source_set("bounded_io") {
|
|
deps = [
|
|
"../../../api:array_view",
|
|
"../../../rtc_base",
|
|
"../../../rtc_base:checks",
|
|
"../../../rtc_base:rtc_base_approved",
|
|
]
|
|
sources = [
|
|
"bounded_byte_reader.h",
|
|
"bounded_byte_writer.h",
|
|
]
|
|
}
|
|
|
|
rtc_library("tlv_trait") {
|
|
deps = [
|
|
":bounded_io",
|
|
"../../../api:array_view",
|
|
"../../../rtc_base",
|
|
"../../../rtc_base:checks",
|
|
"../../../rtc_base:rtc_base_approved",
|
|
]
|
|
absl_deps = [ "//third_party/abseil-cpp/absl/strings:strings" ]
|
|
sources = [
|
|
"tlv_trait.cc",
|
|
"tlv_trait.h",
|
|
]
|
|
}
|
|
|
|
rtc_source_set("data") {
|
|
deps = [
|
|
"../../../rtc_base",
|
|
"../../../rtc_base:checks",
|
|
"../../../rtc_base:rtc_base_approved",
|
|
"../common:internal_types",
|
|
"../public:types",
|
|
]
|
|
sources = [ "data.h" ]
|
|
}
|
|
|
|
rtc_library("crc32c") {
|
|
deps = [
|
|
"../../../api:array_view",
|
|
"../../../rtc_base",
|
|
"../../../rtc_base:checks",
|
|
"../../../rtc_base:rtc_base_approved",
|
|
"//third_party/crc32c",
|
|
]
|
|
sources = [
|
|
"crc32c.cc",
|
|
"crc32c.h",
|
|
]
|
|
}
|
|
|
|
rtc_library("parameter") {
|
|
deps = [
|
|
":bounded_io",
|
|
":data",
|
|
":tlv_trait",
|
|
"../../../api:array_view",
|
|
"../../../rtc_base",
|
|
"../../../rtc_base:checks",
|
|
"../../../rtc_base:rtc_base_approved",
|
|
"../common:internal_types",
|
|
"../common:math",
|
|
"../common:str_join",
|
|
"../public:types",
|
|
]
|
|
sources = [
|
|
"parameter/add_incoming_streams_request_parameter.cc",
|
|
"parameter/add_incoming_streams_request_parameter.h",
|
|
"parameter/add_outgoing_streams_request_parameter.cc",
|
|
"parameter/add_outgoing_streams_request_parameter.h",
|
|
"parameter/forward_tsn_supported_parameter.cc",
|
|
"parameter/forward_tsn_supported_parameter.h",
|
|
"parameter/heartbeat_info_parameter.cc",
|
|
"parameter/heartbeat_info_parameter.h",
|
|
"parameter/incoming_ssn_reset_request_parameter.cc",
|
|
"parameter/incoming_ssn_reset_request_parameter.h",
|
|
"parameter/outgoing_ssn_reset_request_parameter.cc",
|
|
"parameter/outgoing_ssn_reset_request_parameter.h",
|
|
"parameter/parameter.cc",
|
|
"parameter/parameter.h",
|
|
"parameter/reconfiguration_response_parameter.cc",
|
|
"parameter/reconfiguration_response_parameter.h",
|
|
"parameter/ssn_tsn_reset_request_parameter.cc",
|
|
"parameter/ssn_tsn_reset_request_parameter.h",
|
|
"parameter/state_cookie_parameter.cc",
|
|
"parameter/state_cookie_parameter.h",
|
|
"parameter/supported_extensions_parameter.cc",
|
|
"parameter/supported_extensions_parameter.h",
|
|
]
|
|
absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
|
|
}
|
|
|
|
rtc_library("error_cause") {
|
|
deps = [
|
|
":data",
|
|
":parameter",
|
|
":tlv_trait",
|
|
"../../../api:array_view",
|
|
"../../../rtc_base",
|
|
"../../../rtc_base:checks",
|
|
"../../../rtc_base:rtc_base_approved",
|
|
"../common:internal_types",
|
|
"../common:math",
|
|
"../common:str_join",
|
|
"../packet:bounded_io",
|
|
"../public:types",
|
|
]
|
|
sources = [
|
|
"error_cause/cookie_received_while_shutting_down_cause.cc",
|
|
"error_cause/cookie_received_while_shutting_down_cause.h",
|
|
"error_cause/error_cause.cc",
|
|
"error_cause/error_cause.h",
|
|
"error_cause/invalid_mandatory_parameter_cause.cc",
|
|
"error_cause/invalid_mandatory_parameter_cause.h",
|
|
"error_cause/invalid_stream_identifier_cause.cc",
|
|
"error_cause/invalid_stream_identifier_cause.h",
|
|
"error_cause/missing_mandatory_parameter_cause.cc",
|
|
"error_cause/missing_mandatory_parameter_cause.h",
|
|
"error_cause/no_user_data_cause.cc",
|
|
"error_cause/no_user_data_cause.h",
|
|
"error_cause/out_of_resource_error_cause.cc",
|
|
"error_cause/out_of_resource_error_cause.h",
|
|
"error_cause/protocol_violation_cause.cc",
|
|
"error_cause/protocol_violation_cause.h",
|
|
"error_cause/restart_of_an_association_with_new_address_cause.cc",
|
|
"error_cause/restart_of_an_association_with_new_address_cause.h",
|
|
"error_cause/stale_cookie_error_cause.cc",
|
|
"error_cause/stale_cookie_error_cause.h",
|
|
"error_cause/unrecognized_chunk_type_cause.cc",
|
|
"error_cause/unrecognized_chunk_type_cause.h",
|
|
"error_cause/unrecognized_parameter_cause.cc",
|
|
"error_cause/unrecognized_parameter_cause.h",
|
|
"error_cause/unresolvable_address_cause.cc",
|
|
"error_cause/unresolvable_address_cause.h",
|
|
"error_cause/user_initiated_abort_cause.cc",
|
|
"error_cause/user_initiated_abort_cause.h",
|
|
]
|
|
absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
|
|
}
|
|
|
|
rtc_library("chunk") {
|
|
deps = [
|
|
":data",
|
|
":error_cause",
|
|
":parameter",
|
|
":tlv_trait",
|
|
"../../../api:array_view",
|
|
"../../../rtc_base",
|
|
"../../../rtc_base:checks",
|
|
"../../../rtc_base:rtc_base_approved",
|
|
"../common:math",
|
|
"../common:str_join",
|
|
"../packet:bounded_io",
|
|
]
|
|
sources = [
|
|
"chunk/abort_chunk.cc",
|
|
"chunk/abort_chunk.h",
|
|
"chunk/chunk.cc",
|
|
"chunk/chunk.h",
|
|
"chunk/cookie_ack_chunk.cc",
|
|
"chunk/cookie_ack_chunk.h",
|
|
"chunk/cookie_echo_chunk.cc",
|
|
"chunk/cookie_echo_chunk.h",
|
|
"chunk/data_chunk.cc",
|
|
"chunk/data_chunk.h",
|
|
"chunk/data_common.h",
|
|
"chunk/error_chunk.cc",
|
|
"chunk/error_chunk.h",
|
|
"chunk/forward_tsn_chunk.cc",
|
|
"chunk/forward_tsn_chunk.h",
|
|
"chunk/forward_tsn_common.h",
|
|
"chunk/heartbeat_ack_chunk.cc",
|
|
"chunk/heartbeat_ack_chunk.h",
|
|
"chunk/heartbeat_request_chunk.cc",
|
|
"chunk/heartbeat_request_chunk.h",
|
|
"chunk/idata_chunk.cc",
|
|
"chunk/idata_chunk.h",
|
|
"chunk/iforward_tsn_chunk.cc",
|
|
"chunk/iforward_tsn_chunk.h",
|
|
"chunk/init_ack_chunk.cc",
|
|
"chunk/init_ack_chunk.h",
|
|
"chunk/init_chunk.cc",
|
|
"chunk/init_chunk.h",
|
|
"chunk/reconfig_chunk.cc",
|
|
"chunk/reconfig_chunk.h",
|
|
"chunk/sack_chunk.cc",
|
|
"chunk/sack_chunk.h",
|
|
"chunk/shutdown_ack_chunk.cc",
|
|
"chunk/shutdown_ack_chunk.h",
|
|
"chunk/shutdown_chunk.cc",
|
|
"chunk/shutdown_chunk.h",
|
|
"chunk/shutdown_complete_chunk.cc",
|
|
"chunk/shutdown_complete_chunk.h",
|
|
]
|
|
absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
|
|
}
|
|
|
|
rtc_library("chunk_validators") {
|
|
deps = [
|
|
":chunk",
|
|
"../../../rtc_base",
|
|
"../../../rtc_base:checks",
|
|
"../../../rtc_base:rtc_base_approved",
|
|
]
|
|
sources = [
|
|
"chunk_validators.cc",
|
|
"chunk_validators.h",
|
|
]
|
|
}
|
|
|
|
rtc_library("sctp_packet") {
|
|
deps = [
|
|
":bounded_io",
|
|
":chunk",
|
|
":crc32c",
|
|
"../../../api:array_view",
|
|
"../../../rtc_base",
|
|
"../../../rtc_base:checks",
|
|
"../../../rtc_base:rtc_base_approved",
|
|
"../common:internal_types",
|
|
"../common:math",
|
|
"../public:types",
|
|
]
|
|
sources = [
|
|
"sctp_packet.cc",
|
|
"sctp_packet.h",
|
|
]
|
|
absl_deps = [
|
|
"//third_party/abseil-cpp/absl/memory:memory",
|
|
"//third_party/abseil-cpp/absl/types:optional",
|
|
]
|
|
}
|
|
|
|
if (rtc_include_tests) {
|
|
rtc_library("dcsctp_packet_unittests") {
|
|
testonly = true
|
|
|
|
deps = [
|
|
":bounded_io",
|
|
":chunk",
|
|
":chunk_validators",
|
|
":crc32c",
|
|
":error_cause",
|
|
":parameter",
|
|
":sctp_packet",
|
|
":tlv_trait",
|
|
"../../../api:array_view",
|
|
"../../../rtc_base:checks",
|
|
"../../../rtc_base:gunit_helpers",
|
|
"../../../rtc_base:rtc_base_approved",
|
|
"../../../test:test_support",
|
|
]
|
|
sources = [
|
|
"bounded_byte_reader_test.cc",
|
|
"bounded_byte_writer_test.cc",
|
|
"chunk/abort_chunk_test.cc",
|
|
"chunk/cookie_ack_chunk_test.cc",
|
|
"chunk/cookie_echo_chunk_test.cc",
|
|
"chunk/data_chunk_test.cc",
|
|
"chunk/error_chunk_test.cc",
|
|
"chunk/forward_tsn_chunk_test.cc",
|
|
"chunk/heartbeat_ack_chunk_test.cc",
|
|
"chunk/heartbeat_request_chunk_test.cc",
|
|
"chunk/idata_chunk_test.cc",
|
|
"chunk/iforward_tsn_chunk_test.cc",
|
|
"chunk/init_ack_chunk_test.cc",
|
|
"chunk/init_chunk_test.cc",
|
|
"chunk/reconfig_chunk_test.cc",
|
|
"chunk/sack_chunk_test.cc",
|
|
"chunk/shutdown_ack_chunk_test.cc",
|
|
"chunk/shutdown_chunk_test.cc",
|
|
"chunk/shutdown_complete_chunk_test.cc",
|
|
"chunk_validators_test.cc",
|
|
"crc32c_test.cc",
|
|
"error_cause/cookie_received_while_shutting_down_cause_test.cc",
|
|
"error_cause/invalid_mandatory_parameter_cause_test.cc",
|
|
"error_cause/invalid_stream_identifier_cause_test.cc",
|
|
"error_cause/missing_mandatory_parameter_cause_test.cc",
|
|
"error_cause/no_user_data_cause_test.cc",
|
|
"error_cause/out_of_resource_error_cause_test.cc",
|
|
"error_cause/protocol_violation_cause_test.cc",
|
|
"error_cause/restart_of_an_association_with_new_address_cause_test.cc",
|
|
"error_cause/stale_cookie_error_cause_test.cc",
|
|
"error_cause/unrecognized_chunk_type_cause_test.cc",
|
|
"error_cause/unrecognized_parameter_cause_test.cc",
|
|
"error_cause/unresolvable_address_cause_test.cc",
|
|
"error_cause/user_initiated_abort_cause_test.cc",
|
|
"parameter/add_incoming_streams_request_parameter_test.cc",
|
|
"parameter/add_outgoing_streams_request_parameter_test.cc",
|
|
"parameter/forward_tsn_supported_parameter_test.cc",
|
|
"parameter/incoming_ssn_reset_request_parameter_test.cc",
|
|
"parameter/outgoing_ssn_reset_request_parameter_test.cc",
|
|
"parameter/parameter_test.cc",
|
|
"parameter/reconfiguration_response_parameter_test.cc",
|
|
"parameter/ssn_tsn_reset_request_parameter_test.cc",
|
|
"parameter/state_cookie_parameter_test.cc",
|
|
"parameter/supported_extensions_parameter_test.cc",
|
|
"sctp_packet_test.cc",
|
|
"tlv_trait_test.cc",
|
|
]
|
|
}
|
|
}
|