@@ -60,7 +60,7 @@ static struct socket *__mptcp_nmpc_socket(const struct mptcp_sock *msk)
6060/* Returns end sequence number of the receiver's advertised window */
6161static u64 mptcp_wnd_end (const struct mptcp_sock * msk )
6262{
63- return atomic64_read ( & msk -> wnd_end );
63+ return READ_ONCE ( msk -> wnd_end );
6464}
6565
6666static bool mptcp_is_tcpsk (struct sock * sk )
@@ -358,7 +358,7 @@ static void mptcp_check_data_fin_ack(struct sock *sk)
358358 /* Look for an acknowledged DATA_FIN */
359359 if (((1 << sk -> sk_state ) &
360360 (TCPF_FIN_WAIT1 | TCPF_CLOSING | TCPF_LAST_ACK )) &&
361- msk -> write_seq == atomic64_read ( & msk -> snd_una )) {
361+ msk -> write_seq == READ_ONCE ( msk -> snd_una )) {
362362 mptcp_stop_timer (sk );
363363
364364 WRITE_ONCE (msk -> snd_data_fin_enable , 0 );
@@ -764,7 +764,7 @@ bool mptcp_schedule_work(struct sock *sk)
764764 return false;
765765}
766766
767- void mptcp_data_acked (struct sock * sk )
767+ void __mptcp_data_acked (struct sock * sk )
768768{
769769 mptcp_reset_timer (sk );
770770
@@ -997,11 +997,11 @@ static void mptcp_clean_una(struct sock *sk)
997997 * plain TCP
998998 */
999999 if (__mptcp_check_fallback (msk ))
1000- atomic64_set ( & msk -> snd_una , msk -> snd_nxt );
1000+ msk -> snd_una = READ_ONCE ( msk -> snd_nxt );
10011001
1002- mptcp_data_lock (sk );
1003- snd_una = atomic64_read (& msk -> snd_una );
10041002
1003+ mptcp_data_lock (sk );
1004+ snd_una = msk -> snd_una ;
10051005 list_for_each_entry_safe (dfrag , dtmp , & msk -> rtx_queue , list ) {
10061006 if (after64 (dfrag -> data_seq + dfrag -> data_len , snd_una ))
10071007 break ;
@@ -1282,10 +1282,12 @@ static int mptcp_sendmsg_frag(struct sock *sk, struct sock *ssk,
12821282 /* Zero window and all data acked? Probe. */
12831283 avail_size = mptcp_check_allowed_size (msk , data_seq , avail_size );
12841284 if (avail_size == 0 ) {
1285- if (skb || atomic64_read (& msk -> snd_una ) != msk -> snd_nxt )
1285+ u64 snd_una = READ_ONCE (msk -> snd_una );
1286+
1287+ if (skb || snd_una != msk -> snd_nxt )
12861288 return 0 ;
12871289 zero_window_probe = true;
1288- data_seq = atomic64_read ( & msk -> snd_una ) - 1 ;
1290+ data_seq = snd_una - 1 ;
12891291 avail_size = 1 ;
12901292 }
12911293
@@ -1994,12 +1996,8 @@ static void mptcp_retransmit_handler(struct sock *sk)
19941996{
19951997 struct mptcp_sock * msk = mptcp_sk (sk );
19961998
1997- if (atomic64_read (& msk -> snd_una ) == READ_ONCE (msk -> snd_nxt )) {
1998- mptcp_stop_timer (sk );
1999- } else {
2000- set_bit (MPTCP_WORK_RTX , & msk -> flags );
2001- mptcp_schedule_work (sk );
2002- }
1999+ set_bit (MPTCP_WORK_RTX , & msk -> flags );
2000+ mptcp_schedule_work (sk );
20032001}
20042002
20052003static void mptcp_retransmit_timer (struct timer_list * t )
@@ -2621,8 +2619,8 @@ struct sock *mptcp_sk_clone(const struct sock *sk,
26212619
26222620 msk -> write_seq = subflow_req -> idsn + 1 ;
26232621 msk -> snd_nxt = msk -> write_seq ;
2624- atomic64_set ( & msk -> snd_una , msk -> write_seq ) ;
2625- atomic64_set ( & msk -> wnd_end , msk -> snd_nxt + req -> rsk_rcv_wnd ) ;
2622+ msk -> snd_una = msk -> write_seq ;
2623+ msk -> wnd_end = msk -> snd_nxt + req -> rsk_rcv_wnd ;
26262624
26272625 if (mp_opt -> mp_capable ) {
26282626 msk -> can_ack = true;
@@ -2658,7 +2656,7 @@ void mptcp_rcv_space_init(struct mptcp_sock *msk, const struct sock *ssk)
26582656 if (msk -> rcvq_space .space == 0 )
26592657 msk -> rcvq_space .space = TCP_INIT_CWND * TCP_MSS_DEFAULT ;
26602658
2661- atomic64_set ( & msk -> wnd_end , msk -> snd_nxt + tcp_sk (ssk )-> snd_wnd );
2659+ WRITE_ONCE ( msk -> wnd_end , msk -> snd_nxt + tcp_sk (ssk )-> snd_wnd );
26622660}
26632661
26642662static struct sock * mptcp_accept (struct sock * sk , int flags , int * err ,
@@ -2918,7 +2916,7 @@ void mptcp_finish_connect(struct sock *ssk)
29182916 WRITE_ONCE (msk -> ack_seq , ack_seq );
29192917 WRITE_ONCE (msk -> rcv_wnd_sent , ack_seq );
29202918 WRITE_ONCE (msk -> can_ack , 1 );
2921- atomic64_set ( & msk -> snd_una , msk -> write_seq );
2919+ WRITE_ONCE ( msk -> snd_una , msk -> write_seq );
29222920
29232921 mptcp_pm_new_connection (msk , 0 );
29242922
0 commit comments