Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111502
b: refs/heads/master
c: ce177ae
h: refs/heads/master
v: v3
  • Loading branch information
Gerrit Renker committed Sep 4, 2008
1 parent c2051ec commit 6b6d3a5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 535c55df136ad2783d444e54d518a8fae8bdbf79
refs/heads/master: ce177ae2e6b196659e93a9408cc1f5f13f206d13
24 changes: 8 additions & 16 deletions trunk/net/dccp/ccids/ccid3.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,10 @@ static void ccid3_hc_tx_packet_sent(struct sock *sk, int more,
static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
{
struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk);
struct ccid3_options_received *opt_recv = &hctx->options_received;
struct tfrc_tx_hist_entry *acked;
ktime_t now;
unsigned long t_nfb;
u32 pinv, r_sample;
u32 r_sample;

/* we are only interested in ACKs */
if (!(DCCP_SKB_CB(skb)->dccpd_type == DCCP_PKT_ACK ||
Expand Down Expand Up @@ -404,17 +403,6 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
r_sample = dccp_sample_rtt(sk, ktime_us_delta(now, acked->stamp));
hctx->rtt = tfrc_ewma(hctx->rtt, r_sample, 9);

/* Update receive rate in units of 64 * bytes/second */
hctx->x_recv = opt_recv->ccid3or_receive_rate;
hctx->x_recv <<= 6;

/* Update loss event rate (which is scaled by 1e6) */
pinv = opt_recv->ccid3or_loss_event_rate;
if (pinv == 0)
hctx->p = 0;
else
hctx->p = tfrc_invert_loss_event_rate(pinv);

/*
* Update allowed sending rate X as per draft rfc3448bis-00, 4.2/3
*/
Expand Down Expand Up @@ -487,7 +475,6 @@ static int ccid3_hc_tx_parse_options(struct sock *sk, u8 packet_type,
u8 option, u8 *optval, u8 optlen)
{
struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk);
struct ccid3_options_received *opt_recv = &hctx->options_received;
__be32 opt_val;

switch (option) {
Expand All @@ -504,11 +491,16 @@ static int ccid3_hc_tx_parse_options(struct sock *sk, u8 packet_type,
opt_val = ntohl(get_unaligned((__be32 *)optval));

if (option == TFRC_OPT_RECEIVE_RATE) {
opt_recv->ccid3or_receive_rate = opt_val;
/* Receive Rate is kept in units of 64 bytes/second */
hctx->x_recv = opt_val;
hctx->x_recv <<= 6;

ccid3_pr_debug("%s(%p), RECEIVE_RATE=%u\n",
dccp_role(sk), sk, opt_val);
} else {
opt_recv->ccid3or_loss_event_rate = opt_val;
/* Update the fixpoint Loss Event Rate fraction */
hctx->p = tfrc_invert_loss_event_rate(opt_val);

ccid3_pr_debug("%s(%p), LOSS_EVENT_RATE=%u\n",
dccp_role(sk), sk, opt_val);
}
Expand Down
7 changes: 0 additions & 7 deletions trunk/net/dccp/ccids/ccid3.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ enum ccid3_options {
TFRC_OPT_RECEIVE_RATE = 194,
};

struct ccid3_options_received {
u32 ccid3or_loss_event_rate;
u32 ccid3or_receive_rate;
};

/* TFRC sender states */
enum ccid3_hc_tx_states {
TFRC_SSTATE_NO_SENT = 1,
Expand All @@ -101,7 +96,6 @@ enum ccid3_hc_tx_states {
* @t_ld - Time last doubled during slow start
* @t_nom - Nominal send time of next packet
* @hist - Packet history
* @options_received - Parsed set of retrieved options
*/
struct ccid3_hc_tx_sock {
u64 x;
Expand All @@ -119,7 +113,6 @@ struct ccid3_hc_tx_sock {
ktime_t t_ld;
ktime_t t_nom;
struct tfrc_tx_hist_entry *hist;
struct ccid3_options_received options_received;
};

static inline struct ccid3_hc_tx_sock *ccid3_hc_tx_sk(const struct sock *sk)
Expand Down

0 comments on commit 6b6d3a5

Please sign in to comment.