netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Cc: dccp@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH v2 0/3][BUG-FIX]: Test tree updates and bug fixes
Date: Wed, 5 Dec 2007 11:23:45 -0200	[thread overview]
Message-ID: <20071205132345.GC4653@ghostprotocols.net> (raw)
In-Reply-To: <11968535861367-git-send-email-gerrit@erg.abdn.ac.uk>

Em Wed, Dec 05, 2007 at 11:19:46AM +0000, Gerrit Renker escreveu:
> This patch removes the following redundancies:
>   * ccid3_hc_rx_update_s() is only called for data packets (that is what it should be called for);
>   * each call to ccid3_hc_rx_update_s() is wrapped inside a "if (is_data_packet)" test';
>   * therefore testing each time if "len > 0" is redundant (pointed out by Arnaldo);
>   * no other code calls this function, hence the inline function can go.
> 
> Also replaced the first call to updating s with direct assignment of `payload_size'; this has also
> been pointed out by Arnaldo.
> 
> Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
> ---
>  net/dccp/ccids/ccid3.c |   13 +++++--------
>  1 file changed, 5 insertions(+), 8 deletions(-)
> 
> --- a/net/dccp/ccids/ccid3.c
> +++ b/net/dccp/ccids/ccid3.c
> @@ -654,12 +654,6 @@ static void ccid3_hc_rx_set_state(struct
>  	hcrx->ccid3hcrx_state = state;
>  }
>  
> -static inline void ccid3_hc_rx_update_s(struct ccid3_hc_rx_sock *hcrx, int len)
> -{
> -	if (likely(len > 0))	/* don't update on empty packets (e.g. ACKs) */
> -		hcrx->ccid3hcrx_s = tfrc_ewma(hcrx->ccid3hcrx_s, len, 9);
> -}
> -
>  static void ccid3_hc_rx_send_feedback(struct sock *sk, struct sk_buff *skb,
>  				      enum ccid3_fback_type fbtype)
>  {
> @@ -788,8 +782,8 @@ static void ccid3_hc_rx_packet_recv(stru
>  	if (unlikely(hcrx->ccid3hcrx_state == TFRC_RSTATE_NO_DATA)) {
>  		if (is_data_packet) {
>  			do_feedback = FBACK_INITIAL;
> +			hcrx->ccid3hcrx_s = payload_size;
>  			ccid3_hc_rx_set_state(sk, TFRC_RSTATE_DATA);
> -			ccid3_hc_rx_update_s(hcrx, payload_size);

We have to set ccid3hcrx_bytes_recv to the payload_size here too, I'm
fixing this on the reworked patch that introduces the RX history.

>  		}
>  		goto update_records;
>  	}
> @@ -798,7 +792,10 @@ static void ccid3_hc_rx_packet_recv(stru
>  		goto done_receiving;
>  
>  	if (is_data_packet) {
> -		ccid3_hc_rx_update_s(hcrx, payload_size);
> +		/*
> +		 * Update moving-average of s and the sum of received payload bytes
> +		 */
> +		hcrx->ccid3hcrx_s = tfrc_ewma(hcrx->ccid3hcrx_s, payload_size, 9);
>  		hcrx->ccid3hcrx_bytes_recv += payload_size;


  reply	other threads:[~2007-12-05 13:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-05 11:19 [PATCH v2 0/3][BUG-FIX]: Test tree updates and bug fixes Gerrit Renker
2007-12-05 11:19 ` Gerrit Renker
2007-12-05 11:19   ` Gerrit Renker
2007-12-05 11:19     ` Gerrit Renker
2007-12-05 13:23       ` Arnaldo Carvalho de Melo [this message]
2007-12-05 13:55         ` Gerrit Renker
2007-12-05 14:23           ` Arnaldo Carvalho de Melo
2007-12-05 14:10       ` Arnaldo Carvalho de Melo
2007-12-05 14:53         ` Gerrit Renker
2007-12-05 15:18           ` Arnaldo Carvalho de Melo
2007-12-05 14:11     ` Arnaldo Carvalho de Melo
2007-12-05 14:13   ` Arnaldo Carvalho de Melo

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=20071205132345.GC4653@ghostprotocols.net \
    --to=acme@redhat.com \
    --cc=dccp@vger.kernel.org \
    --cc=gerrit@erg.abdn.ac.uk \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).