public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Laurent Vivier <lvivier@redhat.com>
Cc: passt-dev@passt.top, sbrivio@redhat.com
Subject: Re: [PATCH] tcp: remove useless assignment
Date: Wed, 29 Nov 2023 13:34:32 +1100	[thread overview]
Message-ID: <ZWajOBkqAwrtBrj0@zatzit> (raw)
In-Reply-To: <20231128165423.1845799-1-lvivier@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1312 bytes --]

On Tue, Nov 28, 2023 at 05:54:23PM +0100, Laurent Vivier wrote:
> In tcp_send_flag(), a4826ee04b76 has replaced:
> 
>     th->doff = sizeof(*th) / 4;
>     th->doff += OPT_MSS_LEN / 4;
>     th->doff += (1 + OPT_WS_LEN) / 4;
> 
> by
> 
>     optlen = OPT_MSS_LEN + 1 + OPT_WS_LEN;
>     th->doff = (sizeof(*th) + optlen) / 4;
> 
> but forgot to remove the useless "th->doff += (1 + OPT_WS_LEN) / 4;"
> 
> Fixes: a4826ee04b76 ("tcp: Defer and coalesce all segments with no data (flags) to handler")
> Cc: sbrivio@redhat.com
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  tcp.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/tcp.c b/tcp.c
> index 40e3dec1ca2d..bf5f315afcac 100644
> --- a/tcp.c
> +++ b/tcp.c
> @@ -1693,7 +1693,6 @@ static int tcp_send_flag(struct ctx *c, struct tcp_tap_conn *conn, int flags)
>  		*(uint16_t *)data = htons(MIN(USHRT_MAX, mss));
>  
>  		data += OPT_MSS_LEN - 2;
> -		th->doff += OPT_MSS_LEN / 4;
>  
>  		conn->ws_to_tap = MIN(MAX_WS, tinfo.tcpi_snd_wscale);
>  

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-11-29  2:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-28 16:54 [PATCH] tcp: remove useless assignment Laurent Vivier
2023-11-29  2:34 ` David Gibson [this message]
2023-12-04  9:54   ` Stefano Brivio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZWajOBkqAwrtBrj0@zatzit \
    --to=david@gibson.dropbear.id.au \
    --cc=lvivier@redhat.com \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).