* [PATCH 10/10]: [DCCP] CCID2: Add helper functions for changing important CCID2 state
@ 2006-09-14 17:14 Arnaldo Carvalho de Melo
2006-09-19 20:16 ` [PATCH 10/10]: [DCCP] CCID2: Add helper functions for changing David Miller
2006-09-19 20:28 ` [PATCH 10/10]: [DCCP] CCID2: Add helper functions for changing important CCID2 state Andrea Bittau
0 siblings, 2 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2006-09-14 17:14 UTC (permalink / raw)
To: dccp
Introduce methods which manipulate interesting congestion control state such as
pipe and rtt estimate. This is useful for people wishing to monitor the
variables of CCID and instrument the code [perhaps using Kprobes]. Personally,
I am a fan of encapsulation---that justifies this change =D.
Signed-off-by: Andrea Bittau <a.bittau@cs.ucl.ac.uk>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
------------------------------------------------------------------------------
ccid2.c | 31 +++++++++++++++++++++++--------
1 file changed, 23 insertions(+), 8 deletions(-)
------------------------------------------------------------------------------
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c
index 4fcd858..5c294ee 100644
--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -199,6 +199,17 @@ static void ccid2_change_cwnd(struct cci
hctx->ccid2hctx_cwnd = val;
}
+static void ccid2_change_srtt(struct ccid2_hc_tx_sock *hctx, long val)
+{
+ ccid2_pr_debug("change SRTT to %ld\n", val);
+ hctx->ccid2hctx_srtt = val;
+}
+
+static void ccid2_change_pipe(struct ccid2_hc_tx_sock *hctx, long val)
+{
+ hctx->ccid2hctx_pipe = val;
+}
+
static void ccid2_start_rto_timer(struct sock *sk);
static void ccid2_hc_tx_rto_expire(unsigned long data)
@@ -228,7 +239,7 @@ static void ccid2_hc_tx_rto_expire(unsig
ccid2_start_rto_timer(sk);
/* adjust pipe, cwnd etc */
- hctx->ccid2hctx_pipe = 0;
+ ccid2_change_pipe(hctx, 0);
hctx->ccid2hctx_ssthresh = hctx->ccid2hctx_cwnd >> 1;
if (hctx->ccid2hctx_ssthresh < 2)
hctx->ccid2hctx_ssthresh = 2;
@@ -274,7 +285,7 @@ static void ccid2_hc_tx_packet_sent(stru
BUG_ON(!hctx->ccid2hctx_sendwait);
hctx->ccid2hctx_sendwait = 0;
- hctx->ccid2hctx_pipe++;
+ ccid2_change_pipe(hctx, hctx->ccid2hctx_pipe + 1);
BUG_ON(hctx->ccid2hctx_pipe < 0);
/* There is an issue. What if another packet is sent between
@@ -470,11 +481,13 @@ static inline void ccid2_new_ack(struct
if (hctx->ccid2hctx_srtt = -1) {
ccid2_pr_debug("R: %lu Time=%lu seq=%llu\n",
r, jiffies, seqp->ccid2s_seq);
- hctx->ccid2hctx_srtt = r;
+ ccid2_change_srtt(hctx, r);
hctx->ccid2hctx_rttvar = r >> 1;
} else {
/* RTTVAR */
long tmp = hctx->ccid2hctx_srtt - r;
+ long srtt;
+
if (tmp < 0)
tmp *= -1;
@@ -484,10 +497,12 @@ static inline void ccid2_new_ack(struct
hctx->ccid2hctx_rttvar += tmp;
/* SRTT */
- hctx->ccid2hctx_srtt *= 7;
- hctx->ccid2hctx_srtt >>= 3;
+ srtt = hctx->ccid2hctx_srtt;
+ srtt *= 7;
+ srtt >>= 3;
tmp = r >> 3;
- hctx->ccid2hctx_srtt += tmp;
+ srtt += tmp;
+ ccid2_change_srtt(hctx, srtt);
}
s = hctx->ccid2hctx_rttvar << 2;
/* clock granularity is 1 when based on jiffies */
@@ -523,7 +538,7 @@ static void ccid2_hc_tx_dec_pipe(struct
{
struct ccid2_hc_tx_sock *hctx = ccid2_hc_tx_sk(sk);
- hctx->ccid2hctx_pipe--;
+ ccid2_change_pipe(hctx, hctx->ccid2hctx_pipe-1);
BUG_ON(hctx->ccid2hctx_pipe < 0);
if (hctx->ccid2hctx_pipe = 0)
@@ -749,7 +764,7 @@ static int ccid2_hc_tx_init(struct ccid
hctx->ccid2hctx_sent = 0;
hctx->ccid2hctx_rto = 3 * HZ;
- hctx->ccid2hctx_srtt = -1;
+ ccid2_change_srtt(hctx, -1);
hctx->ccid2hctx_rttvar = -1;
hctx->ccid2hctx_lastrtt = 0;
hctx->ccid2hctx_rpdupack = -1;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 10/10]: [DCCP] CCID2: Add helper functions for changing
2006-09-14 17:14 [PATCH 10/10]: [DCCP] CCID2: Add helper functions for changing important CCID2 state Arnaldo Carvalho de Melo
@ 2006-09-19 20:16 ` David Miller
2006-09-19 20:28 ` [PATCH 10/10]: [DCCP] CCID2: Add helper functions for changing important CCID2 state Andrea Bittau
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2006-09-19 20:16 UTC (permalink / raw)
To: dccp
From: Arnaldo Carvalho de Melo <acme@mandriva.com>
Date: Thu, 14 Sep 2006 14:14:33 -0300
> Introduce methods which manipulate interesting congestion control state such as
> pipe and rtt estimate. This is useful for people wishing to monitor the
> variables of CCID and instrument the code [perhaps using Kprobes]. Personally,
> I am a fan of encapsulation---that justifies this change =D.
>
> Signed-off-by: Andrea Bittau <a.bittau@cs.ucl.ac.uk>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Trailing whitespace, again. It seems to proliferate into any
new code blocks written by Andrea. Please fix this stuff up,
you can even automate is by running:
git apply --check --whitespace=error-all $(DIFF)
over patches, which I've mentioned many times before.
Anyways, fixed up and applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 10/10]: [DCCP] CCID2: Add helper functions for changing important CCID2 state
2006-09-14 17:14 [PATCH 10/10]: [DCCP] CCID2: Add helper functions for changing important CCID2 state Arnaldo Carvalho de Melo
2006-09-19 20:16 ` [PATCH 10/10]: [DCCP] CCID2: Add helper functions for changing David Miller
@ 2006-09-19 20:28 ` Andrea Bittau
1 sibling, 0 replies; 3+ messages in thread
From: Andrea Bittau @ 2006-09-19 20:28 UTC (permalink / raw)
To: dccp
On Tue, Sep 19, 2006 at 01:16:50PM -0700, David Miller wrote:
> Trailing whitespace, again. It seems to proliferate into any
> new code blocks written by Andrea. Please fix this stuff up,
oops, sorry. I'll watch out in the future. It's just my lame text editor
skills. When closing a block with auto indent, I press left, and then close the
brace }, and that leaves a tab after the brace. Next time i'll esc, i, tab } =D
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-09-19 20:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-14 17:14 [PATCH 10/10]: [DCCP] CCID2: Add helper functions for changing important CCID2 state Arnaldo Carvalho de Melo
2006-09-19 20:16 ` [PATCH 10/10]: [DCCP] CCID2: Add helper functions for changing David Miller
2006-09-19 20:28 ` [PATCH 10/10]: [DCCP] CCID2: Add helper functions for changing important CCID2 state Andrea Bittau
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.