diff mbox series

[mptcp-next] Squash to "mptcp: generate the data checksum"

Message ID ae2099811b8395f7718855c5c7d412b26d960c95.1621321549.git.geliangtang@gmail.com (mailing list archive)
State Accepted, archived
Commit 982a61af0143c2bc9ec30c1ecd9e5f20073d1c26
Delegated to: Matthieu Baerts
Headers show
Series [mptcp-next] Squash to "mptcp: generate the data checksum" | expand

Commit Message

Geliang Tang May 18, 2021, 7:06 a.m. UTC
Move this line "__wsum csum = ~csum_unfold(mpext->csum);" from "mptcp:
validate the data checksum" to "mptcp: generate the data checksum".

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 net/mptcp/protocol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mat Martineau May 20, 2021, 9:56 p.m. UTC | #1
On Tue, 18 May 2021, Geliang Tang wrote:

> Move this line "__wsum csum = ~csum_unfold(mpext->csum);" from "mptcp:
> validate the data checksum" to "mptcp: generate the data checksum".
>
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
> ---
> net/mptcp/protocol.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index 38ce8d50e665..58253bd09f93 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -1311,7 +1311,7 @@ static bool mptcp_alloc_tx_skb(struct sock *sk, struct sock *ssk)
> static void mptcp_update_data_checksum(struct sk_buff *skb, int added)
> {
> 	struct mptcp_ext *mpext = mptcp_get_ext(skb);
> -	__wsum csum = csum_unfold(mpext->csum);
> +	__wsum csum = ~csum_unfold(mpext->csum);
> 	int offset = skb->len - added;
>
> 	mpext->csum = csum_fold(csum_block_add(csum, skb_checksum(skb, offset, added, 0), offset));
> -- 
> 2.31.1

Looks good, thanks Geliang.

Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>

--
Mat Martineau
Intel
Matthieu Baerts June 3, 2021, 2:59 p.m. UTC | #2
Hi Geliang, Mat,

On 18/05/2021 09:06, Geliang Tang wrote:
> Move this line "__wsum csum = ~csum_unfold(mpext->csum);" from "mptcp:
> validate the data checksum" to "mptcp: generate the data checksum".

Sorry for the delay!

This is now applied in our tree:

- 982a61af0143: "squashed" in "mptcp: generate the data checksum"
- Results: e61f1205c3fe..df4fcde34fab

Builds and tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20210603T145651
https://github.com/multipath-tcp/mptcp_net-next/actions/workflows/build-validation.yml?query=branch:export/20210603T145651

Cheers,
Matt
diff mbox series

Patch

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 38ce8d50e665..58253bd09f93 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1311,7 +1311,7 @@  static bool mptcp_alloc_tx_skb(struct sock *sk, struct sock *ssk)
 static void mptcp_update_data_checksum(struct sk_buff *skb, int added)
 {
 	struct mptcp_ext *mpext = mptcp_get_ext(skb);
-	__wsum csum = csum_unfold(mpext->csum);
+	__wsum csum = ~csum_unfold(mpext->csum);
 	int offset = skb->len - added;
 
 	mpext->csum = csum_fold(csum_block_add(csum, skb_checksum(skb, offset, added, 0), offset));