]> www.infradead.org Git - users/hch/misc.git/commitdiff
tcp: fast path functions later
authorIlpo Järvinen <ij@kernel.org>
Thu, 11 Sep 2025 11:06:30 +0000 (13:06 +0200)
committerJakub Kicinski <kuba@kernel.org>
Mon, 15 Sep 2025 23:26:33 +0000 (16:26 -0700)
The following patch will use tcp_ecn_mode_accecn(),
TCP_ACCECN_CEP_INIT_OFFSET, TCP_ACCECN_CEP_ACE_MASK in
__tcp_fast_path_on() to make new flag for AccECN.

No functional changes.

Signed-off-by: Ilpo Järvinen <ij@kernel.org>
Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20250911110642.87529-3-chia-yu.chang@nokia-bell-labs.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/tcp.h

index 277914c4d067a83c958af00028cccb46956c693e..e25340459ce4a2896a94053a6398b51270701736 100644 (file)
@@ -821,33 +821,6 @@ static inline u32 __tcp_set_rto(const struct tcp_sock *tp)
        return usecs_to_jiffies((tp->srtt_us >> 3) + tp->rttvar_us);
 }
 
-static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd)
-{
-       /* mptcp hooks are only on the slow path */
-       if (sk_is_mptcp((struct sock *)tp))
-               return;
-
-       tp->pred_flags = htonl((tp->tcp_header_len << 26) |
-                              ntohl(TCP_FLAG_ACK) |
-                              snd_wnd);
-}
-
-static inline void tcp_fast_path_on(struct tcp_sock *tp)
-{
-       __tcp_fast_path_on(tp, tp->snd_wnd >> tp->rx_opt.snd_wscale);
-}
-
-static inline void tcp_fast_path_check(struct sock *sk)
-{
-       struct tcp_sock *tp = tcp_sk(sk);
-
-       if (RB_EMPTY_ROOT(&tp->out_of_order_queue) &&
-           tp->rcv_wnd &&
-           atomic_read(&sk->sk_rmem_alloc) < sk->sk_rcvbuf &&
-           !tp->urg_data)
-               tcp_fast_path_on(tp);
-}
-
 u32 tcp_delack_max(const struct sock *sk);
 
 /* Compute the actual rto_min value */
@@ -1807,6 +1780,33 @@ static inline bool tcp_paws_reject(const struct tcp_options_received *rx_opt,
        return true;
 }
 
+static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd)
+{
+       /* mptcp hooks are only on the slow path */
+       if (sk_is_mptcp((struct sock *)tp))
+               return;
+
+       tp->pred_flags = htonl((tp->tcp_header_len << 26) |
+                              ntohl(TCP_FLAG_ACK) |
+                              snd_wnd);
+}
+
+static inline void tcp_fast_path_on(struct tcp_sock *tp)
+{
+       __tcp_fast_path_on(tp, tp->snd_wnd >> tp->rx_opt.snd_wscale);
+}
+
+static inline void tcp_fast_path_check(struct sock *sk)
+{
+       struct tcp_sock *tp = tcp_sk(sk);
+
+       if (RB_EMPTY_ROOT(&tp->out_of_order_queue) &&
+           tp->rcv_wnd &&
+           atomic_read(&sk->sk_rmem_alloc) < sk->sk_rcvbuf &&
+           !tp->urg_data)
+               tcp_fast_path_on(tp);
+}
+
 bool tcp_oow_rate_limited(struct net *net, const struct sk_buff *skb,
                          int mib_idx, u32 *last_oow_ack_time);