grpc 1.52.0 → 1.53.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Makefile +50 -5
- data/include/grpc/event_engine/event_engine.h +24 -2
- data/include/grpc/event_engine/slice_buffer.h +13 -1
- data/include/grpc/impl/grpc_types.h +3 -0
- data/include/grpc/support/time.h +6 -4
- data/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +148 -0
- data/src/core/ext/filters/backend_metrics/backend_metric_filter.h +52 -0
- data/src/core/ext/filters/backend_metrics/backend_metric_provider.h +29 -0
- data/src/core/ext/filters/channel_idle/channel_idle_filter.h +3 -3
- data/src/core/ext/filters/channel_idle/idle_filter_state.h +3 -3
- data/src/core/ext/filters/client_channel/backend_metric.h +3 -3
- data/src/core/ext/filters/client_channel/backup_poller.h +3 -3
- data/src/core/ext/filters/client_channel/channel_connectivity.cc +1 -1
- data/src/core/ext/filters/client_channel/client_channel.cc +29 -33
- data/src/core/ext/filters/client_channel/client_channel.h +3 -3
- data/src/core/ext/filters/client_channel/client_channel_channelz.h +3 -3
- data/src/core/ext/filters/client_channel/client_channel_factory.h +3 -3
- data/src/core/ext/filters/client_channel/client_channel_service_config.h +3 -3
- data/src/core/ext/filters/client_channel/config_selector.h +3 -3
- data/src/core/ext/filters/client_channel/connector.h +8 -4
- data/src/core/ext/filters/client_channel/dynamic_filters.h +3 -3
- data/src/core/ext/filters/client_channel/global_subchannel_pool.h +3 -3
- data/src/core/ext/filters/client_channel/health/health_check_client.h +3 -3
- data/src/core/ext/filters/client_channel/http_proxy.h +3 -3
- data/src/core/ext/filters/client_channel/lb_call_state_internal.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +14 -7
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +1 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc +1 -78
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric_internal.h +117 -0
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +1 -0
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/static_stride_scheduler.cc +128 -0
- data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/static_stride_scheduler.h +71 -0
- data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/weighted_round_robin.cc +972 -0
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +2 -2
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +3 -6
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_attributes.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +12 -7
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_override_host.cc +275 -107
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_override_host.h +10 -3
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_wrr_locality.cc +5 -0
- data/src/core/ext/filters/client_channel/local_subchannel_pool.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +6 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +1 -2
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +1 -0
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +3 -7
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h +3 -3
- data/src/core/ext/filters/client_channel/retry_filter.cc +10 -13
- data/src/core/ext/filters/client_channel/retry_filter.h +3 -3
- data/src/core/ext/filters/client_channel/retry_service_config.h +3 -3
- data/src/core/ext/filters/client_channel/retry_throttle.h +3 -3
- data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +4 -4
- data/src/core/ext/filters/client_channel/subchannel.cc +5 -1
- data/src/core/ext/filters/client_channel/subchannel.h +3 -3
- data/src/core/ext/filters/client_channel/subchannel_interface_internal.h +3 -3
- data/src/core/ext/filters/client_channel/subchannel_pool_interface.h +3 -3
- data/src/core/ext/filters/client_channel/subchannel_stream_client.h +3 -3
- data/src/core/ext/filters/deadline/deadline_filter.cc +40 -48
- data/src/core/ext/filters/deadline/deadline_filter.h +6 -10
- data/src/core/ext/filters/fault_injection/fault_injection_filter.h +3 -3
- data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.h +3 -3
- data/src/core/ext/filters/http/client/http_client_filter.cc +26 -21
- data/src/core/ext/filters/http/client/http_client_filter.h +3 -3
- data/src/core/ext/filters/http/client_authority_filter.h +3 -3
- data/src/core/ext/filters/http/message_compress/compression_filter.cc +109 -117
- data/src/core/ext/filters/http/message_compress/compression_filter.h +17 -10
- data/src/core/ext/filters/http/server/http_server_filter.cc +25 -24
- data/src/core/ext/filters/http/server/http_server_filter.h +3 -3
- data/src/core/ext/filters/message_size/message_size_filter.cc +2 -1
- data/src/core/ext/filters/message_size/message_size_filter.h +3 -3
- data/src/core/ext/filters/rbac/rbac_filter.cc +4 -3
- data/src/core/ext/filters/rbac/rbac_filter.h +3 -3
- data/src/core/ext/filters/rbac/rbac_service_config_parser.h +3 -3
- data/src/core/ext/filters/server_config_selector/server_config_selector.h +3 -3
- data/src/core/ext/filters/server_config_selector/server_config_selector_filter.h +3 -3
- data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +27 -37
- data/src/core/ext/filters/stateful_session/stateful_session_filter.h +5 -5
- data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h +3 -3
- data/src/core/ext/transport/chttp2/alpn/alpn.h +3 -3
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +2 -7
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +3 -3
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +1 -0
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +3 -3
- data/src/core/ext/transport/chttp2/transport/bin_decoder.h +3 -3
- data/src/core/ext/transport/chttp2/transport/bin_encoder.h +3 -3
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +195 -111
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +3 -3
- data/src/core/ext/transport/chttp2/transport/context_list.h +3 -3
- data/src/core/ext/transport/chttp2/transport/decode_huff.h +3 -3
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_data.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/frame_ping.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_window_update.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_constants.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +18 -407
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +3 -3
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +3 -3
- data/src/core/ext/transport/chttp2/transport/http_trace.h +3 -3
- data/src/core/ext/transport/chttp2/transport/huffsyms.h +3 -3
- data/src/core/ext/transport/chttp2/transport/internal.h +28 -23
- data/src/core/ext/transport/chttp2/transport/parsing.cc +111 -31
- data/src/core/ext/transport/chttp2/transport/stream_map.h +3 -3
- data/src/core/ext/transport/chttp2/transport/varint.h +3 -3
- data/src/core/ext/transport/chttp2/transport/writing.cc +9 -8
- data/src/core/ext/transport/inproc/inproc_transport.h +3 -3
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c +3 -2
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h +9 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.c +38 -2
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.h +185 -0
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +7 -3
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +44 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +16 -25
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +48 -74
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +30 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +137 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +15 -12
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +83 -51
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +3 -2
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +15 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +17 -2
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +61 -0
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +11 -5
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +37 -6
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +5 -3
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +24 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +5 -3
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +22 -0
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +6 -3
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +24 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +24 -5
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +50 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +57 -16
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +254 -17
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c +3 -2
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h +9 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.c +3 -2
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.h +9 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c +7 -6
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h +21 -12
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +6 -3
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +23 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +10 -7
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +42 -12
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.c +54 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h +188 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.c +111 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +444 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.c +7 -3
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +24 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +8 -6
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +31 -9
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +5 -3
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +24 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.c +47 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.h +113 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.c +43 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.h +114 -0
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h +3 -1
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c +54 -53
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.c +34 -13
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +195 -187
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +232 -224
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +0 -5
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c +95 -75
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +94 -93
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +81 -75
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +189 -187
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c +7 -3
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +71 -66
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +137 -133
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c +16 -12
- data/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c +140 -133
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +81 -70
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +771 -741
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c +16 -14
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opentelemetry.upbdefs.c +14 -13
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c +20 -18
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c +53 -42
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +363 -356
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +149 -145
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +16 -13
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/filter_state.upbdefs.c +48 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/filter_state.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +14 -14
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/status_code_input.upbdefs.c +40 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/status_code_input.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c +10 -9
- data/src/core/ext/xds/certificate_provider_store.h +3 -3
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +1 -0
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +3 -3
- data/src/core/ext/xds/upb_utils.h +3 -3
- data/src/core/ext/xds/xds_api.h +3 -3
- data/src/core/ext/xds/xds_bootstrap.h +3 -3
- data/src/core/ext/xds/xds_bootstrap_grpc.cc +1 -0
- data/src/core/ext/xds/xds_bootstrap_grpc.h +3 -3
- data/src/core/ext/xds/xds_certificate_provider.h +3 -3
- data/src/core/ext/xds/xds_channel_args.h +3 -3
- data/src/core/ext/xds/xds_channel_stack_modifier.h +3 -3
- data/src/core/ext/xds/xds_client.cc +8 -3
- data/src/core/ext/xds/xds_client.h +3 -3
- data/src/core/ext/xds/xds_client_grpc.cc +0 -1
- data/src/core/ext/xds/xds_client_grpc.h +3 -3
- data/src/core/ext/xds/xds_client_stats.h +4 -3
- data/src/core/ext/xds/xds_cluster.cc +11 -7
- data/src/core/ext/xds/xds_cluster.h +6 -6
- data/src/core/ext/xds/xds_cluster_specifier_plugin.h +3 -3
- data/src/core/ext/xds/xds_common_types.cc +1 -0
- data/src/core/ext/xds/xds_common_types.h +3 -3
- data/src/core/ext/xds/xds_endpoint.cc +1 -1
- data/src/core/ext/xds/xds_endpoint.h +3 -3
- data/src/core/ext/xds/xds_health_status.h +30 -3
- data/src/core/ext/xds/xds_http_fault_filter.h +3 -3
- data/src/core/ext/xds/xds_http_filters.cc +1 -1
- data/src/core/ext/xds/xds_http_filters.h +3 -3
- data/src/core/ext/xds/xds_http_rbac_filter.h +3 -3
- data/src/core/ext/xds/xds_http_stateful_session_filter.h +3 -3
- data/src/core/ext/xds/xds_lb_policy_registry.cc +95 -0
- data/src/core/ext/xds/xds_lb_policy_registry.h +3 -3
- data/src/core/ext/xds/xds_listener.cc +1 -0
- data/src/core/ext/xds/xds_listener.h +3 -3
- data/src/core/ext/xds/xds_resource_type.h +3 -3
- data/src/core/ext/xds/xds_resource_type_impl.h +3 -3
- data/src/core/ext/xds/xds_route_config.cc +6 -0
- data/src/core/ext/xds/xds_route_config.h +3 -3
- data/src/core/ext/xds/xds_routing.h +3 -3
- data/src/core/ext/xds/xds_transport.h +3 -3
- data/src/core/ext/xds/xds_transport_grpc.h +3 -3
- data/src/core/lib/address_utils/parse_address.h +3 -3
- data/src/core/lib/address_utils/sockaddr_utils.cc +1 -0
- data/src/core/lib/address_utils/sockaddr_utils.h +3 -3
- data/src/core/lib/avl/avl.h +3 -3
- data/src/core/lib/backoff/backoff.h +3 -3
- data/src/core/lib/channel/call_finalization.h +3 -3
- data/src/core/lib/channel/call_tracer.h +3 -3
- data/src/core/lib/channel/channel_args.cc +1 -0
- data/src/core/lib/channel/channel_args.h +11 -5
- data/src/core/lib/channel/channel_args_preconditioning.h +3 -3
- data/src/core/lib/channel/channel_fwd.h +3 -3
- data/src/core/lib/channel/channel_stack.cc +1 -2
- data/src/core/lib/channel/channel_stack.h +4 -4
- data/src/core/lib/channel/channel_stack_builder.h +3 -3
- data/src/core/lib/channel/channel_stack_builder_impl.cc +14 -1
- data/src/core/lib/channel/channel_stack_builder_impl.h +3 -3
- data/src/core/lib/channel/channel_trace.h +3 -3
- data/src/core/lib/channel/channelz.h +3 -3
- data/src/core/lib/channel/channelz_registry.h +3 -3
- data/src/core/lib/channel/connected_channel.cc +883 -354
- data/src/core/lib/channel/connected_channel.h +3 -3
- data/src/core/lib/channel/context.h +7 -3
- data/src/core/lib/channel/promise_based_filter.cc +532 -260
- data/src/core/lib/channel/promise_based_filter.h +124 -44
- data/src/core/lib/channel/status_util.h +3 -3
- data/src/core/lib/compression/compression_internal.h +3 -3
- data/src/core/lib/compression/message_compress.h +3 -3
- data/src/core/lib/config/core_configuration.h +3 -3
- data/src/core/lib/debug/event_log.h +3 -3
- data/src/core/lib/debug/histogram_view.h +3 -3
- data/src/core/lib/debug/stats.h +3 -3
- data/src/core/lib/debug/stats_data.cc +66 -65
- data/src/core/lib/debug/stats_data.h +42 -33
- data/src/core/lib/debug/trace.h +4 -26
- data/src/core/lib/event_engine/channel_args_endpoint_config.cc +5 -0
- data/src/core/lib/event_engine/channel_args_endpoint_config.h +3 -3
- data/src/core/lib/event_engine/common_closures.h +3 -3
- data/src/core/lib/event_engine/default_event_engine.cc +9 -4
- data/src/core/lib/event_engine/default_event_engine.h +30 -6
- data/src/core/lib/event_engine/default_event_engine_factory.h +3 -3
- data/src/core/lib/event_engine/event_engine.cc +25 -0
- data/src/core/lib/event_engine/executor/executor.h +3 -3
- data/src/core/lib/event_engine/forkable.cc +11 -6
- data/src/core/lib/event_engine/forkable.h +3 -3
- data/src/core/lib/event_engine/handle_containers.h +10 -3
- data/src/core/lib/event_engine/poller.h +3 -3
- data/src/core/lib/event_engine/posix.h +158 -0
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +44 -16
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h +14 -4
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +6 -7
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.h +3 -3
- data/src/core/lib/event_engine/posix_engine/event_poller.h +3 -3
- data/src/core/lib/event_engine/posix_engine/event_poller_posix_default.h +3 -3
- data/src/core/lib/event_engine/posix_engine/internal_errqueue.h +3 -3
- data/src/core/lib/event_engine/posix_engine/lockfree_event.h +3 -3
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +52 -55
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +46 -13
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +82 -12
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +23 -9
- data/src/core/lib/event_engine/posix_engine/posix_engine_closure.h +3 -3
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +60 -7
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.h +65 -14
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +0 -1
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.h +6 -6
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +3 -3
- data/src/core/lib/event_engine/posix_engine/timer.h +3 -3
- data/src/core/lib/event_engine/posix_engine/timer_heap.h +3 -3
- data/src/core/lib/event_engine/posix_engine/timer_manager.h +3 -3
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.h +3 -3
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.h +3 -3
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.h +3 -3
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix.h +3 -3
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.h +3 -3
- data/src/core/lib/event_engine/resolved_address.cc +19 -0
- data/src/core/lib/event_engine/resolved_address_internal.h +34 -0
- data/src/core/lib/event_engine/shim.cc +56 -0
- data/src/core/lib/event_engine/shim.h +33 -0
- data/src/core/lib/event_engine/slice.cc +1 -1
- data/src/core/lib/event_engine/tcp_socket_utils.cc +18 -2
- data/src/core/lib/event_engine/tcp_socket_utils.h +8 -3
- data/src/core/lib/event_engine/thread_local.cc +29 -0
- data/src/core/lib/event_engine/thread_local.h +32 -0
- data/src/core/lib/event_engine/thread_pool.cc +41 -65
- data/src/core/lib/event_engine/thread_pool.h +21 -17
- data/src/core/lib/event_engine/time_util.h +3 -3
- data/src/core/lib/event_engine/trace.cc +6 -0
- data/src/core/lib/event_engine/trace.h +16 -3
- data/src/core/lib/event_engine/utils.cc +2 -2
- data/src/core/lib/event_engine/utils.h +12 -4
- data/src/core/lib/event_engine/windows/iocp.cc +24 -40
- data/src/core/lib/event_engine/windows/iocp.h +3 -3
- data/src/core/lib/event_engine/windows/win_socket.cc +56 -33
- data/src/core/lib/event_engine/windows/win_socket.h +34 -25
- data/src/core/lib/event_engine/windows/windows_endpoint.cc +331 -0
- data/src/core/lib/event_engine/windows/windows_endpoint.h +103 -0
- data/src/core/lib/event_engine/windows/windows_engine.cc +243 -20
- data/src/core/lib/event_engine/windows/windows_engine.h +62 -23
- data/src/core/lib/experiments/config.cc +16 -1
- data/src/core/lib/experiments/config.h +13 -3
- data/src/core/lib/experiments/experiments.cc +14 -8
- data/src/core/lib/experiments/experiments.h +80 -21
- data/src/core/lib/gpr/alloc.h +3 -3
- data/src/core/lib/gpr/spinlock.h +3 -3
- data/src/core/lib/gpr/string.h +3 -3
- data/src/core/lib/gpr/sync_abseil.cc +15 -7
- data/src/core/lib/gpr/time_precise.h +3 -3
- data/src/core/lib/gpr/tmpfile.h +3 -3
- data/src/core/lib/gpr/useful.h +3 -3
- data/src/core/lib/gprpp/atomic_utils.h +3 -3
- data/src/core/lib/gprpp/bitset.h +3 -3
- data/src/core/lib/gprpp/chunked_vector.h +3 -3
- data/src/core/lib/gprpp/construct_destruct.h +3 -3
- data/src/core/lib/gprpp/cpp_impl_of.h +3 -3
- data/src/core/lib/gprpp/crash.h +3 -3
- data/src/core/lib/gprpp/debug_location.h +3 -6
- data/src/core/lib/gprpp/dual_ref_counted.h +3 -3
- data/src/core/lib/gprpp/env.h +3 -3
- data/src/core/lib/gprpp/examine_stack.h +3 -3
- data/src/core/lib/gprpp/fork.cc +21 -4
- data/src/core/lib/gprpp/fork.h +7 -5
- data/src/core/lib/gprpp/global_config.h +3 -3
- data/src/core/lib/gprpp/global_config_custom.h +3 -3
- data/src/core/lib/gprpp/global_config_env.cc +1 -0
- data/src/core/lib/gprpp/global_config_env.h +3 -3
- data/src/core/lib/gprpp/global_config_generic.h +3 -3
- data/src/core/lib/gprpp/host_port.cc +2 -0
- data/src/core/lib/gprpp/host_port.h +3 -3
- data/src/core/lib/gprpp/load_file.h +3 -3
- data/src/core/lib/gprpp/manual_constructor.h +3 -3
- data/src/core/lib/gprpp/match.h +3 -3
- data/src/core/lib/gprpp/memory.h +3 -3
- data/src/core/lib/gprpp/mpscq.h +3 -3
- data/src/core/lib/gprpp/no_destruct.h +3 -3
- data/src/core/lib/gprpp/notification.h +3 -3
- data/src/core/lib/gprpp/orphanable.h +3 -3
- data/src/core/lib/gprpp/overload.h +3 -3
- data/src/core/lib/gprpp/packed_table.h +3 -3
- data/src/core/lib/gprpp/per_cpu.h +3 -3
- data/src/core/lib/gprpp/ref_counted.h +3 -3
- data/src/core/lib/gprpp/ref_counted_ptr.h +3 -3
- data/src/core/lib/gprpp/single_set_ptr.h +3 -3
- data/src/core/lib/gprpp/sorted_pack.h +3 -3
- data/src/core/lib/gprpp/stat.h +3 -3
- data/src/core/lib/gprpp/status_helper.h +3 -3
- data/src/core/lib/gprpp/strerror.cc +2 -0
- data/src/core/lib/gprpp/strerror.h +3 -3
- data/src/core/lib/gprpp/sync.h +3 -3
- data/src/core/lib/gprpp/table.h +3 -3
- data/src/core/lib/gprpp/tchar.h +3 -3
- data/src/core/lib/gprpp/thd.h +3 -3
- data/src/core/lib/gprpp/time.cc +1 -0
- data/src/core/lib/gprpp/time.h +3 -3
- data/src/core/lib/gprpp/time_averaged_stats.h +3 -3
- data/src/core/lib/gprpp/time_util.h +3 -3
- data/src/core/lib/gprpp/unique_type_name.h +3 -3
- data/src/core/lib/gprpp/validation_errors.h +3 -3
- data/src/core/lib/gprpp/work_serializer.h +3 -3
- data/src/core/lib/handshaker/proxy_mapper.h +3 -3
- data/src/core/lib/handshaker/proxy_mapper_registry.h +3 -3
- data/src/core/lib/http/format_request.cc +1 -0
- data/src/core/lib/http/format_request.h +3 -3
- data/src/core/lib/http/httpcli.cc +1 -0
- data/src/core/lib/http/httpcli.h +3 -3
- data/src/core/lib/http/httpcli_ssl_credentials.h +3 -3
- data/src/core/lib/http/parser.h +3 -3
- data/src/core/lib/iomgr/block_annotate.h +3 -3
- data/src/core/lib/iomgr/buffer_list.h +3 -3
- data/src/core/lib/iomgr/call_combiner.cc +4 -4
- data/src/core/lib/iomgr/call_combiner.h +3 -3
- data/src/core/lib/iomgr/cfstream_handle.h +3 -3
- data/src/core/lib/iomgr/closure.cc +27 -0
- data/src/core/lib/iomgr/closure.h +5 -3
- data/src/core/lib/iomgr/combiner.h +3 -3
- data/src/core/lib/iomgr/dynamic_annotations.h +3 -3
- data/src/core/lib/iomgr/endpoint.h +3 -3
- data/src/core/lib/iomgr/endpoint_cfstream.h +3 -3
- data/src/core/lib/iomgr/endpoint_pair.h +3 -3
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +10 -2
- data/src/core/lib/iomgr/error.h +3 -3
- data/src/core/lib/iomgr/error_cfstream.h +3 -3
- data/src/core/lib/iomgr/ev_apple.h +3 -3
- data/src/core/lib/iomgr/ev_epoll1_linux.h +3 -3
- data/src/core/lib/iomgr/ev_poll_posix.h +3 -3
- data/src/core/lib/iomgr/ev_posix.h +3 -3
- data/src/core/lib/iomgr/event_engine_shims/closure.cc +62 -0
- data/src/core/lib/iomgr/event_engine_shims/closure.h +39 -0
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +430 -0
- data/src/core/lib/iomgr/event_engine_shims/endpoint.h +43 -0
- data/src/core/lib/iomgr/event_engine_shims/tcp_client.cc +91 -0
- data/src/core/lib/iomgr/event_engine_shims/tcp_client.h +44 -0
- data/src/core/lib/iomgr/exec_ctx.h +3 -3
- data/src/core/lib/iomgr/executor.h +3 -3
- data/src/core/lib/iomgr/fork_posix.cc +5 -4
- data/src/core/lib/iomgr/gethostname.h +3 -3
- data/src/core/lib/iomgr/grpc_if_nametoindex.h +3 -3
- data/src/core/lib/iomgr/internal_errqueue.h +3 -3
- data/src/core/lib/iomgr/iocp_windows.h +3 -3
- data/src/core/lib/iomgr/iomgr.h +3 -3
- data/src/core/lib/iomgr/iomgr_fwd.h +3 -3
- data/src/core/lib/iomgr/iomgr_internal.h +3 -3
- data/src/core/lib/iomgr/load_file.h +3 -3
- data/src/core/lib/iomgr/lockfree_event.h +3 -3
- data/src/core/lib/iomgr/nameser.h +3 -3
- data/src/core/lib/iomgr/polling_entity.h +3 -3
- data/src/core/lib/iomgr/pollset.h +3 -3
- data/src/core/lib/iomgr/pollset_set.h +3 -3
- data/src/core/lib/iomgr/pollset_set_windows.h +3 -3
- data/src/core/lib/iomgr/pollset_windows.cc +2 -2
- data/src/core/lib/iomgr/pollset_windows.h +3 -3
- data/src/core/lib/iomgr/port.h +3 -3
- data/src/core/lib/iomgr/python_util.h +3 -3
- data/src/core/lib/iomgr/resolve_address.h +3 -3
- data/src/core/lib/iomgr/resolve_address_impl.h +3 -3
- data/src/core/lib/iomgr/resolve_address_posix.h +3 -3
- data/src/core/lib/iomgr/resolve_address_windows.h +3 -3
- data/src/core/lib/iomgr/resolved_address.h +3 -3
- data/src/core/lib/iomgr/sockaddr.h +3 -3
- data/src/core/lib/iomgr/sockaddr_posix.h +3 -3
- data/src/core/lib/iomgr/sockaddr_windows.h +3 -3
- data/src/core/lib/iomgr/socket_factory_posix.h +3 -3
- data/src/core/lib/iomgr/socket_mutator.h +3 -3
- data/src/core/lib/iomgr/socket_utils.h +3 -3
- data/src/core/lib/iomgr/socket_utils_posix.h +3 -3
- data/src/core/lib/iomgr/socket_windows.h +3 -3
- data/src/core/lib/iomgr/systemd_utils.cc +19 -19
- data/src/core/lib/iomgr/systemd_utils.h +24 -24
- data/src/core/lib/iomgr/tcp_client.h +3 -3
- data/src/core/lib/iomgr/tcp_client_posix.cc +12 -0
- data/src/core/lib/iomgr/tcp_client_posix.h +3 -3
- data/src/core/lib/iomgr/tcp_client_windows.cc +13 -1
- data/src/core/lib/iomgr/tcp_posix.cc +49 -65
- data/src/core/lib/iomgr/tcp_posix.h +3 -3
- data/src/core/lib/iomgr/tcp_server.h +3 -3
- data/src/core/lib/iomgr/tcp_server_posix.cc +219 -4
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +13 -3
- data/src/core/lib/iomgr/tcp_server_windows.cc +4 -6
- data/src/core/lib/iomgr/tcp_windows.h +3 -3
- data/src/core/lib/iomgr/timer.h +3 -3
- data/src/core/lib/iomgr/timer_generic.h +3 -3
- data/src/core/lib/iomgr/timer_heap.h +3 -3
- data/src/core/lib/iomgr/timer_manager.h +3 -3
- data/src/core/lib/iomgr/unix_sockets_posix.h +3 -3
- data/src/core/lib/iomgr/wakeup_fd_pipe.h +3 -3
- data/src/core/lib/iomgr/wakeup_fd_posix.h +3 -3
- data/src/core/lib/json/json.h +3 -3
- data/src/core/lib/json/json_args.h +3 -3
- data/src/core/lib/json/json_channel_args.h +3 -3
- data/src/core/lib/json/json_object_loader.h +3 -3
- data/src/core/lib/json/json_reader.cc +1 -0
- data/src/core/lib/json/json_util.h +3 -3
- data/src/core/lib/load_balancing/lb_policy.cc +9 -0
- data/src/core/lib/load_balancing/lb_policy.h +9 -5
- data/src/core/lib/load_balancing/lb_policy_factory.h +3 -3
- data/src/core/lib/load_balancing/lb_policy_registry.cc +1 -0
- data/src/core/lib/load_balancing/lb_policy_registry.h +3 -3
- data/src/core/lib/load_balancing/subchannel_interface.h +8 -6
- data/src/core/lib/matchers/matchers.cc +1 -0
- data/src/core/lib/matchers/matchers.h +3 -3
- data/src/core/lib/promise/activity.cc +8 -6
- data/src/core/lib/promise/activity.h +52 -66
- data/src/core/lib/promise/arena_promise.h +3 -3
- data/src/core/lib/promise/context.h +3 -3
- data/src/core/lib/promise/detail/basic_join.h +197 -0
- data/src/core/lib/promise/detail/basic_seq.h +10 -16
- data/src/core/lib/promise/detail/promise_factory.h +3 -3
- data/src/core/lib/promise/detail/promise_like.h +3 -3
- data/src/core/lib/promise/detail/status.h +3 -3
- data/src/core/lib/promise/detail/switch.h +3 -3
- data/src/core/lib/promise/exec_ctx_wakeup_scheduler.h +3 -3
- data/src/core/lib/promise/if.h +195 -0
- data/src/core/lib/promise/interceptor_list.h +308 -0
- data/src/core/lib/promise/intra_activity_waiter.h +9 -3
- data/src/core/lib/promise/latch.h +99 -5
- data/src/core/lib/promise/loop.h +4 -4
- data/src/core/lib/promise/map.h +4 -6
- data/src/core/lib/promise/pipe.h +296 -193
- data/src/core/lib/promise/poll.h +113 -14
- data/src/core/lib/promise/promise.h +4 -5
- data/src/core/lib/promise/race.h +6 -9
- data/src/core/lib/promise/seq.h +3 -3
- data/src/core/lib/promise/sleep.h +3 -3
- data/src/core/lib/promise/{pipe.cc → trace.cc} +3 -2
- data/src/core/lib/promise/trace.h +24 -0
- data/src/core/lib/promise/try_join.h +82 -0
- data/src/core/lib/promise/try_seq.h +3 -3
- data/src/core/lib/resolver/resolver.h +3 -3
- data/src/core/lib/resolver/resolver_factory.h +4 -4
- data/src/core/lib/resolver/resolver_registry.cc +15 -0
- data/src/core/lib/resolver/resolver_registry.h +3 -3
- data/src/core/lib/resolver/server_address.cc +1 -0
- data/src/core/lib/resolver/server_address.h +3 -3
- data/src/core/lib/resource_quota/api.h +3 -3
- data/src/core/lib/resource_quota/arena.cc +36 -9
- data/src/core/lib/resource_quota/arena.h +84 -22
- data/src/core/lib/resource_quota/memory_quota.h +3 -3
- data/src/core/lib/resource_quota/periodic_update.h +3 -3
- data/src/core/lib/resource_quota/resource_quota.h +3 -3
- data/src/core/lib/resource_quota/thread_quota.h +3 -3
- data/src/core/lib/resource_quota/trace.h +3 -3
- data/src/core/lib/security/authorization/authorization_engine.h +3 -3
- data/src/core/lib/security/authorization/authorization_policy_provider.h +3 -3
- data/src/core/lib/security/authorization/evaluate_args.h +3 -3
- data/src/core/lib/security/authorization/grpc_authorization_engine.h +3 -3
- data/src/core/lib/security/authorization/grpc_server_authz_filter.h +3 -3
- data/src/core/lib/security/authorization/matchers.h +3 -3
- data/src/core/lib/security/authorization/rbac_policy.cc +1 -0
- data/src/core/lib/security/authorization/rbac_policy.h +3 -3
- data/src/core/lib/security/certificate_provider/certificate_provider_factory.h +3 -3
- data/src/core/lib/security/certificate_provider/certificate_provider_registry.h +3 -3
- data/src/core/lib/security/context/security_context.h +3 -3
- data/src/core/lib/security/credentials/alts/alts_credentials.h +3 -3
- data/src/core/lib/security/credentials/alts/check_gcp_environment.h +3 -3
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h +3 -3
- data/src/core/lib/security/credentials/call_creds_util.h +3 -3
- data/src/core/lib/security/credentials/channel_creds_registry.h +3 -3
- data/src/core/lib/security/credentials/composite/composite_credentials.h +3 -3
- data/src/core/lib/security/credentials/credentials.h +3 -3
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +1 -0
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.h +3 -3
- data/src/core/lib/security/credentials/external/aws_request_signer.cc +1 -0
- data/src/core/lib/security/credentials/external/aws_request_signer.h +3 -3
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +1 -0
- data/src/core/lib/security/credentials/external/external_account_credentials.h +3 -3
- data/src/core/lib/security/credentials/external/file_external_account_credentials.h +3 -3
- data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +1 -0
- data/src/core/lib/security/credentials/external/url_external_account_credentials.h +3 -3
- data/src/core/lib/security/credentials/fake/fake_credentials.h +3 -3
- data/src/core/lib/security/credentials/google_default/google_default_credentials.h +3 -3
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +1 -0
- data/src/core/lib/security/credentials/iam/iam_credentials.h +3 -3
- data/src/core/lib/security/credentials/insecure/insecure_credentials.h +3 -3
- data/src/core/lib/security/credentials/jwt/json_token.h +3 -3
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +4 -3
- data/src/core/lib/security/credentials/jwt/jwt_verifier.h +3 -3
- data/src/core/lib/security/credentials/local/local_credentials.h +3 -3
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +4 -3
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +3 -3
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +3 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h +3 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +1 -1
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +3 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +3 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +3 -3
- data/src/core/lib/security/credentials/tls/tls_credentials.h +3 -3
- data/src/core/lib/security/credentials/tls/tls_utils.h +3 -3
- data/src/core/lib/security/credentials/xds/xds_credentials.h +3 -3
- data/src/core/lib/security/security_connector/alts/alts_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +1 -0
- data/src/core/lib/security/security_connector/fake/fake_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/load_system_roots.h +3 -3
- data/src/core/lib/security/security_connector/load_system_roots_supported.h +3 -3
- data/src/core/lib/security/security_connector/local/local_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/security_connector.h +3 -3
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +1 -0
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/ssl_utils.h +3 -3
- data/src/core/lib/security/security_connector/ssl_utils_config.h +3 -3
- data/src/core/lib/security/security_connector/tls/tls_security_connector.h +3 -3
- data/src/core/lib/security/transport/auth_filters.h +27 -5
- data/src/core/lib/security/transport/secure_endpoint.h +3 -3
- data/src/core/lib/security/transport/security_handshaker.cc +9 -0
- data/src/core/lib/security/transport/security_handshaker.h +3 -3
- data/src/core/lib/security/transport/server_auth_filter.cc +120 -251
- data/src/core/lib/security/transport/tsi_error.h +3 -3
- data/src/core/lib/security/util/json_util.h +3 -3
- data/src/core/lib/service_config/service_config.h +3 -3
- data/src/core/lib/service_config/service_config_call_data.h +3 -3
- data/src/core/lib/service_config/service_config_impl.h +3 -3
- data/src/core/lib/service_config/service_config_parser.h +3 -3
- data/src/core/lib/slice/b64.h +3 -3
- data/src/core/lib/slice/percent_encoding.h +3 -3
- data/src/core/lib/slice/slice.cc +3 -3
- data/src/core/lib/slice/slice.h +14 -21
- data/src/core/lib/slice/slice_buffer.h +10 -4
- data/src/core/lib/slice/slice_internal.h +3 -3
- data/src/core/lib/slice/slice_refcount.cc +20 -0
- data/src/core/lib/slice/slice_refcount.h +26 -6
- data/src/core/lib/slice/slice_string_helpers.h +3 -3
- data/src/core/lib/surface/api_trace.h +3 -3
- data/src/core/lib/surface/builtins.h +3 -3
- data/src/core/lib/surface/call.cc +866 -252
- data/src/core/lib/surface/call.h +31 -3
- data/src/core/lib/surface/call_log_batch.cc +1 -0
- data/src/core/lib/surface/call_test_only.h +3 -3
- data/src/core/lib/surface/call_trace.cc +21 -11
- data/src/core/lib/surface/call_trace.h +3 -3
- data/src/core/lib/surface/channel.h +3 -3
- data/src/core/lib/surface/channel_init.h +3 -3
- data/src/core/lib/surface/channel_stack_type.h +3 -3
- data/src/core/lib/surface/completion_queue.cc +1 -0
- data/src/core/lib/surface/completion_queue.h +3 -3
- data/src/core/lib/surface/completion_queue_factory.h +3 -3
- data/src/core/lib/surface/event_string.cc +1 -0
- data/src/core/lib/surface/event_string.h +3 -3
- data/src/core/lib/surface/init.cc +1 -1
- data/src/core/lib/surface/init.h +3 -3
- data/src/core/lib/surface/init_internally.h +3 -3
- data/src/core/lib/surface/lame_client.cc +3 -1
- data/src/core/lib/surface/lame_client.h +3 -3
- data/src/core/lib/surface/server.cc +273 -27
- data/src/core/lib/surface/server.h +6 -3
- data/src/core/lib/surface/validate_metadata.h +3 -3
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/bdp_estimator.h +3 -3
- data/src/core/lib/transport/connectivity_state.h +3 -3
- data/src/core/lib/transport/error_utils.h +3 -3
- data/src/core/lib/transport/handshaker.cc +11 -0
- data/src/core/lib/transport/handshaker.h +4 -4
- data/src/core/lib/transport/handshaker_factory.h +3 -3
- data/src/core/lib/transport/handshaker_registry.h +3 -3
- data/src/core/lib/transport/http2_errors.h +3 -3
- data/src/core/lib/transport/http_connect_handshaker.h +3 -3
- data/src/core/lib/transport/metadata_batch.cc +11 -0
- data/src/core/lib/transport/metadata_batch.h +24 -3
- data/src/core/lib/transport/parsed_metadata.h +3 -3
- data/src/core/lib/transport/pid_controller.h +3 -3
- data/src/core/lib/transport/status_conversion.h +3 -3
- data/src/core/lib/transport/tcp_connect_handshaker.cc +0 -1
- data/src/core/lib/transport/tcp_connect_handshaker.h +3 -3
- data/src/core/lib/transport/timeout_encoding.h +3 -3
- data/src/core/lib/transport/transport.cc +3 -8
- data/src/core/lib/transport/transport.h +16 -8
- data/src/core/lib/transport/transport_fwd.h +3 -3
- data/src/core/lib/transport/transport_impl.h +3 -3
- data/src/core/lib/transport/transport_op_string.cc +1 -0
- data/src/core/lib/uri/uri_parser.cc +1 -1
- data/src/core/lib/uri/uri_parser.h +3 -3
- data/src/core/plugin_registry/grpc_plugin_registry.cc +5 -0
- data/src/core/tsi/alts/crypt/gsec.h +3 -3
- data/src/core/tsi/alts/frame_protector/alts_counter.h +3 -3
- data/src/core/tsi/alts/frame_protector/alts_crypter.h +3 -3
- data/src/core/tsi/alts/frame_protector/alts_frame_protector.h +3 -3
- data/src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.h +3 -3
- data/src/core/tsi/alts/frame_protector/frame_handler.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_shared_resource.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.h +3 -3
- data/src/core/tsi/alts/handshaker/transport_security_common_api.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h +3 -3
- data/src/core/tsi/fake_transport_security.h +3 -3
- data/src/core/tsi/local_transport_security.h +3 -3
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.cc +1 -1
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.h +3 -3
- data/src/core/tsi/ssl/session_cache/ssl_session.h +3 -3
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +3 -3
- data/src/core/tsi/ssl_transport_security.cc +113 -24
- data/src/core/tsi/ssl_transport_security.h +5 -3
- data/src/core/tsi/ssl_transport_security_utils.h +3 -3
- data/src/core/tsi/ssl_types.h +3 -3
- data/src/core/tsi/transport_security.h +3 -3
- data/src/core/tsi/transport_security_grpc.h +3 -3
- data/src/core/tsi/transport_security_interface.h +3 -3
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/generate_proto_ruby.sh +0 -6
- data/third_party/abseil-cpp/absl/algorithm/container.h +56 -57
- data/third_party/abseil-cpp/absl/base/attributes.h +39 -19
- data/third_party/abseil-cpp/absl/base/config.h +44 -3
- data/third_party/abseil-cpp/absl/base/internal/cycleclock.h +3 -18
- data/third_party/abseil-cpp/absl/base/internal/cycleclock_config.h +55 -0
- data/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +2 -1
- data/third_party/abseil-cpp/absl/base/internal/inline_variable.h +3 -3
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc +2 -2
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.h +1 -1
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +10 -6
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +23 -24
- data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +3 -3
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +2 -6
- data/third_party/abseil-cpp/absl/base/internal/spinlock_win32.inc +4 -1
- data/third_party/abseil-cpp/absl/base/internal/strerror.cc +4 -4
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +14 -10
- data/third_party/abseil-cpp/absl/base/internal/thread_annotations.h +9 -0
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +4 -0
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +3 -40
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock_config.h +62 -0
- data/third_party/abseil-cpp/absl/base/macros.h +4 -21
- data/third_party/abseil-cpp/absl/base/optimization.h +58 -6
- data/third_party/abseil-cpp/absl/base/options.h +1 -7
- data/third_party/abseil-cpp/absl/base/policy_checks.h +15 -13
- data/third_party/abseil-cpp/absl/container/fixed_array.h +7 -5
- data/third_party/abseil-cpp/absl/container/flat_hash_set.h +0 -7
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +66 -18
- data/third_party/abseil-cpp/absl/container/internal/common.h +3 -3
- data/third_party/abseil-cpp/absl/container/internal/common_policy_traits.h +132 -0
- data/third_party/abseil-cpp/absl/container/internal/container_memory.h +13 -1
- data/third_party/abseil-cpp/absl/container/internal/hash_policy_traits.h +4 -55
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +50 -5
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +14 -46
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +110 -32
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +155 -4
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +661 -341
- data/third_party/abseil-cpp/absl/crc/crc32c.cc +99 -0
- data/third_party/abseil-cpp/absl/crc/crc32c.h +183 -0
- data/third_party/abseil-cpp/absl/crc/internal/cpu_detect.cc +256 -0
- data/third_party/abseil-cpp/absl/crc/internal/cpu_detect.h +57 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc.cc +468 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc.h +91 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc32_x86_arm_combined_simd.h +269 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc32c.h +39 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc32c_inline.h +72 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_cord_state.cc +130 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_cord_state.h +159 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_internal.h +179 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy.h +119 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_fallback.cc +75 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_x86_64.cc +434 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_non_temporal_memcpy.cc +93 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +725 -0
- data/third_party/abseil-cpp/absl/crc/internal/non_temporal_arm_intrinsics.h +79 -0
- data/third_party/abseil-cpp/absl/crc/internal/non_temporal_memcpy.h +180 -0
- data/third_party/abseil-cpp/absl/debugging/internal/address_is_readable.cc +1 -1
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +67 -38
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.h +1 -1
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc +12 -13
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +11 -9
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc +1 -1
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +40 -85
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_win32-inl.inc +5 -4
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +33 -8
- data/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc +3 -2
- data/third_party/abseil-cpp/absl/debugging/symbolize_darwin.inc +3 -2
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +118 -94
- data/third_party/abseil-cpp/absl/debugging/symbolize_win32.inc +7 -6
- data/third_party/abseil-cpp/absl/functional/any_invocable.h +5 -2
- data/third_party/abseil-cpp/absl/functional/internal/any_invocable.h +47 -26
- data/third_party/abseil-cpp/absl/hash/internal/city.cc +10 -10
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +18 -4
- data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc +3 -14
- data/third_party/abseil-cpp/absl/memory/memory.h +26 -447
- data/third_party/abseil-cpp/absl/meta/type_traits.h +104 -12
- data/third_party/abseil-cpp/absl/numeric/bits.h +2 -3
- data/third_party/abseil-cpp/absl/numeric/int128.cc +10 -8
- data/third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h +14 -6
- data/third_party/abseil-cpp/absl/random/internal/fast_uniform_bits.h +2 -1
- data/third_party/abseil-cpp/absl/random/internal/nonsecure_base.h +1 -1
- data/third_party/abseil-cpp/absl/random/internal/pcg_engine.h +2 -23
- data/third_party/abseil-cpp/absl/random/internal/pool_urbg.cc +9 -9
- data/third_party/abseil-cpp/absl/random/internal/seed_material.cc +2 -2
- data/third_party/abseil-cpp/absl/random/random.h +6 -6
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +1 -0
- data/third_party/abseil-cpp/absl/status/status.cc +19 -12
- data/third_party/abseil-cpp/absl/status/status.h +2 -2
- data/third_party/abseil-cpp/absl/strings/ascii.cc +5 -5
- data/third_party/abseil-cpp/absl/strings/charconv.cc +534 -96
- data/third_party/abseil-cpp/absl/strings/cord.cc +92 -40
- data/third_party/abseil-cpp/absl/strings/cord.h +71 -80
- data/third_party/abseil-cpp/absl/strings/cord_buffer.h +8 -5
- data/third_party/abseil-cpp/absl/strings/escaping.cc +73 -62
- data/third_party/abseil-cpp/absl/strings/escaping.h +24 -19
- data/third_party/abseil-cpp/absl/strings/internal/char_map.h +14 -12
- data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc +4 -4
- data/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc +2 -2
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +326 -70
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +8 -4
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h +26 -14
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc +5 -5
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_crc.cc +9 -7
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_crc.h +5 -4
- data/third_party/abseil-cpp/absl/strings/internal/cordz_functions.h +7 -15
- data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.h +3 -3
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +8 -5
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.h +7 -7
- data/third_party/abseil-cpp/absl/strings/internal/cordz_statistics.h +4 -4
- data/third_party/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance.cc +93 -0
- data/third_party/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance.h +34 -0
- data/third_party/abseil-cpp/absl/strings/internal/escaping.cc +12 -10
- data/third_party/abseil-cpp/absl/strings/internal/escaping.h +7 -9
- data/third_party/abseil-cpp/absl/strings/internal/has_absl_stringify.h +55 -0
- data/third_party/abseil-cpp/absl/strings/internal/memutil.cc +9 -6
- data/third_party/abseil-cpp/absl/strings/internal/ostringstream.cc +14 -7
- data/third_party/abseil-cpp/absl/strings/internal/ostringstream.h +35 -10
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +113 -46
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +126 -29
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc +3 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +4 -3
- data/third_party/abseil-cpp/absl/strings/internal/str_format/checker.h +49 -287
- data/third_party/abseil-cpp/absl/strings/internal/str_format/constexpr_parser.h +351 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +2 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +4 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +215 -181
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc +10 -209
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +10 -101
- data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +2 -1
- data/third_party/abseil-cpp/absl/strings/internal/stringify_sink.cc +28 -0
- data/third_party/abseil-cpp/absl/strings/internal/stringify_sink.h +57 -0
- data/third_party/abseil-cpp/absl/strings/numbers.cc +34 -31
- data/third_party/abseil-cpp/absl/strings/str_cat.cc +9 -6
- data/third_party/abseil-cpp/absl/strings/str_cat.h +50 -3
- data/third_party/abseil-cpp/absl/strings/str_format.h +71 -9
- data/third_party/abseil-cpp/absl/strings/string_view.cc +6 -6
- data/third_party/abseil-cpp/absl/strings/string_view.h +3 -10
- data/third_party/abseil-cpp/absl/strings/substitute.cc +8 -6
- data/third_party/abseil-cpp/absl/strings/substitute.h +46 -20
- data/third_party/abseil-cpp/absl/synchronization/internal/futex.h +20 -17
- data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc +37 -31
- data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h +22 -8
- data/third_party/abseil-cpp/absl/synchronization/mutex.cc +104 -55
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +85 -46
- data/third_party/abseil-cpp/absl/synchronization/notification.cc +0 -1
- data/third_party/abseil-cpp/absl/synchronization/notification.h +0 -1
- data/third_party/abseil-cpp/absl/time/civil_time.cc +26 -0
- data/third_party/abseil-cpp/absl/time/civil_time.h +25 -0
- data/third_party/abseil-cpp/absl/time/clock.cc +17 -11
- data/third_party/abseil-cpp/absl/time/duration.cc +7 -7
- data/third_party/abseil-cpp/absl/time/format.cc +2 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc +26 -5
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +7 -6
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc +36 -35
- data/third_party/abseil-cpp/absl/time/time.cc +2 -2
- data/third_party/abseil-cpp/absl/time/time.h +253 -158
- data/third_party/abseil-cpp/absl/types/internal/span.h +30 -19
- data/third_party/abseil-cpp/absl/types/internal/variant.h +28 -40
- data/third_party/abseil-cpp/absl/types/span.h +29 -7
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_genn.c +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +1 -2
- metadata +73 -8
- data/src/core/lib/event_engine/socket_notifier.h +0 -55
- data/src/core/lib/promise/for_each.h +0 -155
- data/src/core/lib/promise/map_pipe.h +0 -88
- data/src/core/lib/promise/try_concurrently.h +0 -342
@@ -0,0 +1,725 @@
|
|
1
|
+
// Copyright 2022 The Abseil Authors.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// https://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
// Hardware accelerated CRC32 computation on Intel and ARM architecture.
|
16
|
+
|
17
|
+
#include <cstddef>
|
18
|
+
#include <cstdint>
|
19
|
+
|
20
|
+
#include "absl/base/attributes.h"
|
21
|
+
#include "absl/base/config.h"
|
22
|
+
#include "absl/base/dynamic_annotations.h"
|
23
|
+
#include "absl/base/internal/endian.h"
|
24
|
+
#include "absl/base/internal/prefetch.h"
|
25
|
+
#include "absl/crc/internal/cpu_detect.h"
|
26
|
+
#include "absl/crc/internal/crc.h"
|
27
|
+
#include "absl/crc/internal/crc32_x86_arm_combined_simd.h"
|
28
|
+
#include "absl/crc/internal/crc_internal.h"
|
29
|
+
#include "absl/memory/memory.h"
|
30
|
+
#include "absl/numeric/bits.h"
|
31
|
+
|
32
|
+
#if defined(ABSL_CRC_INTERNAL_HAVE_ARM_SIMD) || \
|
33
|
+
defined(ABSL_CRC_INTERNAL_HAVE_X86_SIMD)
|
34
|
+
#define ABSL_INTERNAL_CAN_USE_SIMD_CRC32C
|
35
|
+
#endif
|
36
|
+
|
37
|
+
namespace absl {
|
38
|
+
ABSL_NAMESPACE_BEGIN
|
39
|
+
namespace crc_internal {
|
40
|
+
|
41
|
+
#if defined(ABSL_INTERNAL_CAN_USE_SIMD_CRC32C)
|
42
|
+
|
43
|
+
// Implementation details not exported outside of file
|
44
|
+
namespace {
|
45
|
+
|
46
|
+
// Some machines have CRC acceleration hardware.
|
47
|
+
// We can do a faster version of Extend() on such machines.
|
48
|
+
class CRC32AcceleratedX86ARMCombined : public CRC32 {
|
49
|
+
public:
|
50
|
+
CRC32AcceleratedX86ARMCombined() {}
|
51
|
+
~CRC32AcceleratedX86ARMCombined() override {}
|
52
|
+
void ExtendByZeroes(uint32_t* crc, size_t length) const override;
|
53
|
+
uint32_t ComputeZeroConstant(size_t length) const;
|
54
|
+
|
55
|
+
private:
|
56
|
+
CRC32AcceleratedX86ARMCombined(const CRC32AcceleratedX86ARMCombined&) =
|
57
|
+
delete;
|
58
|
+
CRC32AcceleratedX86ARMCombined& operator=(
|
59
|
+
const CRC32AcceleratedX86ARMCombined&) = delete;
|
60
|
+
};
|
61
|
+
|
62
|
+
// Constants for switching between algorithms.
|
63
|
+
// Chosen by comparing speed at different powers of 2.
|
64
|
+
constexpr size_t kSmallCutoff = 256;
|
65
|
+
constexpr size_t kMediumCutoff = 2048;
|
66
|
+
|
67
|
+
#define ABSL_INTERNAL_STEP1(crc) \
|
68
|
+
do { \
|
69
|
+
crc = CRC32_u8(static_cast<uint32_t>(crc), *p++); \
|
70
|
+
} while (0)
|
71
|
+
#define ABSL_INTERNAL_STEP2(crc) \
|
72
|
+
do { \
|
73
|
+
crc = \
|
74
|
+
CRC32_u16(static_cast<uint32_t>(crc), absl::little_endian::Load16(p)); \
|
75
|
+
p += 2; \
|
76
|
+
} while (0)
|
77
|
+
#define ABSL_INTERNAL_STEP4(crc) \
|
78
|
+
do { \
|
79
|
+
crc = \
|
80
|
+
CRC32_u32(static_cast<uint32_t>(crc), absl::little_endian::Load32(p)); \
|
81
|
+
p += 4; \
|
82
|
+
} while (0)
|
83
|
+
#define ABSL_INTERNAL_STEP8(crc, data) \
|
84
|
+
do { \
|
85
|
+
crc = CRC32_u64(static_cast<uint32_t>(crc), \
|
86
|
+
absl::little_endian::Load64(data)); \
|
87
|
+
data += 8; \
|
88
|
+
} while (0)
|
89
|
+
#define ABSL_INTERNAL_STEP8BY2(crc0, crc1, p0, p1) \
|
90
|
+
do { \
|
91
|
+
ABSL_INTERNAL_STEP8(crc0, p0); \
|
92
|
+
ABSL_INTERNAL_STEP8(crc1, p1); \
|
93
|
+
} while (0)
|
94
|
+
#define ABSL_INTERNAL_STEP8BY3(crc0, crc1, crc2, p0, p1, p2) \
|
95
|
+
do { \
|
96
|
+
ABSL_INTERNAL_STEP8(crc0, p0); \
|
97
|
+
ABSL_INTERNAL_STEP8(crc1, p1); \
|
98
|
+
ABSL_INTERNAL_STEP8(crc2, p2); \
|
99
|
+
} while (0)
|
100
|
+
|
101
|
+
namespace {
|
102
|
+
|
103
|
+
uint32_t multiply(uint32_t a, uint32_t b) {
|
104
|
+
V128 shifts = V128_From2x64(0, 1);
|
105
|
+
V128 power = V128_From2x64(0, a);
|
106
|
+
V128 crc = V128_From2x64(0, b);
|
107
|
+
V128 res = V128_PMulLow(power, crc);
|
108
|
+
|
109
|
+
// Combine crc values
|
110
|
+
res = V128_ShiftLeft64(res, shifts);
|
111
|
+
return static_cast<uint32_t>(V128_Extract32<1>(res)) ^
|
112
|
+
CRC32_u32(0, static_cast<uint32_t>(V128_Low64(res)));
|
113
|
+
}
|
114
|
+
|
115
|
+
// Powers of crc32c polynomial, for faster ExtendByZeros.
|
116
|
+
// Verified against folly:
|
117
|
+
// folly/hash/detail/Crc32CombineDetail.cpp
|
118
|
+
constexpr uint32_t kCRC32CPowers[] = {
|
119
|
+
0x82f63b78, 0x6ea2d55c, 0x18b8ea18, 0x510ac59a, 0xb82be955, 0xb8fdb1e7,
|
120
|
+
0x88e56f72, 0x74c360a4, 0xe4172b16, 0x0d65762a, 0x35d73a62, 0x28461564,
|
121
|
+
0xbf455269, 0xe2ea32dc, 0xfe7740e6, 0xf946610b, 0x3c204f8f, 0x538586e3,
|
122
|
+
0x59726915, 0x734d5309, 0xbc1ac763, 0x7d0722cc, 0xd289cabe, 0xe94ca9bc,
|
123
|
+
0x05b74f3f, 0xa51e1f42, 0x40000000, 0x20000000, 0x08000000, 0x00800000,
|
124
|
+
0x00008000, 0x82f63b78, 0x6ea2d55c, 0x18b8ea18, 0x510ac59a, 0xb82be955,
|
125
|
+
0xb8fdb1e7, 0x88e56f72, 0x74c360a4, 0xe4172b16, 0x0d65762a, 0x35d73a62,
|
126
|
+
0x28461564, 0xbf455269, 0xe2ea32dc, 0xfe7740e6, 0xf946610b, 0x3c204f8f,
|
127
|
+
0x538586e3, 0x59726915, 0x734d5309, 0xbc1ac763, 0x7d0722cc, 0xd289cabe,
|
128
|
+
0xe94ca9bc, 0x05b74f3f, 0xa51e1f42, 0x40000000, 0x20000000, 0x08000000,
|
129
|
+
0x00800000, 0x00008000,
|
130
|
+
};
|
131
|
+
|
132
|
+
} // namespace
|
133
|
+
|
134
|
+
// Compute a magic constant, so that multiplying by it is the same as
|
135
|
+
// extending crc by length zeros.
|
136
|
+
uint32_t CRC32AcceleratedX86ARMCombined::ComputeZeroConstant(
|
137
|
+
size_t length) const {
|
138
|
+
// Lowest 2 bits are handled separately in ExtendByZeroes
|
139
|
+
length >>= 2;
|
140
|
+
|
141
|
+
int index = absl::countr_zero(length);
|
142
|
+
uint32_t prev = kCRC32CPowers[index];
|
143
|
+
length &= length - 1;
|
144
|
+
|
145
|
+
while (length) {
|
146
|
+
// For each bit of length, extend by 2**n zeros.
|
147
|
+
index = absl::countr_zero(length);
|
148
|
+
prev = multiply(prev, kCRC32CPowers[index]);
|
149
|
+
length &= length - 1;
|
150
|
+
}
|
151
|
+
return prev;
|
152
|
+
}
|
153
|
+
|
154
|
+
void CRC32AcceleratedX86ARMCombined::ExtendByZeroes(uint32_t* crc,
|
155
|
+
size_t length) const {
|
156
|
+
uint32_t val = *crc;
|
157
|
+
// Don't bother with multiplication for small length.
|
158
|
+
switch (length & 3) {
|
159
|
+
case 0:
|
160
|
+
break;
|
161
|
+
case 1:
|
162
|
+
val = CRC32_u8(val, 0);
|
163
|
+
break;
|
164
|
+
case 2:
|
165
|
+
val = CRC32_u16(val, 0);
|
166
|
+
break;
|
167
|
+
case 3:
|
168
|
+
val = CRC32_u8(val, 0);
|
169
|
+
val = CRC32_u16(val, 0);
|
170
|
+
break;
|
171
|
+
}
|
172
|
+
if (length > 3) {
|
173
|
+
val = multiply(val, ComputeZeroConstant(length));
|
174
|
+
}
|
175
|
+
*crc = val;
|
176
|
+
}
|
177
|
+
|
178
|
+
// Taken from Intel paper "Fast CRC Computation for iSCSI Polynomial Using CRC32
|
179
|
+
// Instruction"
|
180
|
+
// https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/crc-iscsi-polynomial-crc32-instruction-paper.pdf
|
181
|
+
// We only need every 4th value, because we unroll loop by 4.
|
182
|
+
constexpr uint64_t kClmulConstants[] = {
|
183
|
+
0x09e4addf8, 0x0ba4fc28e, 0x00d3b6092, 0x09e4addf8, 0x0ab7aff2a,
|
184
|
+
0x102f9b8a2, 0x0b9e02b86, 0x00d3b6092, 0x1bf2e8b8a, 0x18266e456,
|
185
|
+
0x0d270f1a2, 0x0ab7aff2a, 0x11eef4f8e, 0x083348832, 0x0dd7e3b0c,
|
186
|
+
0x0b9e02b86, 0x0271d9844, 0x1b331e26a, 0x06b749fb2, 0x1bf2e8b8a,
|
187
|
+
0x0e6fc4e6a, 0x0ce7f39f4, 0x0d7a4825c, 0x0d270f1a2, 0x026f6a60a,
|
188
|
+
0x12ed0daac, 0x068bce87a, 0x11eef4f8e, 0x1329d9f7e, 0x0b3e32c28,
|
189
|
+
0x0170076fa, 0x0dd7e3b0c, 0x1fae1cc66, 0x010746f3c, 0x086d8e4d2,
|
190
|
+
0x0271d9844, 0x0b3af077a, 0x093a5f730, 0x1d88abd4a, 0x06b749fb2,
|
191
|
+
0x0c9c8b782, 0x0cec3662e, 0x1ddffc5d4, 0x0e6fc4e6a, 0x168763fa6,
|
192
|
+
0x0b0cd4768, 0x19b1afbc4, 0x0d7a4825c, 0x123888b7a, 0x00167d312,
|
193
|
+
0x133d7a042, 0x026f6a60a, 0x000bcf5f6, 0x19d34af3a, 0x1af900c24,
|
194
|
+
0x068bce87a, 0x06d390dec, 0x16cba8aca, 0x1f16a3418, 0x1329d9f7e,
|
195
|
+
0x19fb2a8b0, 0x02178513a, 0x1a0f717c4, 0x0170076fa,
|
196
|
+
};
|
197
|
+
|
198
|
+
enum class CutoffStrategy {
|
199
|
+
// Use 3 CRC streams to fold into 1.
|
200
|
+
Fold3,
|
201
|
+
// Unroll CRC instructions for 64 bytes.
|
202
|
+
Unroll64CRC,
|
203
|
+
};
|
204
|
+
|
205
|
+
// Base class for CRC32AcceleratedX86ARMCombinedMultipleStreams containing the
|
206
|
+
// methods and data that don't need the template arguments.
|
207
|
+
class CRC32AcceleratedX86ARMCombinedMultipleStreamsBase
|
208
|
+
: public CRC32AcceleratedX86ARMCombined {
|
209
|
+
protected:
|
210
|
+
// Update partialCRC with crc of 64 byte block. Calling FinalizePclmulStream
|
211
|
+
// would produce a single crc checksum, but it is expensive. PCLMULQDQ has a
|
212
|
+
// high latency, so we run 4 128-bit partial checksums that can be reduced to
|
213
|
+
// a single value by FinalizePclmulStream later. Computing crc for arbitrary
|
214
|
+
// polynomialas with PCLMULQDQ is described in Intel paper "Fast CRC
|
215
|
+
// Computation for Generic Polynomials Using PCLMULQDQ Instruction"
|
216
|
+
// https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/fast-crc-computation-generic-polynomials-pclmulqdq-paper.pdf
|
217
|
+
// We are applying it to CRC32C polynomial.
|
218
|
+
ABSL_ATTRIBUTE_ALWAYS_INLINE void Process64BytesPclmul(
|
219
|
+
const uint8_t* p, V128* partialCRC) const {
|
220
|
+
V128 loopMultiplicands = V128_Load(reinterpret_cast<const V128*>(k1k2));
|
221
|
+
|
222
|
+
V128 partialCRC1 = partialCRC[0];
|
223
|
+
V128 partialCRC2 = partialCRC[1];
|
224
|
+
V128 partialCRC3 = partialCRC[2];
|
225
|
+
V128 partialCRC4 = partialCRC[3];
|
226
|
+
|
227
|
+
V128 tmp1 = V128_PMulHi(partialCRC1, loopMultiplicands);
|
228
|
+
V128 tmp2 = V128_PMulHi(partialCRC2, loopMultiplicands);
|
229
|
+
V128 tmp3 = V128_PMulHi(partialCRC3, loopMultiplicands);
|
230
|
+
V128 tmp4 = V128_PMulHi(partialCRC4, loopMultiplicands);
|
231
|
+
V128 data1 = V128_LoadU(reinterpret_cast<const V128*>(p + 16 * 0));
|
232
|
+
V128 data2 = V128_LoadU(reinterpret_cast<const V128*>(p + 16 * 1));
|
233
|
+
V128 data3 = V128_LoadU(reinterpret_cast<const V128*>(p + 16 * 2));
|
234
|
+
V128 data4 = V128_LoadU(reinterpret_cast<const V128*>(p + 16 * 3));
|
235
|
+
partialCRC1 = V128_PMulLow(partialCRC1, loopMultiplicands);
|
236
|
+
partialCRC2 = V128_PMulLow(partialCRC2, loopMultiplicands);
|
237
|
+
partialCRC3 = V128_PMulLow(partialCRC3, loopMultiplicands);
|
238
|
+
partialCRC4 = V128_PMulLow(partialCRC4, loopMultiplicands);
|
239
|
+
partialCRC1 = V128_Xor(tmp1, partialCRC1);
|
240
|
+
partialCRC2 = V128_Xor(tmp2, partialCRC2);
|
241
|
+
partialCRC3 = V128_Xor(tmp3, partialCRC3);
|
242
|
+
partialCRC4 = V128_Xor(tmp4, partialCRC4);
|
243
|
+
partialCRC1 = V128_Xor(partialCRC1, data1);
|
244
|
+
partialCRC2 = V128_Xor(partialCRC2, data2);
|
245
|
+
partialCRC3 = V128_Xor(partialCRC3, data3);
|
246
|
+
partialCRC4 = V128_Xor(partialCRC4, data4);
|
247
|
+
partialCRC[0] = partialCRC1;
|
248
|
+
partialCRC[1] = partialCRC2;
|
249
|
+
partialCRC[2] = partialCRC3;
|
250
|
+
partialCRC[3] = partialCRC4;
|
251
|
+
}
|
252
|
+
|
253
|
+
// Reduce partialCRC produced by Process64BytesPclmul into a single value,
|
254
|
+
// that represents crc checksum of all the processed bytes.
|
255
|
+
ABSL_ATTRIBUTE_ALWAYS_INLINE uint64_t
|
256
|
+
FinalizePclmulStream(V128* partialCRC) const {
|
257
|
+
V128 partialCRC1 = partialCRC[0];
|
258
|
+
V128 partialCRC2 = partialCRC[1];
|
259
|
+
V128 partialCRC3 = partialCRC[2];
|
260
|
+
V128 partialCRC4 = partialCRC[3];
|
261
|
+
|
262
|
+
// Combine 4 vectors of partial crc into a single vector.
|
263
|
+
V128 reductionMultiplicands =
|
264
|
+
V128_Load(reinterpret_cast<const V128*>(k5k6));
|
265
|
+
|
266
|
+
V128 low = V128_PMulLow(reductionMultiplicands, partialCRC1);
|
267
|
+
V128 high = V128_PMulHi(reductionMultiplicands, partialCRC1);
|
268
|
+
|
269
|
+
partialCRC1 = V128_Xor(low, high);
|
270
|
+
partialCRC1 = V128_Xor(partialCRC1, partialCRC2);
|
271
|
+
|
272
|
+
low = V128_PMulLow(reductionMultiplicands, partialCRC3);
|
273
|
+
high = V128_PMulHi(reductionMultiplicands, partialCRC3);
|
274
|
+
|
275
|
+
partialCRC3 = V128_Xor(low, high);
|
276
|
+
partialCRC3 = V128_Xor(partialCRC3, partialCRC4);
|
277
|
+
|
278
|
+
reductionMultiplicands = V128_Load(reinterpret_cast<const V128*>(k3k4));
|
279
|
+
|
280
|
+
low = V128_PMulLow(reductionMultiplicands, partialCRC1);
|
281
|
+
high = V128_PMulHi(reductionMultiplicands, partialCRC1);
|
282
|
+
V128 fullCRC = V128_Xor(low, high);
|
283
|
+
fullCRC = V128_Xor(fullCRC, partialCRC3);
|
284
|
+
|
285
|
+
// Reduce fullCRC into scalar value.
|
286
|
+
reductionMultiplicands = V128_Load(reinterpret_cast<const V128*>(k5k6));
|
287
|
+
|
288
|
+
V128 mask = V128_Load(reinterpret_cast<const V128*>(kMask));
|
289
|
+
|
290
|
+
V128 tmp = V128_PMul01(reductionMultiplicands, fullCRC);
|
291
|
+
fullCRC = V128_ShiftRight<8>(fullCRC);
|
292
|
+
fullCRC = V128_Xor(fullCRC, tmp);
|
293
|
+
|
294
|
+
reductionMultiplicands = V128_Load(reinterpret_cast<const V128*>(k7k0));
|
295
|
+
|
296
|
+
tmp = V128_ShiftRight<4>(fullCRC);
|
297
|
+
fullCRC = V128_And(fullCRC, mask);
|
298
|
+
fullCRC = V128_PMulLow(reductionMultiplicands, fullCRC);
|
299
|
+
fullCRC = V128_Xor(tmp, fullCRC);
|
300
|
+
|
301
|
+
reductionMultiplicands = V128_Load(reinterpret_cast<const V128*>(kPoly));
|
302
|
+
|
303
|
+
tmp = V128_And(fullCRC, mask);
|
304
|
+
tmp = V128_PMul01(reductionMultiplicands, tmp);
|
305
|
+
tmp = V128_And(tmp, mask);
|
306
|
+
tmp = V128_PMulLow(reductionMultiplicands, tmp);
|
307
|
+
|
308
|
+
fullCRC = V128_Xor(tmp, fullCRC);
|
309
|
+
|
310
|
+
return static_cast<uint64_t>(V128_Extract32<1>(fullCRC));
|
311
|
+
}
|
312
|
+
|
313
|
+
// Update crc with 64 bytes of data from p.
|
314
|
+
ABSL_ATTRIBUTE_ALWAYS_INLINE uint64_t Process64BytesCRC(const uint8_t* p,
|
315
|
+
uint64_t crc) const {
|
316
|
+
for (int i = 0; i < 8; i++) {
|
317
|
+
crc =
|
318
|
+
CRC32_u64(static_cast<uint32_t>(crc), absl::little_endian::Load64(p));
|
319
|
+
p += 8;
|
320
|
+
}
|
321
|
+
return crc;
|
322
|
+
}
|
323
|
+
|
324
|
+
// Generated by crc32c_x86_test --crc32c_generate_constants=true
|
325
|
+
// and verified against constants in linux kernel for S390:
|
326
|
+
// https://github.com/torvalds/linux/blob/master/arch/s390/crypto/crc32le-vx.S
|
327
|
+
alignas(16) static constexpr uint64_t k1k2[2] = {0x0740eef02, 0x09e4addf8};
|
328
|
+
alignas(16) static constexpr uint64_t k3k4[2] = {0x1384aa63a, 0x0ba4fc28e};
|
329
|
+
alignas(16) static constexpr uint64_t k5k6[2] = {0x0f20c0dfe, 0x14cd00bd6};
|
330
|
+
alignas(16) static constexpr uint64_t k7k0[2] = {0x0dd45aab8, 0x000000000};
|
331
|
+
alignas(16) static constexpr uint64_t kPoly[2] = {0x105ec76f0, 0x0dea713f1};
|
332
|
+
alignas(16) static constexpr uint32_t kMask[4] = {~0u, 0u, ~0u, 0u};
|
333
|
+
|
334
|
+
// Medium runs of bytes are broken into groups of kGroupsSmall blocks of same
|
335
|
+
// size. Each group is CRCed in parallel then combined at the end of the
|
336
|
+
// block.
|
337
|
+
static constexpr size_t kGroupsSmall = 3;
|
338
|
+
// For large runs we use up to kMaxStreams blocks computed with CRC
|
339
|
+
// instruction, and up to kMaxStreams blocks computed with PCLMULQDQ, which
|
340
|
+
// are combined in the end.
|
341
|
+
static constexpr size_t kMaxStreams = 3;
|
342
|
+
};
|
343
|
+
|
344
|
+
#ifdef ABSL_INTERNAL_NEED_REDUNDANT_CONSTEXPR_DECL
|
345
|
+
alignas(16) constexpr uint64_t
|
346
|
+
CRC32AcceleratedX86ARMCombinedMultipleStreamsBase::k1k2[2];
|
347
|
+
alignas(16) constexpr uint64_t
|
348
|
+
CRC32AcceleratedX86ARMCombinedMultipleStreamsBase::k3k4[2];
|
349
|
+
alignas(16) constexpr uint64_t
|
350
|
+
CRC32AcceleratedX86ARMCombinedMultipleStreamsBase::k5k6[2];
|
351
|
+
alignas(16) constexpr uint64_t
|
352
|
+
CRC32AcceleratedX86ARMCombinedMultipleStreamsBase::k7k0[2];
|
353
|
+
alignas(16) constexpr uint64_t
|
354
|
+
CRC32AcceleratedX86ARMCombinedMultipleStreamsBase::kPoly[2];
|
355
|
+
alignas(16) constexpr uint32_t
|
356
|
+
CRC32AcceleratedX86ARMCombinedMultipleStreamsBase::kMask[4];
|
357
|
+
constexpr size_t
|
358
|
+
CRC32AcceleratedX86ARMCombinedMultipleStreamsBase::kGroupsSmall;
|
359
|
+
constexpr size_t CRC32AcceleratedX86ARMCombinedMultipleStreamsBase::kMaxStreams;
|
360
|
+
#endif // ABSL_INTERNAL_NEED_REDUNDANT_CONSTEXPR_DECL
|
361
|
+
|
362
|
+
template <size_t num_crc_streams, size_t num_pclmul_streams,
|
363
|
+
CutoffStrategy strategy>
|
364
|
+
class CRC32AcceleratedX86ARMCombinedMultipleStreams
|
365
|
+
: public CRC32AcceleratedX86ARMCombinedMultipleStreamsBase {
|
366
|
+
ABSL_ATTRIBUTE_HOT
|
367
|
+
void Extend(uint32_t* crc, const void* bytes, size_t length) const override {
|
368
|
+
static_assert(num_crc_streams >= 1 && num_crc_streams <= kMaxStreams,
|
369
|
+
"Invalid number of crc streams");
|
370
|
+
static_assert(num_pclmul_streams >= 0 && num_pclmul_streams <= kMaxStreams,
|
371
|
+
"Invalid number of pclmul streams");
|
372
|
+
const uint8_t* p = static_cast<const uint8_t*>(bytes);
|
373
|
+
const uint8_t* e = p + length;
|
374
|
+
uint32_t l = *crc;
|
375
|
+
uint64_t l64;
|
376
|
+
|
377
|
+
// We have dedicated instruction for 1,2,4 and 8 bytes.
|
378
|
+
if (length & 8) {
|
379
|
+
ABSL_INTERNAL_STEP8(l, p);
|
380
|
+
length &= ~size_t{8};
|
381
|
+
}
|
382
|
+
if (length & 4) {
|
383
|
+
ABSL_INTERNAL_STEP4(l);
|
384
|
+
length &= ~size_t{4};
|
385
|
+
}
|
386
|
+
if (length & 2) {
|
387
|
+
ABSL_INTERNAL_STEP2(l);
|
388
|
+
length &= ~size_t{2};
|
389
|
+
}
|
390
|
+
if (length & 1) {
|
391
|
+
ABSL_INTERNAL_STEP1(l);
|
392
|
+
length &= ~size_t{1};
|
393
|
+
}
|
394
|
+
if (length == 0) {
|
395
|
+
*crc = l;
|
396
|
+
return;
|
397
|
+
}
|
398
|
+
// length is now multiple of 16.
|
399
|
+
|
400
|
+
// For small blocks just run simple loop, because cost of combining multiple
|
401
|
+
// streams is significant.
|
402
|
+
if (strategy != CutoffStrategy::Unroll64CRC) {
|
403
|
+
if (length < kSmallCutoff) {
|
404
|
+
while (length >= 16) {
|
405
|
+
ABSL_INTERNAL_STEP8(l, p);
|
406
|
+
ABSL_INTERNAL_STEP8(l, p);
|
407
|
+
length -= 16;
|
408
|
+
}
|
409
|
+
*crc = l;
|
410
|
+
return;
|
411
|
+
}
|
412
|
+
}
|
413
|
+
|
414
|
+
// For medium blocks we run 3 crc streams and combine them as described in
|
415
|
+
// Intel paper above. Running 4th stream doesn't help, because crc
|
416
|
+
// instruction has latency 3 and throughput 1.
|
417
|
+
if (length < kMediumCutoff) {
|
418
|
+
l64 = l;
|
419
|
+
if (strategy == CutoffStrategy::Fold3) {
|
420
|
+
uint64_t l641 = 0;
|
421
|
+
uint64_t l642 = 0;
|
422
|
+
const size_t blockSize = 32;
|
423
|
+
size_t bs = static_cast<size_t>(e - p) / kGroupsSmall / blockSize;
|
424
|
+
const uint8_t* p1 = p + bs * blockSize;
|
425
|
+
const uint8_t* p2 = p1 + bs * blockSize;
|
426
|
+
|
427
|
+
for (size_t i = 0; i + 1 < bs; ++i) {
|
428
|
+
ABSL_INTERNAL_STEP8BY3(l64, l641, l642, p, p1, p2);
|
429
|
+
ABSL_INTERNAL_STEP8BY3(l64, l641, l642, p, p1, p2);
|
430
|
+
ABSL_INTERNAL_STEP8BY3(l64, l641, l642, p, p1, p2);
|
431
|
+
ABSL_INTERNAL_STEP8BY3(l64, l641, l642, p, p1, p2);
|
432
|
+
base_internal::PrefetchT0(
|
433
|
+
reinterpret_cast<const char*>(p + kPrefetchHorizonMedium));
|
434
|
+
base_internal::PrefetchT0(
|
435
|
+
reinterpret_cast<const char*>(p1 + kPrefetchHorizonMedium));
|
436
|
+
base_internal::PrefetchT0(
|
437
|
+
reinterpret_cast<const char*>(p2 + kPrefetchHorizonMedium));
|
438
|
+
}
|
439
|
+
// Don't run crc on last 8 bytes.
|
440
|
+
ABSL_INTERNAL_STEP8BY3(l64, l641, l642, p, p1, p2);
|
441
|
+
ABSL_INTERNAL_STEP8BY3(l64, l641, l642, p, p1, p2);
|
442
|
+
ABSL_INTERNAL_STEP8BY3(l64, l641, l642, p, p1, p2);
|
443
|
+
ABSL_INTERNAL_STEP8BY2(l64, l641, p, p1);
|
444
|
+
|
445
|
+
V128 magic = *(reinterpret_cast<const V128*>(kClmulConstants) + bs - 1);
|
446
|
+
|
447
|
+
V128 tmp = V128_From2x64(0, l64);
|
448
|
+
|
449
|
+
V128 res1 = V128_PMulLow(tmp, magic);
|
450
|
+
|
451
|
+
tmp = V128_From2x64(0, l641);
|
452
|
+
|
453
|
+
V128 res2 = V128_PMul10(tmp, magic);
|
454
|
+
V128 x = V128_Xor(res1, res2);
|
455
|
+
l64 = static_cast<uint64_t>(V128_Low64(x)) ^
|
456
|
+
absl::little_endian::Load64(p2);
|
457
|
+
l64 = CRC32_u64(static_cast<uint32_t>(l642), l64);
|
458
|
+
|
459
|
+
p = p2 + 8;
|
460
|
+
} else if (strategy == CutoffStrategy::Unroll64CRC) {
|
461
|
+
while ((e - p) >= 64) {
|
462
|
+
l64 = Process64BytesCRC(p, l64);
|
463
|
+
p += 64;
|
464
|
+
}
|
465
|
+
}
|
466
|
+
} else {
|
467
|
+
// There is a lot of data, we can ignore combine costs and run all
|
468
|
+
// requested streams (num_crc_streams + num_pclmul_streams),
|
469
|
+
// using prefetch. CRC and PCLMULQDQ use different cpu execution units,
|
470
|
+
// so on some cpus it makes sense to execute both of them for different
|
471
|
+
// streams.
|
472
|
+
|
473
|
+
// Point x at first 8-byte aligned byte in string.
|
474
|
+
const uint8_t* x = RoundUp<8>(p);
|
475
|
+
// Process bytes until p is 8-byte aligned, if that isn't past the end.
|
476
|
+
while (p != x) {
|
477
|
+
ABSL_INTERNAL_STEP1(l);
|
478
|
+
}
|
479
|
+
|
480
|
+
size_t bs = static_cast<size_t>(e - p) /
|
481
|
+
(num_crc_streams + num_pclmul_streams) / 64;
|
482
|
+
const uint8_t* crc_streams[kMaxStreams];
|
483
|
+
const uint8_t* pclmul_streams[kMaxStreams];
|
484
|
+
// We are guaranteed to have at least one crc stream.
|
485
|
+
crc_streams[0] = p;
|
486
|
+
for (size_t i = 1; i < num_crc_streams; i++) {
|
487
|
+
crc_streams[i] = crc_streams[i - 1] + bs * 64;
|
488
|
+
}
|
489
|
+
pclmul_streams[0] = crc_streams[num_crc_streams - 1] + bs * 64;
|
490
|
+
for (size_t i = 1; i < num_pclmul_streams; i++) {
|
491
|
+
pclmul_streams[i] = pclmul_streams[i - 1] + bs * 64;
|
492
|
+
}
|
493
|
+
|
494
|
+
// Per stream crc sums.
|
495
|
+
uint64_t l64_crc[kMaxStreams] = {l};
|
496
|
+
uint64_t l64_pclmul[kMaxStreams] = {0};
|
497
|
+
|
498
|
+
// Peel first iteration, because PCLMULQDQ stream, needs setup.
|
499
|
+
for (size_t i = 0; i < num_crc_streams; i++) {
|
500
|
+
l64_crc[i] = Process64BytesCRC(crc_streams[i], l64_crc[i]);
|
501
|
+
crc_streams[i] += 16 * 4;
|
502
|
+
}
|
503
|
+
|
504
|
+
V128 partialCRC[kMaxStreams][4];
|
505
|
+
for (size_t i = 0; i < num_pclmul_streams; i++) {
|
506
|
+
partialCRC[i][0] = V128_LoadU(
|
507
|
+
reinterpret_cast<const V128*>(pclmul_streams[i] + 16 * 0));
|
508
|
+
partialCRC[i][1] = V128_LoadU(
|
509
|
+
reinterpret_cast<const V128*>(pclmul_streams[i] + 16 * 1));
|
510
|
+
partialCRC[i][2] = V128_LoadU(
|
511
|
+
reinterpret_cast<const V128*>(pclmul_streams[i] + 16 * 2));
|
512
|
+
partialCRC[i][3] = V128_LoadU(
|
513
|
+
reinterpret_cast<const V128*>(pclmul_streams[i] + 16 * 3));
|
514
|
+
pclmul_streams[i] += 16 * 4;
|
515
|
+
}
|
516
|
+
|
517
|
+
for (size_t i = 1; i < bs; i++) {
|
518
|
+
// Prefetch data for next itterations.
|
519
|
+
for (size_t j = 0; j < num_crc_streams; j++) {
|
520
|
+
base_internal::PrefetchT0(
|
521
|
+
reinterpret_cast<const char*>(crc_streams[j] + kPrefetchHorizon));
|
522
|
+
}
|
523
|
+
for (size_t j = 0; j < num_pclmul_streams; j++) {
|
524
|
+
base_internal::PrefetchT0(reinterpret_cast<const char*>(
|
525
|
+
pclmul_streams[j] + kPrefetchHorizon));
|
526
|
+
}
|
527
|
+
|
528
|
+
// We process each stream in 64 byte blocks. This can be written as
|
529
|
+
// for (int i = 0; i < num_pclmul_streams; i++) {
|
530
|
+
// Process64BytesPclmul(pclmul_streams[i], partialCRC[i]);
|
531
|
+
// pclmul_streams[i] += 16 * 4;
|
532
|
+
// }
|
533
|
+
// for (int i = 0; i < num_crc_streams; i++) {
|
534
|
+
// l64_crc[i] = Process64BytesCRC(crc_streams[i], l64_crc[i]);
|
535
|
+
// crc_streams[i] += 16*4;
|
536
|
+
// }
|
537
|
+
// But unrolling and interleaving PCLMULQDQ and CRC blocks manually
|
538
|
+
// gives ~2% performance boost.
|
539
|
+
l64_crc[0] = Process64BytesCRC(crc_streams[0], l64_crc[0]);
|
540
|
+
crc_streams[0] += 16 * 4;
|
541
|
+
if (num_pclmul_streams > 0) {
|
542
|
+
Process64BytesPclmul(pclmul_streams[0], partialCRC[0]);
|
543
|
+
pclmul_streams[0] += 16 * 4;
|
544
|
+
}
|
545
|
+
if (num_crc_streams > 1) {
|
546
|
+
l64_crc[1] = Process64BytesCRC(crc_streams[1], l64_crc[1]);
|
547
|
+
crc_streams[1] += 16 * 4;
|
548
|
+
}
|
549
|
+
if (num_pclmul_streams > 1) {
|
550
|
+
Process64BytesPclmul(pclmul_streams[1], partialCRC[1]);
|
551
|
+
pclmul_streams[1] += 16 * 4;
|
552
|
+
}
|
553
|
+
if (num_crc_streams > 2) {
|
554
|
+
l64_crc[2] = Process64BytesCRC(crc_streams[2], l64_crc[2]);
|
555
|
+
crc_streams[2] += 16 * 4;
|
556
|
+
}
|
557
|
+
if (num_pclmul_streams > 2) {
|
558
|
+
Process64BytesPclmul(pclmul_streams[2], partialCRC[2]);
|
559
|
+
pclmul_streams[2] += 16 * 4;
|
560
|
+
}
|
561
|
+
}
|
562
|
+
|
563
|
+
// PCLMULQDQ based streams require special final step;
|
564
|
+
// CRC based don't.
|
565
|
+
for (size_t i = 0; i < num_pclmul_streams; i++) {
|
566
|
+
l64_pclmul[i] = FinalizePclmulStream(partialCRC[i]);
|
567
|
+
}
|
568
|
+
|
569
|
+
// Combine all streams into single result.
|
570
|
+
uint32_t magic = ComputeZeroConstant(bs * 64);
|
571
|
+
l64 = l64_crc[0];
|
572
|
+
for (size_t i = 1; i < num_crc_streams; i++) {
|
573
|
+
l64 = multiply(static_cast<uint32_t>(l64), magic);
|
574
|
+
l64 ^= l64_crc[i];
|
575
|
+
}
|
576
|
+
for (size_t i = 0; i < num_pclmul_streams; i++) {
|
577
|
+
l64 = multiply(static_cast<uint32_t>(l64), magic);
|
578
|
+
l64 ^= l64_pclmul[i];
|
579
|
+
}
|
580
|
+
|
581
|
+
// Update p.
|
582
|
+
if (num_pclmul_streams > 0) {
|
583
|
+
p = pclmul_streams[num_pclmul_streams - 1];
|
584
|
+
} else {
|
585
|
+
p = crc_streams[num_crc_streams - 1];
|
586
|
+
}
|
587
|
+
}
|
588
|
+
l = static_cast<uint32_t>(l64);
|
589
|
+
|
590
|
+
while ((e - p) >= 16) {
|
591
|
+
ABSL_INTERNAL_STEP8(l, p);
|
592
|
+
ABSL_INTERNAL_STEP8(l, p);
|
593
|
+
}
|
594
|
+
// Process the last few bytes
|
595
|
+
while (p != e) {
|
596
|
+
ABSL_INTERNAL_STEP1(l);
|
597
|
+
}
|
598
|
+
|
599
|
+
#undef ABSL_INTERNAL_STEP8BY3
|
600
|
+
#undef ABSL_INTERNAL_STEP8BY2
|
601
|
+
#undef ABSL_INTERNAL_STEP8
|
602
|
+
#undef ABSL_INTERNAL_STEP4
|
603
|
+
#undef ABSL_INTERNAL_STEP2
|
604
|
+
#undef ABSL_INTERNAL_STEP1
|
605
|
+
|
606
|
+
*crc = l;
|
607
|
+
}
|
608
|
+
};
|
609
|
+
|
610
|
+
} // namespace
|
611
|
+
|
612
|
+
// Intel processors with SSE4.2 have an instruction for one particular
|
613
|
+
// 32-bit CRC polynomial: crc32c
|
614
|
+
CRCImpl* TryNewCRC32AcceleratedX86ARMCombined() {
|
615
|
+
CpuType type = GetCpuType();
|
616
|
+
switch (type) {
|
617
|
+
case CpuType::kIntelHaswell:
|
618
|
+
case CpuType::kAmdRome:
|
619
|
+
case CpuType::kAmdNaples:
|
620
|
+
case CpuType::kAmdMilan:
|
621
|
+
return new CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
622
|
+
3, 1, CutoffStrategy::Fold3>();
|
623
|
+
// PCLMULQDQ is fast, use combined PCLMULQDQ + CRC implementation.
|
624
|
+
case CpuType::kIntelCascadelakeXeon:
|
625
|
+
case CpuType::kIntelSkylakeXeon:
|
626
|
+
case CpuType::kIntelBroadwell:
|
627
|
+
case CpuType::kIntelSkylake:
|
628
|
+
return new CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
629
|
+
3, 2, CutoffStrategy::Fold3>();
|
630
|
+
// PCLMULQDQ is slow, don't use it.
|
631
|
+
case CpuType::kIntelIvybridge:
|
632
|
+
case CpuType::kIntelSandybridge:
|
633
|
+
case CpuType::kIntelWestmere:
|
634
|
+
return new CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
635
|
+
3, 0, CutoffStrategy::Fold3>();
|
636
|
+
case CpuType::kArmNeoverseN1:
|
637
|
+
return new CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
638
|
+
1, 1, CutoffStrategy::Unroll64CRC>();
|
639
|
+
#if defined(__aarch64__)
|
640
|
+
default:
|
641
|
+
// Not all ARM processors support the needed instructions, so check here
|
642
|
+
// before trying to use an accelerated implementation.
|
643
|
+
if (SupportsArmCRC32PMULL()) {
|
644
|
+
return new CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
645
|
+
1, 1, CutoffStrategy::Unroll64CRC>();
|
646
|
+
} else {
|
647
|
+
return nullptr;
|
648
|
+
}
|
649
|
+
#else
|
650
|
+
default:
|
651
|
+
// Something else, play it safe and assume slow PCLMULQDQ.
|
652
|
+
return new CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
653
|
+
3, 0, CutoffStrategy::Fold3>();
|
654
|
+
#endif
|
655
|
+
}
|
656
|
+
}
|
657
|
+
|
658
|
+
std::vector<std::unique_ptr<CRCImpl>> NewCRC32AcceleratedX86ARMCombinedAll() {
|
659
|
+
auto ret = std::vector<std::unique_ptr<CRCImpl>>();
|
660
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
661
|
+
1, 0, CutoffStrategy::Fold3>>());
|
662
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
663
|
+
1, 1, CutoffStrategy::Fold3>>());
|
664
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
665
|
+
1, 2, CutoffStrategy::Fold3>>());
|
666
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
667
|
+
1, 3, CutoffStrategy::Fold3>>());
|
668
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
669
|
+
2, 0, CutoffStrategy::Fold3>>());
|
670
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
671
|
+
2, 1, CutoffStrategy::Fold3>>());
|
672
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
673
|
+
2, 2, CutoffStrategy::Fold3>>());
|
674
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
675
|
+
2, 3, CutoffStrategy::Fold3>>());
|
676
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
677
|
+
3, 0, CutoffStrategy::Fold3>>());
|
678
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
679
|
+
3, 1, CutoffStrategy::Fold3>>());
|
680
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
681
|
+
3, 2, CutoffStrategy::Fold3>>());
|
682
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
683
|
+
3, 3, CutoffStrategy::Fold3>>());
|
684
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
685
|
+
1, 0, CutoffStrategy::Unroll64CRC>>());
|
686
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
687
|
+
1, 1, CutoffStrategy::Unroll64CRC>>());
|
688
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
689
|
+
1, 2, CutoffStrategy::Unroll64CRC>>());
|
690
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
691
|
+
1, 3, CutoffStrategy::Unroll64CRC>>());
|
692
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
693
|
+
2, 0, CutoffStrategy::Unroll64CRC>>());
|
694
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
695
|
+
2, 1, CutoffStrategy::Unroll64CRC>>());
|
696
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
697
|
+
2, 2, CutoffStrategy::Unroll64CRC>>());
|
698
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
699
|
+
2, 3, CutoffStrategy::Unroll64CRC>>());
|
700
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
701
|
+
3, 0, CutoffStrategy::Unroll64CRC>>());
|
702
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
703
|
+
3, 1, CutoffStrategy::Unroll64CRC>>());
|
704
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
705
|
+
3, 2, CutoffStrategy::Unroll64CRC>>());
|
706
|
+
ret.push_back(absl::make_unique<CRC32AcceleratedX86ARMCombinedMultipleStreams<
|
707
|
+
3, 3, CutoffStrategy::Unroll64CRC>>());
|
708
|
+
|
709
|
+
return ret;
|
710
|
+
}
|
711
|
+
|
712
|
+
#else // !ABSL_INTERNAL_CAN_USE_SIMD_CRC32C
|
713
|
+
|
714
|
+
std::vector<std::unique_ptr<CRCImpl>> NewCRC32AcceleratedX86ARMCombinedAll() {
|
715
|
+
return std::vector<std::unique_ptr<CRCImpl>>();
|
716
|
+
}
|
717
|
+
|
718
|
+
// no hardware acceleration available
|
719
|
+
CRCImpl* TryNewCRC32AcceleratedX86ARMCombined() { return nullptr; }
|
720
|
+
|
721
|
+
#endif
|
722
|
+
|
723
|
+
} // namespace crc_internal
|
724
|
+
ABSL_NAMESPACE_END
|
725
|
+
} // namespace absl
|