public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jiri Kosina <jkosina@suse.cz>
Cc: "David Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Vojtech Pavlik" <vojtech@suse.cz>,
	"Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi>
Subject: Re: [PATCH] tcp: cleanup of cwnd initialization in tcp_init_metrics()
Date: Thu, 23 Dec 2010 10:14:23 +0100	[thread overview]
Message-ID: <1293095663.7789.3.camel@edumazet-laptop> (raw)
In-Reply-To: <alpine.LNX.2.00.1012231002310.16569@pobox.suse.cz>

Le jeudi 23 décembre 2010 à 10:03 +0100, Jiri Kosina a écrit :
> On Thu, 23 Dec 2010, Eric Dumazet wrote:
> 
> > Le mercredi 22 décembre 2010 à 19:39 +0100, Jiri Kosina a écrit :
> > > Commit 86bcebafc5e7f5 ("tcp: fix >2 iw selection") fixed a case when 
> > > congestion window initialization has been mistakenly omitted by 
> > > introducing cwnd label and putting backwards jump from the end of the 
> > > function.
> > > 
> > > This makes the code unnecessarily tricky to read and understand on a first 
> > > sight.
> > > 
> > > Shuffle the code around a little bit to make it more obvious.
> > 
> > Well in fine you have
> > 
> > 	if (inet_csk(sk)->icsk_rto < TCP_TIMEOUT_INIT && !tp->rx_opt.saw_tstamp)
> > 		goto reset;
> > 	goto out;
> > reset:
> > 
> > Is that really more obvious ? ;)
> 
> To me it seems much more obvious than goto from the very end of the 
> function somewhere into the middle and returning from there, but 
> definitely a matter of personal taste.
> 

You dont understand what I said. Please read again.

To me I prefer you _finish_ the cleanup so that we have :

	if (some condition) {
reset:
	}

out:

You remove two "goto" in the process.

Is that clear now ?

  reply	other threads:[~2010-12-23  9:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-22 18:39 [PATCH] tcp: cleanup of cwnd initialization in tcp_init_metrics() Jiri Kosina
2010-12-23  8:24 ` Eric Dumazet
2010-12-23  9:03   ` Jiri Kosina
2010-12-23  9:14     ` Eric Dumazet [this message]
2010-12-23  9:23       ` Jiri Kosina
2010-12-23 17:56         ` David Miller

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=1293095663.7789.3.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=ilpo.jarvinen@helsinki.fi \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vojtech@suse.cz \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox