diff mbox series

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

Message ID 694573465901ea0fc5318b379af75f5287a4f77f.1620360953.git.geliangtang@gmail.com
State Accepted, archived
Commit 04461ed2155838ce976b54369cb59c5bc06e2caf
Delegated to: Matthieu Baerts
Headers show
Series [mptcp-next] Squash to "mptcp: generate the data checksum" | expand

Commit Message

Geliang Tang May 7, 2021, 4:18 a.m. UTC
Move the csum_replace2 trunk into the later patch "mptcp: receive
checksum for MP_CAPABLE with data".

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 net/mptcp/options.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Mat Martineau May 11, 2021, 12:45 a.m. UTC | #1
On Fri, 7 May 2021, Geliang Tang wrote:

> Move the csum_replace2 trunk into the later patch "mptcp: receive
> checksum for MP_CAPABLE with data".
>
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
> ---
> net/mptcp/options.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/net/mptcp/options.c b/net/mptcp/options.c
> index beac01f58cba..99fc21406168 100644
> --- a/net/mptcp/options.c
> +++ b/net/mptcp/options.c
> @@ -519,9 +519,6 @@ static void mptcp_write_data_fin(struct mptcp_subflow_context *subflow,
> 		 */
> 		ext->data_fin = 1;
> 		ext->data_len++;
> -
> -		/* the pseudo header has changed, update the csum accordingly */
> -		csum_replace2(&ext->csum, htons(ext->data_len - 1), htons(ext->data_len));

The commit message above says this is is moved to another patch, but the 
posted squash-to patch for "mptcp: receive checksum for MP_CAPABLE with 
data" doesn't add this functionality back. Is a hunk or another squash-to 
patch missing?


Thanks,

--
Mat Martineau
Intel
Geliang Tang May 11, 2021, 4:03 a.m. UTC | #2
Hi Mat,

On Mon, May 10, 2021 at 05:45:48PM -0700, Mat Martineau wrote:
> On Fri, 7 May 2021, Geliang Tang wrote:
> 
> > Move the csum_replace2 trunk into the later patch "mptcp: receive
> > checksum for MP_CAPABLE with data".
> > 
> > Signed-off-by: Geliang Tang <geliangtang@gmail.com>
> > ---
> > net/mptcp/options.c | 3 ---
> > 1 file changed, 3 deletions(-)
> > 
> > diff --git a/net/mptcp/options.c b/net/mptcp/options.c
> > index beac01f58cba..99fc21406168 100644
> > --- a/net/mptcp/options.c
> > +++ b/net/mptcp/options.c
> > @@ -519,9 +519,6 @@ static void mptcp_write_data_fin(struct mptcp_subflow_context *subflow,
> > 		 */
> > 		ext->data_fin = 1;
> > 		ext->data_len++;
> > -
> > -		/* the pseudo header has changed, update the csum accordingly */
> > -		csum_replace2(&ext->csum, htons(ext->data_len - 1), htons(ext->data_len));
> 
> The commit message above says this is is moved to another patch, but the
> posted squash-to patch for "mptcp: receive checksum for MP_CAPABLE with
> data" doesn't add this functionality back. Is a hunk or another squash-to
> patch missing?

Sorry, I didn't describe it clearly.

No squash-to patch is missing here, this truck will be moved to another
patch automatically when resolving the conflict.

Apply this squash-to patch (Squash to "mptcp: generate the data checksum")
and rebase, we will get a conflict with "mptcp: receive checksum for
MP_CAPABLE with data":

$ git rebase --continue
Auto-merging net/mptcp/protocol.h
Auto-merging net/mptcp/options.c
CONFLICT (content): Merge conflict in net/mptcp/options.c
error: could not apply d56805c0f705... mptcp: receive checksum for MP_CAPABLE with data

Resolve this conflict like this:

'''
<<<<<<< HEAD
=======

                /* the pseudo header has changed, update the csum accordingly */
                if (ext->csum_reqd)
                        csum_replace2(&ext->csum, htons(ext->data_len - 1),
                                      htons(ext->data_len));
>>>>>>> d56805c0f705... mptcp: receive checksum for MP_CAPABLE with data
        }
}
'''

 ->

'''

                /* the pseudo header has changed, update the csum accordingly */
                if (ext->csum_reqd)
                        csum_replace2(&ext->csum, htons(ext->data_len - 1),
                                      htons(ext->data_len));
        }
}
'''

Then the csum_replace2 trunk have been moved to the patch "mptcp: receive
checksum for MP_CAPABLE with data" automatically.

Thanks.

-Geliang

> 
> 
> Thanks,
> 
> --
> Mat Martineau
> Intel
Mat Martineau May 11, 2021, 11:17 p.m. UTC | #3
On Tue, 11 May 2021, Geliang Tang wrote:

> Hi Mat,
>
> On Mon, May 10, 2021 at 05:45:48PM -0700, Mat Martineau wrote:
>> On Fri, 7 May 2021, Geliang Tang wrote:
>>
>>> Move the csum_replace2 trunk into the later patch "mptcp: receive
>>> checksum for MP_CAPABLE with data".
>>>
>>> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
>>> ---
>>> net/mptcp/options.c | 3 ---
>>> 1 file changed, 3 deletions(-)
>>>
>>> diff --git a/net/mptcp/options.c b/net/mptcp/options.c
>>> index beac01f58cba..99fc21406168 100644
>>> --- a/net/mptcp/options.c
>>> +++ b/net/mptcp/options.c
>>> @@ -519,9 +519,6 @@ static void mptcp_write_data_fin(struct mptcp_subflow_context *subflow,
>>> 		 */
>>> 		ext->data_fin = 1;
>>> 		ext->data_len++;
>>> -
>>> -		/* the pseudo header has changed, update the csum accordingly */
>>> -		csum_replace2(&ext->csum, htons(ext->data_len - 1), htons(ext->data_len));
>>
>> The commit message above says this is is moved to another patch, but the
>> posted squash-to patch for "mptcp: receive checksum for MP_CAPABLE with
>> data" doesn't add this functionality back. Is a hunk or another squash-to
>> patch missing?
>
> Sorry, I didn't describe it clearly.
>
> No squash-to patch is missing here, this truck will be moved to another
> patch automatically when resolving the conflict.
>
> Apply this squash-to patch (Squash to "mptcp: generate the data checksum")
> and rebase, we will get a conflict with "mptcp: receive checksum for
> MP_CAPABLE with data":
>
> $ git rebase --continue
> Auto-merging net/mptcp/protocol.h
> Auto-merging net/mptcp/options.c
> CONFLICT (content): Merge conflict in net/mptcp/options.c
> error: could not apply d56805c0f705... mptcp: receive checksum for MP_CAPABLE with data
>
> Resolve this conflict like this:
>
> '''
> <<<<<<< HEAD
> =======
>
>                /* the pseudo header has changed, update the csum accordingly */
>                if (ext->csum_reqd)
>                        csum_replace2(&ext->csum, htons(ext->data_len - 1),
>                                      htons(ext->data_len));
>>>>>>>> d56805c0f705... mptcp: receive checksum for MP_CAPABLE with data
>        }
> }
> '''
>
> ->
>
> '''
>
>                /* the pseudo header has changed, update the csum accordingly */
>                if (ext->csum_reqd)
>                        csum_replace2(&ext->csum, htons(ext->data_len - 1),
>                                      htons(ext->data_len));
>        }
> }
> '''
>
> Then the csum_replace2 trunk have been moved to the patch "mptcp: receive
> checksum for MP_CAPABLE with data" automatically.
>

Ok, thanks for the information. In the future if there's a 
conflict-creating squash patch like this it does help to have specific 
conflict resolution notes.

It looks like this chunk of code is not needed at all, though - 
mptcp_make_csum() hasn't been called yet so the pseudoheader has not been 
included in the checksum.

--
Mat Martineau
Intel
Geliang Tang May 12, 2021, 4:18 a.m. UTC | #4
Hi Mat,

Mat Martineau <mathew.j.martineau@linux.intel.com> 于2021年5月12日周三 上午7:17写道:
>
> On Tue, 11 May 2021, Geliang Tang wrote:
>
> > Hi Mat,
> >
> > On Mon, May 10, 2021 at 05:45:48PM -0700, Mat Martineau wrote:
> >> On Fri, 7 May 2021, Geliang Tang wrote:
> >>
> >>> Move the csum_replace2 trunk into the later patch "mptcp: receive
> >>> checksum for MP_CAPABLE with data".
> >>>
> >>> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
> >>> ---
> >>> net/mptcp/options.c | 3 ---
> >>> 1 file changed, 3 deletions(-)
> >>>
> >>> diff --git a/net/mptcp/options.c b/net/mptcp/options.c
> >>> index beac01f58cba..99fc21406168 100644
> >>> --- a/net/mptcp/options.c
> >>> +++ b/net/mptcp/options.c
> >>> @@ -519,9 +519,6 @@ static void mptcp_write_data_fin(struct mptcp_subflow_context *subflow,
> >>>              */
> >>>             ext->data_fin = 1;
> >>>             ext->data_len++;
> >>> -
> >>> -           /* the pseudo header has changed, update the csum accordingly */
> >>> -           csum_replace2(&ext->csum, htons(ext->data_len - 1), htons(ext->data_len));
> >>
> >> The commit message above says this is is moved to another patch, but the
> >> posted squash-to patch for "mptcp: receive checksum for MP_CAPABLE with
> >> data" doesn't add this functionality back. Is a hunk or another squash-to
> >> patch missing?
> >
> > Sorry, I didn't describe it clearly.
> >
> > No squash-to patch is missing here, this truck will be moved to another
> > patch automatically when resolving the conflict.
> >
> > Apply this squash-to patch (Squash to "mptcp: generate the data checksum")
> > and rebase, we will get a conflict with "mptcp: receive checksum for
> > MP_CAPABLE with data":
> >
> > $ git rebase --continue
> > Auto-merging net/mptcp/protocol.h
> > Auto-merging net/mptcp/options.c
> > CONFLICT (content): Merge conflict in net/mptcp/options.c
> > error: could not apply d56805c0f705... mptcp: receive checksum for MP_CAPABLE with data
> >
> > Resolve this conflict like this:
> >
> > '''
> > <<<<<<< HEAD
> > =======
> >
> >                /* the pseudo header has changed, update the csum accordingly */
> >                if (ext->csum_reqd)
> >                        csum_replace2(&ext->csum, htons(ext->data_len - 1),
> >                                      htons(ext->data_len));
> >>>>>>>> d56805c0f705... mptcp: receive checksum for MP_CAPABLE with data
> >        }
> > }
> > '''
> >
> > ->
> >
> > '''
> >
> >                /* the pseudo header has changed, update the csum accordingly */
> >                if (ext->csum_reqd)
> >                        csum_replace2(&ext->csum, htons(ext->data_len - 1),
> >                                      htons(ext->data_len));
> >        }
> > }
> > '''
> >
> > Then the csum_replace2 trunk have been moved to the patch "mptcp: receive
> > checksum for MP_CAPABLE with data" automatically.
> >
>
> Ok, thanks for the information. In the future if there's a
> conflict-creating squash patch like this it does help to have specific
> conflict resolution notes.
>
> It looks like this chunk of code is not needed at all, though -
> mptcp_make_csum() hasn't been called yet so the pseudoheader has not been
> included in the checksum.

Yes, indeed, I just sent another squash-to patch (Squash to "mptcp: receive
checksum for MP_CAPABLE with data") to drop this chunk.

Thanks.


-Geliang

>
> --
> Mat Martineau
> Intel
Matthieu Baerts May 13, 2021, 7:42 a.m. UTC | #5
Hi Geliang, Mat,

On 07/05/2021 06:18, Geliang Tang wrote:
> Move the csum_replace2 trunk into the later patch "mptcp: receive
> checksum for MP_CAPABLE with data".
> 
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>

Thank you for the patch and the review!

Now in our tree!

- 04461ed21558: Squash to "mptcp: generate the data checksum"
- 2f6a4aa17ccb: conflict in
t/mptcp-receive-checksum-for-MP_CAPABLE-with-data
- Results: 6628a7b4ea41..f8de7f4600ea

No tag, we need 'Squash to "mptcp: receive checksum for MP_CAPABLE with
data"'.

Cheers,
Matt
diff mbox series

Patch

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index beac01f58cba..99fc21406168 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -519,9 +519,6 @@  static void mptcp_write_data_fin(struct mptcp_subflow_context *subflow,
 		 */
 		ext->data_fin = 1;
 		ext->data_len++;
-
-		/* the pseudo header has changed, update the csum accordingly */
-		csum_replace2(&ext->csum, htons(ext->data_len - 1), htons(ext->data_len));
 	}
 }