From nobody Fri Apr 26 16:06:41 2024 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a02:1d48:0:0:0:0:0 with SMTP id 69csp2415196jaj; Mon, 6 Sep 2021 06:10:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxajlzaUBl4oLa3ZWQbGMJ11IwE8PucZ/Mjf/+KlgruVmfR7YY/0pyGADSJrExYXgZKM9Dp X-Received: by 2002:a1f:9c50:: with SMTP id f77mr3617823vke.17.1630933859440; Mon, 06 Sep 2021 06:10:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630933859; cv=none; d=google.com; s=arc-20160816; b=X/gcd5fdviqyHVWjR1uKu7lq2rqDApwZgde62EiBOiYiy8I7bTWzo6F7zy2ZwQPe/n j2Ikp4RK6Xt7vUo2xE0J/lv0J7LYh7AeHX0+Mjk5RO3LO18fSzoCvv/ZncUm3rHEWN6h 8hCppiL1DKjPC85Csj88OAzRN7NfFNrT2J04cEAFJUVIi73azt8ZB8Zynd7Q1lNhXv6T 2tS2gvD8pSMsSDrBjsCXFq735iui3AtRqOpEuKQreOWcyaK6Cvoj/gg9xikCijq8cY7i wsubTbtQyAK61FOBK16/Uv+CHHlg52DwNxLPrBSUUZ6Q5ASQOJAYBTmR1ooSPhzEOlac rWRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=nQXGbym51ooxZw5qTOd+T6H+jTOUcdzZ4lF0dGrNoXo=; b=TnH3NN7GynURvgVdypGkjt2wFQXf+esXpjnB/kO2ssh3HxHdu+nTOLiTjq33EkLLFe OV6DA9XMsqoEhRsNNnikcSwUsi00mFBlnacyMk6WR/n53WyRoPUhU4+AHDkZhcACCrfk /JhOkImTVoibdxljmYLa8dgqvYL7+eQoZGiIqb4Wg6KjVodaVcsZcc3w8E+T8J8CQwmx erhjQCVcg5Fo6oUNOMOg3Md6G9tCxM1/5LO3Anr38ULsCLFArlOP4RqDzXVsQSulVXrA WrCgKxiQnjfpxuLI4t8CiwRfPGV13MzDWzbVjDCWLy+NssztonkAJdnVlHANdLNCKmsv 865A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of mptcp+bounces-1866-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) smtp.mailfrom="mptcp+bounces-1866-wpasupplicant.patchew=gmail.com@lists.linux.dev" Return-Path: Received: from sjc.edge.kernel.org (sjc.edge.kernel.org. [2604:1380:1000:8100::1]) by mx.google.com with ESMTPS id w3si2215783uae.13.2021.09.06.06.10.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Sep 2021 06:10:59 -0700 (PDT) Received-SPF: pass (google.com: domain of mptcp+bounces-1866-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) client-ip=2604:1380:1000:8100::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of mptcp+bounces-1866-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) smtp.mailfrom="mptcp+bounces-1866-wpasupplicant.patchew=gmail.com@lists.linux.dev" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sjc.edge.kernel.org (Postfix) with ESMTPS id 4FD053E1031 for ; Mon, 6 Sep 2021 13:10:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0AC843FCC; Mon, 6 Sep 2021 13:10:57 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [193.142.43.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB8E53FC1 for ; Mon, 6 Sep 2021 13:10:55 +0000 (UTC) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1mNEOk-0001oE-2Z; Mon, 06 Sep 2021 15:10:54 +0200 From: Florian Westphal To: Cc: Florian Westphal , Paolo Abeni Subject: [PATCH mptcp-next v2 1/2] mptcp: remove tx_pending_data Date: Mon, 6 Sep 2021 15:10:44 +0200 Message-Id: <20210906131045.18513-2-fw@strlen.de> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210906131045.18513-1-fw@strlen.de> References: <20210906131045.18513-1-fw@strlen.de> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The update on recovery is not correct. msk->tx_pending_data +=3D msk->snd_nxt - rtx_head->data_seq; will update tx_pending_data multiple times when a subflow is declared stale while earlier recovery is still in progress. This means that tx_pending_data will still be positive even after all data as has been transmitted. Rather than fix it, remove this field: there are no consumers. The outstanding data byte count can be computed either via "msk->write_seq - rtx_head->data_seq" or "msk->write_seq - msk->snd_una". The latter is more recent/accurate estimate as rtx_head adjustment is deferred until mptcp lock can be acquired. Signed-off-by: Florian Westphal Acked-by: Paolo Abeni --- No changes in v2. net/mptcp/protocol.c | 4 ---- net/mptcp/protocol.h | 1 - 2 files changed, 5 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 2a525c7ae920..c0e0ee4cb24f 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -1531,7 +1531,6 @@ static void mptcp_update_post_push(struct mptcp_sock = *msk, dfrag->already_sent +=3D sent; =20 msk->snd_burst -=3D sent; - msk->tx_pending_data -=3D sent; =20 snd_nxt_new +=3D dfrag->already_sent; =20 @@ -1761,7 +1760,6 @@ static int mptcp_sendmsg(struct sock *sk, struct msgh= dr *msg, size_t len) frag_truesize +=3D psize; pfrag->offset +=3D frag_truesize; WRITE_ONCE(msk->write_seq, msk->write_seq + psize); - msk->tx_pending_data +=3D psize; =20 /* charge data on mptcp pending queue to the msk socket * Note: we charge such data both to sk and ssk @@ -2254,7 +2252,6 @@ bool __mptcp_retransmit_pending_data(struct sock *sk) mptcp_data_unlock(sk); =20 msk->first_pending =3D rtx_head; - msk->tx_pending_data +=3D msk->snd_nxt - rtx_head->data_seq; msk->snd_burst =3D 0; =20 /* be sure to clear the "sent status" on all re-injected fragments */ @@ -2525,7 +2522,6 @@ static int __mptcp_init_sock(struct sock *sk) msk->first_pending =3D NULL; msk->wmem_reserved =3D 0; WRITE_ONCE(msk->rmem_released, 0); - msk->tx_pending_data =3D 0; msk->timer_ival =3D TCP_RTO_MIN; =20 msk->first =3D NULL; diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 99a23fff7b03..8416810afa8e 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -254,7 +254,6 @@ struct mptcp_sock { struct sk_buff *ooo_last_skb; struct rb_root out_of_order_queue; struct sk_buff_head receive_queue; - int tx_pending_data; struct list_head conn_list; struct list_head rtx_queue; struct mptcp_data_frag *first_pending; --=20 2.32.0