~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/net/mptcp/fastopen.c

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /net/mptcp/fastopen.c (Version linux-6.12-rc7) and /net/mptcp/fastopen.c (Version linux-6.5.13)


  1 // SPDX-License-Identifier: GPL-2.0                 1 // SPDX-License-Identifier: GPL-2.0
  2 /* MPTCP Fast Open Mechanism                        2 /* MPTCP Fast Open Mechanism
  3  *                                                  3  *
  4  * Copyright (c) 2021-2022, Dmytro SHYTYI           4  * Copyright (c) 2021-2022, Dmytro SHYTYI
  5  */                                                 5  */
  6                                                     6 
  7 #include "protocol.h"                               7 #include "protocol.h"
  8                                                     8 
  9 void mptcp_fastopen_subflow_synack_set_params(      9 void mptcp_fastopen_subflow_synack_set_params(struct mptcp_subflow_context *subflow,
 10                                                    10                                               struct request_sock *req)
 11 {                                                  11 {
 12         struct sock *sk, *ssk;                     12         struct sock *sk, *ssk;
 13         struct sk_buff *skb;                       13         struct sk_buff *skb;
 14         struct tcp_sock *tp;                       14         struct tcp_sock *tp;
 15                                                    15 
 16         /* on early fallback the subflow conte     16         /* on early fallback the subflow context is deleted by
 17          * subflow_syn_recv_sock()                 17          * subflow_syn_recv_sock()
 18          */                                        18          */
 19         if (!subflow)                              19         if (!subflow)
 20                 return;                            20                 return;
 21                                                    21 
 22         ssk = subflow->tcp_sock;                   22         ssk = subflow->tcp_sock;
 23         sk = subflow->conn;                        23         sk = subflow->conn;
 24         tp = tcp_sk(ssk);                          24         tp = tcp_sk(ssk);
 25                                                    25 
 26         subflow->is_mptfo = 1;                     26         subflow->is_mptfo = 1;
 27                                                    27 
 28         skb = skb_peek(&ssk->sk_receive_queue)     28         skb = skb_peek(&ssk->sk_receive_queue);
 29         if (WARN_ON_ONCE(!skb))                    29         if (WARN_ON_ONCE(!skb))
 30                 return;                            30                 return;
 31                                                    31 
 32         /* dequeue the skb from sk receive que     32         /* dequeue the skb from sk receive queue */
 33         __skb_unlink(skb, &ssk->sk_receive_que     33         __skb_unlink(skb, &ssk->sk_receive_queue);
 34         skb_ext_reset(skb);                        34         skb_ext_reset(skb);
 35         skb_orphan(skb);                           35         skb_orphan(skb);
 36                                                    36 
 37         /* We copy the fastopen data, but that     37         /* We copy the fastopen data, but that don't belong to the mptcp sequence
 38          * space, need to offset it in the sub     38          * space, need to offset it in the subflow sequence, see mptcp_subflow_get_map_offset()
 39          */                                        39          */
 40         tp->copied_seq += skb->len;                40         tp->copied_seq += skb->len;
 41         subflow->ssn_offset += skb->len;           41         subflow->ssn_offset += skb->len;
 42                                                    42 
 43         /* initialize a dummy sequence number,     43         /* initialize a dummy sequence number, we will update it at MPC
 44          * completion, if needed                   44          * completion, if needed
 45          */                                        45          */
 46         MPTCP_SKB_CB(skb)->map_seq = -skb->len     46         MPTCP_SKB_CB(skb)->map_seq = -skb->len;
 47         MPTCP_SKB_CB(skb)->end_seq = 0;            47         MPTCP_SKB_CB(skb)->end_seq = 0;
 48         MPTCP_SKB_CB(skb)->offset = 0;             48         MPTCP_SKB_CB(skb)->offset = 0;
 49         MPTCP_SKB_CB(skb)->has_rxtstamp = TCP_     49         MPTCP_SKB_CB(skb)->has_rxtstamp = TCP_SKB_CB(skb)->has_rxtstamp;
 50                                                    50 
 51         mptcp_data_lock(sk);                       51         mptcp_data_lock(sk);
 52                                                    52 
 53         mptcp_set_owner_r(skb, sk);                53         mptcp_set_owner_r(skb, sk);
 54         __skb_queue_tail(&sk->sk_receive_queue     54         __skb_queue_tail(&sk->sk_receive_queue, skb);
 55         mptcp_sk(sk)->bytes_received += skb->l     55         mptcp_sk(sk)->bytes_received += skb->len;
 56                                                    56 
 57         sk->sk_data_ready(sk);                     57         sk->sk_data_ready(sk);
 58                                                    58 
 59         mptcp_data_unlock(sk);                     59         mptcp_data_unlock(sk);
 60 }                                                  60 }
 61                                                    61 
 62 void __mptcp_fastopen_gen_msk_ackseq(struct mp !!  62 void mptcp_fastopen_gen_msk_ackseq(struct mptcp_sock *msk, struct mptcp_subflow_context *subflow,
 63                                      const str !!  63                                    const struct mptcp_options_received *mp_opt)
 64 {                                                  64 {
 65         struct sock *sk = (struct sock *)msk;      65         struct sock *sk = (struct sock *)msk;
 66         struct sk_buff *skb;                       66         struct sk_buff *skb;
 67                                                    67 
                                                   >>  68         mptcp_data_lock(sk);
 68         skb = skb_peek_tail(&sk->sk_receive_qu     69         skb = skb_peek_tail(&sk->sk_receive_queue);
 69         if (skb) {                                 70         if (skb) {
 70                 WARN_ON_ONCE(MPTCP_SKB_CB(skb)     71                 WARN_ON_ONCE(MPTCP_SKB_CB(skb)->end_seq);
 71                 pr_debug("msk %p moving seq %l !!  72                 pr_debug("msk %p moving seq %llx -> %llx end_seq %llx -> %llx", sk,
 72                          MPTCP_SKB_CB(skb)->ma     73                          MPTCP_SKB_CB(skb)->map_seq, MPTCP_SKB_CB(skb)->map_seq + msk->ack_seq,
 73                          MPTCP_SKB_CB(skb)->en     74                          MPTCP_SKB_CB(skb)->end_seq, MPTCP_SKB_CB(skb)->end_seq + msk->ack_seq);
 74                 MPTCP_SKB_CB(skb)->map_seq +=      75                 MPTCP_SKB_CB(skb)->map_seq += msk->ack_seq;
 75                 MPTCP_SKB_CB(skb)->end_seq +=      76                 MPTCP_SKB_CB(skb)->end_seq += msk->ack_seq;
 76         }                                          77         }
 77                                                    78 
 78         pr_debug("msk=%p ack_seq=%llx\n", msk, !!  79         pr_debug("msk=%p ack_seq=%llx", msk, msk->ack_seq);
                                                   >>  80         mptcp_data_unlock(sk);
 79 }                                                  81 }
 80                                                    82 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php