History

mptcp: remove unneeded READ_ONCE() annotation

The subflow->fully_established flag is always written under the subflow socket lock. Reading such value under the same lock does not require any ONCE annotation.

Paolo Abeni committed 2 months ago

Commit caa4a791 parent f9681902 files · +3 −3Browse files

Unified · Split

2 files
  1. net/mptcp/options.c +2 −2
  2. net/mptcp/protocol.c +1 −1
net/mptcp/options.c+2−2
@@ -530,7 +530,7 @@ static bool mptcp_established_options_mp(struct sock *sk, struct sk_buff *skb, · 529 unmodified lines
530530 return false;
531531
532532 /* MPC/MPJ needed only on 3rd ack packet, DATA_FIN and TCP shutdown take precedence */
533− if (READ_ONCE(subflow->fully_established) || snd_data_fin_enable ||
533+ if (subflow->fully_established || snd_data_fin_enable ||
534534 subflow->snd_isn != TCP_SKB_CB(skb)->seq ||
535535 sk->sk_state != TCP_ESTABLISHED)
536536 return false;
@@ -981,7 +981,7 @@ static bool check_fully_established(struct mptcp_sock *msk, struct sock *ssk, · 444 unmodified lines
981981 /* here we can process OoO, in-window pkts, only in-sequence 4th ack
982982 * will make the subflow fully established
983983 */
984− if (likely(READ_ONCE(subflow->fully_established))) {
984+ if (likely(subflow->fully_established)) {
985985 /* on passive sockets, check for 3rd ack retransmission
986986 * note that msk is always set by subflow_syn_recv_sock()
987987 * for mp_join subflows
net/mptcp/protocol.c+1−1
@@ -3886,7 +3886,7 @@ static void schedule_3rdack_retransmission(struct sock *ssk) · 3885 unmodified lines
38863886 struct tcp_sock *tp = tcp_sk(ssk);
38873887 unsigned long timeout;
38883888
3889− if (READ_ONCE(mptcp_subflow_ctx(ssk)->fully_established))
3889+ if (mptcp_subflow_ctx(ssk)->fully_established)
38903890 return;
38913891
38923892 /* reschedule with a timeout above RTT, as we must look only for drop */