diff mbox series

[v3,mptcp-next,08/21] Squash-to "mptcp: send out checksum for DSS"

Message ID dc70316d43c4344da0e78616d9a9f23640e22c78.1619035356.git.pabeni@redhat.com
State Superseded, archived
Delegated to: Paolo Abeni
Headers show
Series mptcp: data checksum support | expand

Commit Message

Paolo Abeni April 21, 2021, 8:17 p.m. UTC
Account for csum len in mptcp_established_options_dss()

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 net/mptcp/options.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

Comments

Geliang Tang April 23, 2021, 3:41 a.m. UTC | #1
Hi Paolo,

Paolo Abeni <pabeni@redhat.com> 于2021年4月22日周四 上午4:21写道:
>
> Account for csum len in mptcp_established_options_dss()
>
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> ---
>  net/mptcp/options.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/net/mptcp/options.c b/net/mptcp/options.c
> index 01caff4cdd25..f8430415a954 100644
> --- a/net/mptcp/options.c
> +++ b/net/mptcp/options.c
> @@ -553,15 +553,17 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
>         mpext = skb ? mptcp_get_ext(skb) : NULL;
>
>         if (!skb || (mpext && mpext->use_map) || snd_data_fin_enable) {
> -               unsigned int map_size;
> +               unsigned int map_size = TCPOLEN_MPTCP_DSS_BASE + TCPOLEN_MPTCP_DSS_MAP64;
>
> -               map_size = TCPOLEN_MPTCP_DSS_BASE + TCPOLEN_MPTCP_DSS_MAP64;

I want to keep these lines unchanged.

> +               if (mpext) {
> +                       if (READ_ONCE(msk->csum_enabled))

I want to use 'if (opts->csum_reqd)' here instead.

> +                               map_size += TCPOLEN_MPTCP_DSS_CHECKSUM;
>
> -               remaining -= map_size;
> -               dss_size = map_size;
> -               if (mpext)
>                         opts->ext_copy = *mpext;
> +               }
>
> +               dss_size = map_size;
> +               remaining -= map_size;

And change these two lines as the original order:

               remaining -= map_size;
               dss_size = map_size;

WDYT?

Thanks.


-Geliang

>                 if (skb && snd_data_fin_enable)
>                         mptcp_write_data_fin(subflow, skb, &opts->ext_copy);
>                 ret = true;
> --
> 2.26.2
>
Paolo Abeni April 23, 2021, 8:56 a.m. UTC | #2
On Fri, 2021-04-23 at 11:41 +0800, Geliang Tang wrote:
> Hi Paolo,
> 
> Paolo Abeni <pabeni@redhat.com> 于2021年4月22日周四 上午4:21写道:
> > Account for csum len in mptcp_established_options_dss()
> > 
> > Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> > ---
> >  net/mptcp/options.c | 12 +++++++-----
> >  1 file changed, 7 insertions(+), 5 deletions(-)
> > 
> > diff --git a/net/mptcp/options.c b/net/mptcp/options.c
> > index 01caff4cdd25..f8430415a954 100644
> > --- a/net/mptcp/options.c
> > +++ b/net/mptcp/options.c
> > @@ -553,15 +553,17 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
> >         mpext = skb ? mptcp_get_ext(skb) : NULL;
> > 
> >         if (!skb || (mpext && mpext->use_map) || snd_data_fin_enable) {
> > -               unsigned int map_size;
> > +               unsigned int map_size = TCPOLEN_MPTCP_DSS_BASE + TCPOLEN_MPTCP_DSS_MAP64;
> > 
> > -               map_size = TCPOLEN_MPTCP_DSS_BASE + TCPOLEN_MPTCP_DSS_MAP64;
> 
> I want to keep these lines unchanged.

Uhm... I like the new form more ;)
> 
> > +               if (mpext) {
> > +                       if (READ_ONCE(msk->csum_enabled))
> 
> I want to use 'if (opts->csum_reqd)' here instead.

Agreed.

> 
> > +                               map_size += TCPOLEN_MPTCP_DSS_CHECKSUM;
> > 
> > -               remaining -= map_size;
> > -               dss_size = map_size;
> > -               if (mpext)
> >                         opts->ext_copy = *mpext;
> > +               }
> > 
> > +               dss_size = map_size;
> > +               remaining -= map_size;
> 
> And change these two lines as the original order:
> 
>                remaining -= map_size;
>                dss_size = map_size;
> 
> WDYT?

Agreed.

/P
diff mbox series

Patch

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 01caff4cdd25..f8430415a954 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -553,15 +553,17 @@  static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
 	mpext = skb ? mptcp_get_ext(skb) : NULL;
 
 	if (!skb || (mpext && mpext->use_map) || snd_data_fin_enable) {
-		unsigned int map_size;
+		unsigned int map_size = TCPOLEN_MPTCP_DSS_BASE + TCPOLEN_MPTCP_DSS_MAP64;
 
-		map_size = TCPOLEN_MPTCP_DSS_BASE + TCPOLEN_MPTCP_DSS_MAP64;
+		if (mpext) {
+			if (READ_ONCE(msk->csum_enabled))
+				map_size += TCPOLEN_MPTCP_DSS_CHECKSUM;
 
-		remaining -= map_size;
-		dss_size = map_size;
-		if (mpext)
 			opts->ext_copy = *mpext;
+		}
 
+		dss_size = map_size;
+		remaining -= map_size;
 		if (skb && snd_data_fin_enable)
 			mptcp_write_data_fin(subflow, skb, &opts->ext_copy);
 		ret = true;