Commit c1734376 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by David S. Miller

[PACKET_HISTORY]: Add dccphtx_rtt and rename the win_count fields

As requested by Ian.
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: default avatarIan McDonald <iam4@cs.waikato.ac.nz>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 34b4a4a6
...@@ -1004,7 +1004,7 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, ...@@ -1004,7 +1004,7 @@ static int ccid3_hc_tx_send_packet(struct sock *sk,
/* Can we send? if so add options and add to packet history */ /* Can we send? if so add options and add to packet history */
if (rc == 0) if (rc == 0)
new_packet->dccphtx_win_count = new_packet->dccphtx_ccval =
DCCP_SKB_CB(skb)->dccpd_ccval = DCCP_SKB_CB(skb)->dccpd_ccval =
hctx->ccid3hctx_last_win_count; hctx->ccid3hctx_last_win_count;
out: out:
...@@ -1060,7 +1060,7 @@ static void ccid3_hc_tx_packet_sent(struct sock *sk, int more, int len) ...@@ -1060,7 +1060,7 @@ static void ccid3_hc_tx_packet_sent(struct sock *sk, int more, int len)
min_t(unsigned long, quarter_rtt, 5)) % 16; min_t(unsigned long, quarter_rtt, 5)) % 16;
ccid3_pr_debug("%s, sk=%p, window changed from %u to %u!\n", ccid3_pr_debug("%s, sk=%p, window changed from %u to %u!\n",
dccp_role(sk), sk, dccp_role(sk), sk,
packet->dccphtx_win_count, packet->dccphtx_ccval,
hctx->ccid3hctx_last_win_count); hctx->ccid3hctx_last_win_count);
} }
/* COMPLIANCE_END */ /* COMPLIANCE_END */
...@@ -1068,9 +1068,10 @@ static void ccid3_hc_tx_packet_sent(struct sock *sk, int more, int len) ...@@ -1068,9 +1068,10 @@ static void ccid3_hc_tx_packet_sent(struct sock *sk, int more, int len)
ccid3_pr_debug("%s, sk=%p, packet sent (%llu,%u)\n", ccid3_pr_debug("%s, sk=%p, packet sent (%llu,%u)\n",
dccp_role(sk), sk, dccp_role(sk), sk,
packet->dccphtx_seqno, packet->dccphtx_seqno,
packet->dccphtx_win_count); packet->dccphtx_ccval);
#endif #endif
hctx->ccid3hctx_idle = 0; hctx->ccid3hctx_idle = 0;
packet->dccphtx_rtt = hctx->ccid3hctx_rtt;
packet->dccphtx_sent = 1; packet->dccphtx_sent = 1;
} else } else
ccid3_pr_debug("%s, sk=%p, seqno=%llu NOT inserted!\n", ccid3_pr_debug("%s, sk=%p, seqno=%llu NOT inserted!\n",
...@@ -1489,11 +1490,10 @@ static int ccid3_hc_rx_add_hist(struct sock *sk, ...@@ -1489,11 +1490,10 @@ static int ccid3_hc_rx_add_hist(struct sock *sk,
step = 2; step = 2;
/* OK, find next data packet */ /* OK, find next data packet */
num_later = 1; num_later = 1;
win_count = entry->dccphrx_win_count; win_count = entry->dccphrx_ccval;
break; break;
case 2: case 2:
tmp = (win_count - tmp = win_count - entry->dccphrx_ccval;
entry->dccphrx_win_count);
if (tmp < 0) if (tmp < 0)
tmp += TFRC_WIN_COUNT_LIMIT; tmp += TFRC_WIN_COUNT_LIMIT;
if (tmp > TFRC_WIN_COUNT_PER_RTT + 1) { if (tmp > TFRC_WIN_COUNT_PER_RTT + 1) {
...@@ -1553,7 +1553,7 @@ static void ccid3_hc_rx_send_feedback(struct sock *sk) ...@@ -1553,7 +1553,7 @@ static void ccid3_hc_rx_send_feedback(struct sock *sk)
} }
do_gettimeofday(&(hcrx->ccid3hcrx_tstamp_last_feedback)); do_gettimeofday(&(hcrx->ccid3hcrx_tstamp_last_feedback));
hcrx->ccid3hcrx_last_counter = packet->dccphrx_win_count; hcrx->ccid3hcrx_last_counter = packet->dccphrx_ccval;
hcrx->ccid3hcrx_seqno_last_counter = packet->dccphrx_seqno; hcrx->ccid3hcrx_seqno_last_counter = packet->dccphrx_seqno;
hcrx->ccid3hcrx_bytes_recv = 0; hcrx->ccid3hcrx_bytes_recv = 0;
...@@ -1645,11 +1645,11 @@ static u32 ccid3_hc_rx_calc_first_li(struct sock *sk) ...@@ -1645,11 +1645,11 @@ static u32 ccid3_hc_rx_calc_first_li(struct sock *sk)
switch (step) { switch (step) {
case 0: case 0:
tstamp = entry->dccphrx_tstamp; tstamp = entry->dccphrx_tstamp;
win_count = entry->dccphrx_win_count; win_count = entry->dccphrx_ccval;
step = 1; step = 1;
break; break;
case 1: case 1:
interval = win_count - entry->dccphrx_win_count; interval = win_count - entry->dccphrx_ccval;
if (interval < 0) if (interval < 0)
interval += TFRC_WIN_COUNT_LIMIT; interval += TFRC_WIN_COUNT_LIMIT;
if (interval > 4) if (interval > 4)
...@@ -1816,7 +1816,7 @@ static void ccid3_hc_rx_detect_loss(struct sock *sk) ...@@ -1816,7 +1816,7 @@ static void ccid3_hc_rx_detect_loss(struct sock *sk)
} }
if (seq_loss != DCCP_MAX_SEQNO + 1) if (seq_loss != DCCP_MAX_SEQNO + 1)
win_loss = a_loss->dccphrx_win_count; win_loss = a_loss->dccphrx_ccval;
out_update_li: out_update_li:
ccid3_hc_rx_update_li(sk, seq_loss, win_loss); ccid3_hc_rx_update_li(sk, seq_loss, win_loss);
...@@ -1918,7 +1918,7 @@ static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb) ...@@ -1918,7 +1918,7 @@ static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb)
return; return;
} }
win_count = packet->dccphrx_win_count; win_count = packet->dccphrx_ccval;
ins = ccid3_hc_rx_add_hist(sk, packet); ins = ccid3_hc_rx_add_hist(sk, packet);
......
...@@ -47,15 +47,16 @@ ...@@ -47,15 +47,16 @@
struct dccp_tx_hist_entry { struct dccp_tx_hist_entry {
struct list_head dccphtx_node; struct list_head dccphtx_node;
u64 dccphtx_seqno:48, u64 dccphtx_seqno:48,
dccphtx_win_count:8, dccphtx_ccval:4,
dccphtx_sent:1; dccphtx_sent:1;
u32 dccphtx_rtt;
struct timeval dccphtx_tstamp; struct timeval dccphtx_tstamp;
}; };
struct dccp_rx_hist_entry { struct dccp_rx_hist_entry {
struct list_head dccphrx_node; struct list_head dccphrx_node;
u64 dccphrx_seqno:48, u64 dccphrx_seqno:48,
dccphrx_win_count:4, dccphrx_ccval:4,
dccphrx_type:4; dccphrx_type:4;
u32 dccphrx_ndp; /* In fact it is from 8 to 24 bits */ u32 dccphrx_ndp; /* In fact it is from 8 to 24 bits */
struct timeval dccphrx_tstamp; struct timeval dccphrx_tstamp;
...@@ -137,7 +138,7 @@ static inline struct dccp_rx_hist_entry * ...@@ -137,7 +138,7 @@ static inline struct dccp_rx_hist_entry *
const struct dccp_hdr *dh = dccp_hdr(skb); const struct dccp_hdr *dh = dccp_hdr(skb);
entry->dccphrx_seqno = DCCP_SKB_CB(skb)->dccpd_seq; entry->dccphrx_seqno = DCCP_SKB_CB(skb)->dccpd_seq;
entry->dccphrx_win_count = dh->dccph_ccval; entry->dccphrx_ccval = dh->dccph_ccval;
entry->dccphrx_type = dh->dccph_type; entry->dccphrx_type = dh->dccph_type;
entry->dccphrx_ndp = ndp; entry->dccphrx_ndp = ndp;
do_gettimeofday(&(entry->dccphrx_tstamp)); do_gettimeofday(&(entry->dccphrx_tstamp));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment