xref: /linux/Documentation/networking/net_cachelines/tcp_sock.rst (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1.. SPDX-License-Identifier: GPL-2.0
2.. Copyright (C) 2023 Google LLC
3
4=========================================
5tcp_sock struct fast path usage breakdown
6=========================================
7
8Type                          Name                    fastpath_tx_access  fastpath_rx_access  Comments
9..struct                      ..tcp_sock
10struct_inet_connection_sock   inet_conn
11u16                           tcp_header_len          read_mostly         read_mostly         tcp_bound_to_half_wnd,tcp_current_mss(tx);tcp_rcv_established(rx)
12u16                           gso_segs                read_mostly         -                   tcp_xmit_size_goal
13__be32                        pred_flags              read_write          read_mostly         tcp_select_window(tx);tcp_rcv_established(rx)
14u64                           bytes_received          -                   read_write          tcp_rcv_nxt_update(rx)
15u32                           segs_in                 -                   read_write          tcp_v6_rcv(rx)
16u32                           data_segs_in            -                   read_write          tcp_v6_rcv(rx)
17u32                           rcv_nxt                 read_mostly         read_write          tcp_cleanup_rbuf,tcp_send_ack,tcp_inq_hint,tcp_transmit_skb,tcp_receive_window(tx);tcp_v6_do_rcv,tcp_rcv_established,tcp_data_queue,tcp_receive_window,tcp_rcv_nxt_update(write)(rx)
18u32                           copied_seq              -                   read_mostly         tcp_cleanup_rbuf,tcp_rcv_space_adjust,tcp_inq_hint
19u32                           rcv_wup                 -                   read_write          __tcp_cleanup_rbuf,tcp_receive_window,tcp_receive_established
20u32                           snd_nxt                 read_write          read_mostly         tcp_rate_check_app_limited,__tcp_transmit_skb,tcp_event_new_data_sent(write)(tx);tcp_rcv_established,tcp_ack,tcp_clean_rtx_queue(rx)
21u32                           segs_out                read_write          -                   __tcp_transmit_skb
22u32                           data_segs_out           read_write          -                   __tcp_transmit_skb,tcp_update_skb_after_send
23u64                           bytes_sent              read_write          -                   __tcp_transmit_skb
24u64                           bytes_acked             -                   read_write          tcp_snd_una_update/tcp_ack
25u32                           dsack_dups
26u32                           snd_una                 read_mostly         read_write          tcp_wnd_end,tcp_urg_mode,tcp_minshall_check,tcp_cwnd_validate(tx);tcp_ack,tcp_may_update_window,tcp_clean_rtx_queue(write),tcp_ack_tstamp(rx)
27u32                           snd_sml                 read_write          -                   tcp_minshall_check,tcp_minshall_update
28u32                           rcv_tstamp              -                   read_mostly         tcp_ack
29u32                           lsndtime                read_write          -                   tcp_slow_start_after_idle_check,tcp_event_data_sent
30u32                           last_oow_ack_time
31u32                           compressed_ack_rcv_nxt
32u32                           tsoffset                read_mostly         read_mostly         tcp_established_options(tx);tcp_fast_parse_options(rx)
33struct_list_head              tsq_node                -                   -
34struct_list_head              tsorted_sent_queue      read_write          -                   tcp_update_skb_after_send
35u32                           snd_wl1                 -                   read_mostly         tcp_may_update_window
36u32                           snd_wnd                 read_mostly         read_mostly         tcp_wnd_end,tcp_tso_should_defer(tx);tcp_fast_path_on(rx)
37u32                           max_window              read_mostly         -                   tcp_bound_to_half_wnd,forced_push
38u32                           mss_cache               read_mostly         read_mostly         tcp_rate_check_app_limited,tcp_current_mss,tcp_sync_mss,tcp_sndbuf_expand,tcp_tso_should_defer(tx);tcp_update_pacing_rate,tcp_clean_rtx_queue(rx)
39u32                           window_clamp            read_mostly         read_write          tcp_rcv_space_adjust,__tcp_select_window
40u32                           rcv_ssthresh            read_mostly         -                   __tcp_select_window
41u8                            scaling_ratio           read_mostly         read_mostly         tcp_win_from_space
42struct                        tcp_rack
43u16                           advmss                  -                   read_mostly         tcp_rcv_space_adjust
44u8                            compressed_ack
45u8:2                          dup_ack_counter
46u8:1                          tlp_retrans
47u8:1                          tcp_usec_ts             read_mostly         read_mostly
48u32                           chrono_start            read_write          -                   tcp_chrono_start/stop(tcp_write_xmit,tcp_cwnd_validate,tcp_send_syn_data)
49u32[3]                        chrono_stat             read_write          -                   tcp_chrono_start/stop(tcp_write_xmit,tcp_cwnd_validate,tcp_send_syn_data)
50u8:2                          chrono_type             read_write          -                   tcp_chrono_start/stop(tcp_write_xmit,tcp_cwnd_validate,tcp_send_syn_data)
51u8:1                          rate_app_limited        -                   read_write          tcp_rate_gen
52u8:1                          fastopen_connect
53u8:1                          fastopen_no_cookie
54u8:1                          is_sack_reneg           -                   read_mostly         tcp_skb_entail,tcp_ack
55u8:2                          fastopen_client_fail
56u8:4                          nonagle                 read_write          -                   tcp_skb_entail,tcp_push_pending_frames
57u8:1                          thin_lto
58u8:1                          recvmsg_inq
59u8:1                          repair                  read_mostly         -                   tcp_write_xmit
60u8:1                          frto
61u8                            repair_queue            -                   -
62u8:2                          save_syn
63u8:1                          syn_data
64u8:1                          syn_fastopen
65u8:1                          syn_fastopen_exp
66u8:1                          syn_fastopen_ch
67u8:1                          syn_data_acked
68u8:1                          is_cwnd_limited         read_mostly         -                   tcp_cwnd_validate,tcp_is_cwnd_limited
69u32                           tlp_high_seq            -                   read_mostly         tcp_ack
70u32                           tcp_tx_delay
71u64                           tcp_wstamp_ns           read_write          -                   tcp_pacing_check,tcp_tso_should_defer,tcp_update_skb_after_send
72u64                           tcp_clock_cache         read_write          read_write          tcp_mstamp_refresh(tcp_write_xmit/tcp_rcv_space_adjust),__tcp_transmit_skb,tcp_tso_should_defer;timer
73u64                           tcp_mstamp              read_write          read_write          tcp_mstamp_refresh(tcp_write_xmit/tcp_rcv_space_adjust)(tx);tcp_rcv_space_adjust,tcp_rate_gen,tcp_clean_rtx_queue,tcp_ack_update_rtt/tcp_time_stamp(rx);timer
74u32                           srtt_us                 read_mostly         read_write          tcp_tso_should_defer(tx);tcp_update_pacing_rate,__tcp_set_rto,tcp_rtt_estimator(rx)
75u32                           mdev_us                 read_write          -                   tcp_rtt_estimator
76u32                           mdev_max_us
77u32                           rttvar_us               -                   read_mostly         __tcp_set_rto
78u32                           rtt_seq                 read_write                              tcp_rtt_estimator
79struct_minmax                 rtt_min                 -                   read_mostly         tcp_min_rtt/tcp_rate_gen,tcp_min_rtttcp_update_rtt_min
80u32                           packets_out             read_write          read_write          tcp_packets_in_flight(tx/rx);tcp_slow_start_after_idle_check,tcp_nagle_check,tcp_rate_skb_sent,tcp_event_new_data_sent,tcp_cwnd_validate,tcp_write_xmit(tx);tcp_ack,tcp_clean_rtx_queue,tcp_update_pacing_rate(rx)
81u32                           retrans_out             -                   read_mostly         tcp_packets_in_flight,tcp_rate_check_app_limited
82u32                           max_packets_out         -                   read_write          tcp_cwnd_validate
83u32                           cwnd_usage_seq          -                   read_write          tcp_cwnd_validate
84u16                           urg_data                -                   read_mostly         tcp_fast_path_check
85u8                            ecn_flags               read_write          -                   tcp_ecn_send
86u8                            keepalive_probes
87u32                           reordering              read_mostly         -                   tcp_sndbuf_expand
88u32                           reord_seen
89u32                           snd_up                  read_write          read_mostly         tcp_mark_urg,tcp_urg_mode,__tcp_transmit_skb(tx);tcp_clean_rtx_queue(rx)
90struct_tcp_options_received   rx_opt                  read_mostly         read_write          tcp_established_options(tx);tcp_fast_path_on,tcp_ack_update_window,tcp_is_sack,tcp_data_queue,tcp_rcv_established,tcp_ack_update_rtt(rx)
91u32                           snd_ssthresh            -                   read_mostly         tcp_update_pacing_rate
92u32                           snd_cwnd                read_mostly         read_mostly         tcp_snd_cwnd,tcp_rate_check_app_limited,tcp_tso_should_defer(tx);tcp_update_pacing_rate
93u32                           snd_cwnd_cnt
94u32                           snd_cwnd_clamp
95u32                           snd_cwnd_used
96u32                           snd_cwnd_stamp
97u32                           prior_cwnd
98u32                           prr_delivered
99u32                           prr_out                 read_mostly         read_mostly         tcp_rate_skb_sent,tcp_newly_delivered(tx);tcp_ack,tcp_rate_gen,tcp_clean_rtx_queue(rx)
100u32                           delivered               read_mostly         read_write          tcp_rate_skb_sent, tcp_newly_delivered(tx);tcp_ack, tcp_rate_gen, tcp_clean_rtx_queue (rx)
101u32                           delivered_ce            read_mostly         read_write          tcp_rate_skb_sent(tx);tcp_rate_gen(rx)
102u32                           lost                    -                   read_mostly         tcp_ack
103u32                           app_limited             read_write          read_mostly         tcp_rate_check_app_limited,tcp_rate_skb_sent(tx);tcp_rate_gen(rx)
104u64                           first_tx_mstamp         read_write          -                   tcp_rate_skb_sent
105u64                           delivered_mstamp        read_write          -                   tcp_rate_skb_sent
106u32                           rate_delivered          -                   read_mostly         tcp_rate_gen
107u32                           rate_interval_us        -                   read_mostly         rate_delivered,rate_app_limited
108u32                           rcv_wnd                 read_write          read_mostly         tcp_select_window,tcp_receive_window,tcp_fast_path_check
109u32                           write_seq               read_write          -                   tcp_rate_check_app_limited,tcp_write_queue_empty,tcp_skb_entail,forced_push,tcp_mark_push
110u32                           notsent_lowat           read_mostly         -                   tcp_stream_memory_free
111u32                           pushed_seq              read_write          -                   tcp_mark_push,forced_push
112u32                           lost_out                read_mostly         read_mostly         tcp_left_out(tx);tcp_packets_in_flight(tx/rx);tcp_rate_check_app_limited(rx)
113u32                           sacked_out              read_mostly         read_mostly         tcp_left_out(tx);tcp_packets_in_flight(tx/rx);tcp_clean_rtx_queue(rx)
114struct_hrtimer                pacing_timer
115struct_hrtimer                compressed_ack_timer
116struct_sk_buff*               lost_skb_hint           read_mostly                             tcp_clean_rtx_queue
117struct_sk_buff*               retransmit_skb_hint     read_mostly         -                   tcp_clean_rtx_queue
118struct_rb_root                out_of_order_queue      -                   read_mostly         tcp_data_queue,tcp_fast_path_check
119struct_sk_buff*               ooo_last_skb
120struct_tcp_sack_block[1]      duplicate_sack
121struct_tcp_sack_block[4]      selective_acks
122struct_tcp_sack_block[4]      recv_sack_cache
123struct_sk_buff*               highest_sack            read_write          -                   tcp_event_new_data_sent
124int                           lost_cnt_hint
125u32                           prior_ssthresh
126u32                           high_seq
127u32                           retrans_stamp
128u32                           undo_marker
129int                           undo_retrans
130u64                           bytes_retrans
131u32                           total_retrans
132u32                           rto_stamp
133u16                           total_rto
134u16                           total_rto_recoveries
135u32                           total_rto_time
136u32                           urg_seq                 -                   -
137unsigned_int                  keepalive_time
138unsigned_int                  keepalive_intvl
139int                           linger2
140u8                            bpf_sock_ops_cb_flags
141u8:1                          bpf_chg_cc_inprogress
142u16                           timeout_rehash
143u32                           rcv_ooopack
144u32                           rcv_rtt_last_tsecr
145struct                        rcv_rtt_est             -                   read_write          tcp_rcv_space_adjust,tcp_rcv_established
146struct                        rcvq_space              -                   read_write          tcp_rcv_space_adjust
147struct                        mtu_probe
148u32                           plb_rehash
149u32                           mtu_info
150bool                          is_mptcp
151bool                          smc_hs_congested
152bool                          syn_smc
153struct_tcp_sock_af_ops*       af_specific
154struct_tcp_md5sig_info*       md5sig_info
155struct_tcp_fastopen_request*  fastopen_req
156struct_request_sock*          fastopen_rsk
157struct_saved_syn*             saved_syn