[PATCH mptcp-next] Squash to "mptcp: infinite mapping sending" part 2

Geliang Tang posted 1 patch 2 years, 3 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/016f512feb4ebf9a66808074e9b096bc1c3274d5.1643189677.git.geliang.tang@suse.com
Maintainers: Matthieu Baerts <matthieu.baerts@tessares.net>, "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Mat Martineau <mathew.j.martineau@linux.intel.com>
net/mptcp/options.c  | 3 ++-
net/mptcp/protocol.c | 1 -
2 files changed, 2 insertions(+), 2 deletions(-)
[PATCH mptcp-next] Squash to "mptcp: infinite mapping sending" part 2
Posted by Geliang Tang 2 years, 3 months ago
Fix the checksum value of the infinite map.

mptcp_make_csum() will return a non-zero value when mpext->csum is set to
zero.

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 net/mptcp/options.c  | 3 ++-
 net/mptcp/protocol.c | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 03c82985dba1..48a805731216 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -1339,7 +1339,8 @@ void mptcp_write_options(__be32 *ptr, const struct tcp_sock *tp,
 			ptr += 1;
 			if (opts->csum_reqd) {
 				put_unaligned_be32(mpext->data_len << 16 |
-						   mptcp_make_csum(mpext), ptr);
+						   (mpext->data_len ? mptcp_make_csum(mpext) : 0),
+						   ptr);
 			} else {
 				put_unaligned_be32(mpext->data_len << 16 |
 						   TCPOPT_NOP << 8 | TCPOPT_NOP, ptr);
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 526a0f5ba415..3324e1c61576 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1231,7 +1231,6 @@ static void mptcp_update_infinite_map(struct mptcp_sock *msk,
 
 	mpext->infinite_map = 1;
 	mpext->data_len = 0;
-	mpext->csum = 0;
 
 	MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_INFINITEMAPTX);
 	mptcp_subflow_ctx(ssk)->send_infinite_map = 0;
-- 
2.31.1


Re: [PATCH mptcp-next] Squash to "mptcp: infinite mapping sending" part 2
Posted by Mat Martineau 2 years, 2 months ago
On Wed, 26 Jan 2022, Geliang Tang wrote:

> Fix the checksum value of the infinite map.
>
> mptcp_make_csum() will return a non-zero value when mpext->csum is set to
> zero.
>
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> ---
> net/mptcp/options.c  | 3 ++-
> net/mptcp/protocol.c | 1 -
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/mptcp/options.c b/net/mptcp/options.c
> index 03c82985dba1..48a805731216 100644
> --- a/net/mptcp/options.c
> +++ b/net/mptcp/options.c
> @@ -1339,7 +1339,8 @@ void mptcp_write_options(__be32 *ptr, const struct tcp_sock *tp,
> 			ptr += 1;
> 			if (opts->csum_reqd) {

Looks good to me, but I suggest adding a comment here:

                                 /* mp_ext->data_len == 0 is reserved for
                                  * infinite mappings in RFC 8684.
                                  */

> 				put_unaligned_be32(mpext->data_len << 16 |
> -						   mptcp_make_csum(mpext), ptr);
> +						   (mpext->data_len ? mptcp_make_csum(mpext) : 0),
> +						   ptr);
> 			} else {
> 				put_unaligned_be32(mpext->data_len << 16 |
> 						   TCPOPT_NOP << 8 | TCPOPT_NOP, ptr);
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index 526a0f5ba415..3324e1c61576 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -1231,7 +1231,6 @@ static void mptcp_update_infinite_map(struct mptcp_sock *msk,
>
> 	mpext->infinite_map = 1;
> 	mpext->data_len = 0;
> -	mpext->csum = 0;
>
> 	MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_INFINITEMAPTX);
> 	mptcp_subflow_ctx(ssk)->send_infinite_map = 0;
> -- 
> 2.31.1
>
>
>

--
Mat Martineau
Intel