All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
To: dccp@vger.kernel.org
Subject: [PATCH 19/29] Remove unused fields in packet history structure
Date: Thu, 12 Apr 2007 21:16:47 +0000	[thread overview]
Message-ID: <20070412211647.GT21292@ghostprotocols.net> (raw)

This removes two fields of the TX packet history structure which
are not referenced by the CCID 3 code and are not needed:

 * dccphtx_sent  -  is redundant since the fact that an entry is
   present in the TX history in itself is an indication that the
   packet has been sent (cf. dccp_write_xmit and ccid3_hc_tx_packet_sent);

 * dccphtx_rtt  -  is nowhere referenced and is not even required:
   the `Preventing Oscillations' mechanism in [RFC 3448, 4.5] uses a
   moving-average, but does not require to memorize past RTTs;
   the history field has no further use;

As a further benefit, the history entry size is reduced.

NB : Adding the newly created entry is now at the end of packet_sent - if it is
     in the history before being fully filled in, list corruption is possible.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
---
 net/dccp/ccids/ccid3.c              |    4 +---
 net/dccp/ccids/lib/packet_history.h |   12 ++----------
 2 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index 0029979..cd3565f 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -408,13 +408,11 @@ static void ccid3_hc_tx_packet_sent(struct sock *sk, int more,
 		DCCP_CRIT("packet history - out of memory!");
 		return;
 	}
-	dccp_tx_hist_add_entry(&hctx->ccid3hctx_hist, packet);
 
 	do_gettimeofday(&now);
 	packet->dccphtx_tstamp = now;
 	packet->dccphtx_seqno  = dccp_sk(sk)->dccps_gss;
-	packet->dccphtx_rtt    = hctx->ccid3hctx_rtt;
-	packet->dccphtx_sent   = 1;
+	dccp_tx_hist_add_entry(&hctx->ccid3hctx_hist, packet);
 }
 
 static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
diff --git a/net/dccp/ccids/lib/packet_history.h b/net/dccp/ccids/lib/packet_history.h
index 6208188..78ef50f 100644
--- a/net/dccp/ccids/lib/packet_history.h
+++ b/net/dccp/ccids/lib/packet_history.h
@@ -54,9 +54,7 @@
  */
 struct dccp_tx_hist_entry {
 	struct list_head dccphtx_node;
-	u64		 dccphtx_seqno:48,
-			 dccphtx_sent:1;
-	u32		 dccphtx_rtt;
+	u64		 dccphtx_seqno;
 	struct timeval	 dccphtx_tstamp;
 };
 
@@ -71,13 +69,7 @@ static inline struct dccp_tx_hist_entry *
 			dccp_tx_hist_entry_new(struct dccp_tx_hist *hist,
 					       const gfp_t prio)
 {
-	struct dccp_tx_hist_entry *entry = kmem_cache_alloc(hist->dccptxh_slab,
-							    prio);
-
-	if (entry != NULL)
-		entry->dccphtx_sent = 0;
-
-	return entry;
+	return kmem_cache_alloc(hist->dccptxh_slab, prio);
 }
 
 extern int dccp_tx_hist_get_send_time(struct dccp_tx_hist *, struct list_head *,
-- 
1.5.0.6


                 reply	other threads:[~2007-04-12 21:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20070412211647.GT21292@ghostprotocols.net \
    --to=acme@ghostprotocols.net \
    --cc=dccp@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.