25 #ifndef GRPC_CORE_LIB_IOMGR_INTERNAL_ERRQUEUE_H 26 #define GRPC_CORE_LIB_IOMGR_INTERNAL_ERRQUEUE_H 32 #ifdef GRPC_POSIX_SOCKET_TCP 34 #include <sys/types.h> 37 #ifdef GRPC_LINUX_ERRQUEUE 38 #include <linux/errqueue.h> 39 #include <linux/net_tstamp.h> 40 #include <linux/netlink.h> 41 #include <sys/socket.h> 46 #ifdef GRPC_LINUX_ERRQUEUE 50 struct scm_timestamping {
51 struct timespec ts[3];
55 constexpr
int SCM_TSTAMP_SND = 0;
57 constexpr
int SCM_TSTAMP_SCHED = 1;
59 constexpr
int SCM_TSTAMP_ACK = 2;
62 #ifndef SCM_TIMESTAMPING_OPT_STATS 63 #define SCM_TIMESTAMPING_OPT_STATS 54 67 constexpr uint32_t SOF_TIMESTAMPING_TX_SOFTWARE = 1u << 1;
68 constexpr uint32_t SOF_TIMESTAMPING_SOFTWARE = 1u << 4;
69 constexpr uint32_t SOF_TIMESTAMPING_OPT_ID = 1u << 7;
70 constexpr uint32_t SOF_TIMESTAMPING_TX_SCHED = 1u << 8;
71 constexpr uint32_t SOF_TIMESTAMPING_TX_ACK = 1u << 9;
72 constexpr uint32_t SOF_TIMESTAMPING_OPT_TSONLY = 1u << 11;
73 constexpr uint32_t SOF_TIMESTAMPING_OPT_STATS = 1u << 12;
75 constexpr uint32_t kTimestampingSocketOptions =
76 SOF_TIMESTAMPING_SOFTWARE | SOF_TIMESTAMPING_OPT_ID |
77 SOF_TIMESTAMPING_OPT_TSONLY | SOF_TIMESTAMPING_OPT_STATS;
78 constexpr uint32_t kTimestampingRecordingOptions =
79 SOF_TIMESTAMPING_TX_SCHED | SOF_TIMESTAMPING_TX_SOFTWARE |
80 SOF_TIMESTAMPING_TX_ACK;
87 TCP_NLA_SNDBUF_LIMITED,
88 TCP_NLA_DATA_SEGS_OUT,
89 TCP_NLA_TOTAL_RETRANS,
91 TCP_NLA_DELIVERY_RATE,
95 TCP_NLA_RECUR_RETRANS,
96 TCP_NLA_DELIVERY_RATE_APP_LMT,
101 TCP_NLA_DELIVERED_CE,
103 TCP_NLA_BYTES_RETRANS,
112 uint8_t tcpi_ca_state;
113 uint8_t tcpi_retransmits;
115 uint8_t tcpi_backoff;
116 uint8_t tcpi_options;
117 uint8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
118 uint8_t tcpi_delivery_rate_app_limited : 1;
121 uint32_t tcpi_snd_mss;
122 uint32_t tcpi_rcv_mss;
123 uint32_t tcpi_unacked;
124 uint32_t tcpi_sacked;
126 uint32_t tcpi_retrans;
127 uint32_t tcpi_fackets;
129 uint32_t tcpi_last_data_sent;
130 uint32_t tcpi_last_ack_sent;
131 uint32_t tcpi_last_data_recv;
132 uint32_t tcpi_last_ack_recv;
135 uint32_t tcpi_rcv_ssthresh;
137 uint32_t tcpi_rttvar;
138 uint32_t tcpi_snd_ssthresh;
139 uint32_t tcpi_snd_cwnd;
140 uint32_t tcpi_advmss;
141 uint32_t tcpi_reordering;
142 uint32_t tcpi_rcv_rtt;
143 uint32_t tcpi_rcv_space;
144 uint32_t tcpi_total_retrans;
145 uint64_t tcpi_pacing_rate;
146 uint64_t tcpi_max_pacing_rate;
147 uint64_t tcpi_bytes_acked;
148 uint64_t tcpi_bytes_received;
150 uint32_t tcpi_segs_out;
151 uint32_t tcpi_segs_in;
152 uint32_t tcpi_notsent_bytes;
153 uint32_t tcpi_min_rtt;
155 uint32_t tcpi_data_segs_in;
156 uint32_t tcpi_data_segs_out;
158 uint64_t tcpi_delivery_rate;
159 uint64_t tcpi_busy_time;
160 uint64_t tcpi_rwnd_limited;
161 uint64_t tcpi_sndbuf_limited;
163 uint32_t tcpi_delivered;
164 uint32_t tcpi_delivered_ce;
165 uint64_t tcpi_bytes_sent;
166 uint64_t tcpi_bytes_retrans;
167 uint32_t tcpi_dsack_dups;
168 uint32_t tcpi_reord_seen;
180 bool kernel_supports_errqueue();
Internal thread interface.
Definition: backoff.h:26
void grpc_errqueue_init()