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

[DCCP]: Whitespace cleanups

That accumulated over the last months hackaton, shame on me for not
using git-apply whitespace helping hand, will do that from now on.
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@mandriva.com>
parent 1fba78b6
...@@ -176,7 +176,7 @@ enum { ...@@ -176,7 +176,7 @@ enum {
}; };
/* DCCP features (RFC 4340 section 6.4) */ /* DCCP features (RFC 4340 section 6.4) */
enum { enum {
DCCPF_RESERVED = 0, DCCPF_RESERVED = 0,
DCCPF_CCID = 1, DCCPF_CCID = 1,
DCCPF_SHORT_SEQNOS = 2, /* XXX: not yet implemented */ DCCPF_SHORT_SEQNOS = 2, /* XXX: not yet implemented */
......
...@@ -124,18 +124,18 @@ static void ccid3_hc_tx_update_x(struct sock *sk, struct timeval *now) ...@@ -124,18 +124,18 @@ static void ccid3_hc_tx_update_x(struct sock *sk, struct timeval *now)
if (hctx->ccid3hctx_p > 0) { if (hctx->ccid3hctx_p > 0) {
hctx->ccid3hctx_x = min(((__u64)hctx->ccid3hctx_x_calc) << 6, hctx->ccid3hctx_x = min(((__u64)hctx->ccid3hctx_x_calc) << 6,
hctx->ccid3hctx_x_recv * 2 ); hctx->ccid3hctx_x_recv * 2);
hctx->ccid3hctx_x = max(hctx->ccid3hctx_x, hctx->ccid3hctx_x = max(hctx->ccid3hctx_x,
(((__u64)hctx->ccid3hctx_s) << 6) / (((__u64)hctx->ccid3hctx_s) << 6) /
TFRC_T_MBI); TFRC_T_MBI);
} else if (timeval_delta(now, &hctx->ccid3hctx_t_ld) - } else if (timeval_delta(now, &hctx->ccid3hctx_t_ld) -
(suseconds_t)hctx->ccid3hctx_rtt >= 0 ) { (suseconds_t)hctx->ccid3hctx_rtt >= 0) {
hctx->ccid3hctx_x = hctx->ccid3hctx_x =
max(2 * min(hctx->ccid3hctx_x, hctx->ccid3hctx_x_recv), max(2 * min(hctx->ccid3hctx_x, hctx->ccid3hctx_x_recv),
scaled_div(((__u64)hctx->ccid3hctx_s) << 6, scaled_div(((__u64)hctx->ccid3hctx_s) << 6,
hctx->ccid3hctx_rtt ) ); hctx->ccid3hctx_rtt));
hctx->ccid3hctx_t_ld = *now; hctx->ccid3hctx_t_ld = *now;
} }
...@@ -228,7 +228,8 @@ static void ccid3_hc_tx_no_feedback_timer(unsigned long data) ...@@ -228,7 +228,8 @@ static void ccid3_hc_tx_no_feedback_timer(unsigned long data)
*/ */
if (!hctx->ccid3hctx_idle || if (!hctx->ccid3hctx_idle ||
(hctx->ccid3hctx_x_recv >= 4 * (hctx->ccid3hctx_x_recv >= 4 *
scaled_div(((__u64)hctx->ccid3hctx_s) << 6, hctx->ccid3hctx_rtt))) { scaled_div(((__u64)hctx->ccid3hctx_s) << 6,
hctx->ccid3hctx_rtt))) {
struct timeval now; struct timeval now;
ccid3_pr_debug("%s(%p, state=%s), not idle\n", ccid3_pr_debug("%s(%p, state=%s), not idle\n",
...@@ -248,12 +249,13 @@ static void ccid3_hc_tx_no_feedback_timer(unsigned long data) ...@@ -248,12 +249,13 @@ static void ccid3_hc_tx_no_feedback_timer(unsigned long data)
BUG_ON(hctx->ccid3hctx_p && !hctx->ccid3hctx_x_calc); BUG_ON(hctx->ccid3hctx_p && !hctx->ccid3hctx_x_calc);
if (hctx->ccid3hctx_p == 0 || if (hctx->ccid3hctx_p == 0 ||
hctx->ccid3hctx_x_calc > (hctx->ccid3hctx_x_recv >> 5)) { (hctx->ccid3hctx_x_calc >
(hctx->ccid3hctx_x_recv >> 5))) {
hctx->ccid3hctx_x_recv = hctx->ccid3hctx_x_recv =
max(hctx->ccid3hctx_x_recv / 2, max(hctx->ccid3hctx_x_recv / 2,
(((__u64)hctx->ccid3hctx_s) << 6) / (((__u64)hctx->ccid3hctx_s) << 6) /
(2*TFRC_T_MBI)); (2 * TFRC_T_MBI));
if (hctx->ccid3hctx_p == 0) if (hctx->ccid3hctx_p == 0)
dccp_timestamp(sk, &now); dccp_timestamp(sk, &now);
...@@ -316,7 +318,8 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb) ...@@ -316,7 +318,8 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb)
switch (hctx->ccid3hctx_state) { switch (hctx->ccid3hctx_state) {
case TFRC_SSTATE_NO_SENT: case TFRC_SSTATE_NO_SENT:
sk_reset_timer(sk, &hctx->ccid3hctx_no_feedback_timer, sk_reset_timer(sk, &hctx->ccid3hctx_no_feedback_timer,
jiffies + usecs_to_jiffies(TFRC_INITIAL_TIMEOUT)); (jiffies +
usecs_to_jiffies(TFRC_INITIAL_TIMEOUT)));
hctx->ccid3hctx_last_win_count = 0; hctx->ccid3hctx_last_win_count = 0;
hctx->ccid3hctx_t_last_win_count = now; hctx->ccid3hctx_t_last_win_count = now;
ccid3_hc_tx_set_state(sk, TFRC_SSTATE_NO_FBACK); ccid3_hc_tx_set_state(sk, TFRC_SSTATE_NO_FBACK);
...@@ -365,7 +368,8 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb) ...@@ -365,7 +368,8 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb)
return 0; return 0;
} }
static void ccid3_hc_tx_packet_sent(struct sock *sk, int more, unsigned int len) static void ccid3_hc_tx_packet_sent(struct sock *sk, int more,
unsigned int len)
{ {
struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk); struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk);
struct timeval now; struct timeval now;
...@@ -465,7 +469,7 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) ...@@ -465,7 +469,7 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
* Larger Initial Windows [RFC 4342, sec. 5] * Larger Initial Windows [RFC 4342, sec. 5]
* We deviate in that we use `s' instead of `MSS'. * We deviate in that we use `s' instead of `MSS'.
*/ */
__u64 w_init = min( 4 * hctx->ccid3hctx_s, __u64 w_init = min(4 * hctx->ccid3hctx_s,
max(2 * hctx->ccid3hctx_s, 4380)); max(2 * hctx->ccid3hctx_s, 4380));
hctx->ccid3hctx_rtt = r_sample; hctx->ccid3hctx_rtt = r_sample;
hctx->ccid3hctx_x = scaled_div(w_init << 6, r_sample); hctx->ccid3hctx_x = scaled_div(w_init << 6, r_sample);
...@@ -475,13 +479,14 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) ...@@ -475,13 +479,14 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
ccid3_pr_debug("%s(%p), s=%u, w_init=%llu, " ccid3_pr_debug("%s(%p), s=%u, w_init=%llu, "
"R_sample=%dus, X=%u\n", dccp_role(sk), "R_sample=%dus, X=%u\n", dccp_role(sk),
sk, hctx->ccid3hctx_s, w_init, (int)r_sample, sk, hctx->ccid3hctx_s, w_init,
(int)r_sample,
(unsigned)(hctx->ccid3hctx_x >> 6)); (unsigned)(hctx->ccid3hctx_x >> 6));
ccid3_hc_tx_set_state(sk, TFRC_SSTATE_FBACK); ccid3_hc_tx_set_state(sk, TFRC_SSTATE_FBACK);
} else { } else {
hctx->ccid3hctx_rtt = (9 * hctx->ccid3hctx_rtt + hctx->ccid3hctx_rtt = (9 * hctx->ccid3hctx_rtt +
(u32)r_sample ) / 10; (u32)r_sample) / 10;
/* Update sending rate (step 4 of [RFC 3448, 4.3]) */ /* Update sending rate (step 4 of [RFC 3448, 4.3]) */
if (hctx->ccid3hctx_p > 0) if (hctx->ccid3hctx_p > 0)
...@@ -492,12 +497,13 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) ...@@ -492,12 +497,13 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
ccid3_hc_tx_update_x(sk, &now); ccid3_hc_tx_update_x(sk, &now);
ccid3_pr_debug("%s(%p), RTT=%uus (sample=%dus), s=%u, " ccid3_pr_debug("%s(%p), RTT=%uus (sample=%dus), s=%u, "
"p=%u, X_calc=%u, X_recv=%u, X=%u\n", dccp_role(sk), "p=%u, X_calc=%u, X_recv=%u, X=%u\n",
dccp_role(sk),
sk, hctx->ccid3hctx_rtt, (int)r_sample, sk, hctx->ccid3hctx_rtt, (int)r_sample,
hctx->ccid3hctx_s, hctx->ccid3hctx_p, hctx->ccid3hctx_s, hctx->ccid3hctx_p,
hctx->ccid3hctx_x_calc, hctx->ccid3hctx_x_calc,
(unsigned)(hctx->ccid3hctx_x_recv >> 6), (unsigned)(hctx->ccid3hctx_x_recv >> 6),
(unsigned)(hctx->ccid3hctx_x >> 6) ); (unsigned)(hctx->ccid3hctx_x >> 6));
} }
/* unschedule no feedback timer */ /* unschedule no feedback timer */
...@@ -507,20 +513,20 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) ...@@ -507,20 +513,20 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
dccp_tx_hist_purge_older(ccid3_tx_hist, dccp_tx_hist_purge_older(ccid3_tx_hist,
&hctx->ccid3hctx_hist, packet); &hctx->ccid3hctx_hist, packet);
/* /*
* As we have calculated new ipi, delta, t_nom it is possible that * As we have calculated new ipi, delta, t_nom it is possible
* we now can send a packet, so wake up dccp_wait_for_ccid * that we now can send a packet, so wake up dccp_wait_for_ccid
*/ */
sk->sk_write_space(sk); sk->sk_write_space(sk);
/* /*
* Update timeout interval for the nofeedback timer. * Update timeout interval for the nofeedback timer.
* We use a configuration option to increase the lower bound. * We use a configuration option to increase the lower bound.
* This can help avoid triggering the nofeedback timer too often * This can help avoid triggering the nofeedback timer too
* ('spinning') on LANs with small RTTs. * often ('spinning') on LANs with small RTTs.
*/ */
hctx->ccid3hctx_t_rto = max_t(u32, 4 * hctx->ccid3hctx_rtt, hctx->ccid3hctx_t_rto = max_t(u32, 4 * hctx->ccid3hctx_rtt,
CONFIG_IP_DCCP_CCID3_RTO * CONFIG_IP_DCCP_CCID3_RTO *
(USEC_PER_SEC/1000) ); (USEC_PER_SEC/1000));
/* /*
* Schedule no feedback timer to expire in * Schedule no feedback timer to expire in
* max(t_RTO, 2 * s/X) = max(t_RTO, 2 * t_ipi) * max(t_RTO, 2 * s/X) = max(t_RTO, 2 * t_ipi)
...@@ -528,7 +534,8 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) ...@@ -528,7 +534,8 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
t_nfb = max(hctx->ccid3hctx_t_rto, 2 * hctx->ccid3hctx_t_ipi); t_nfb = max(hctx->ccid3hctx_t_rto, 2 * hctx->ccid3hctx_t_ipi);
ccid3_pr_debug("%s(%p), Scheduled no feedback timer to " ccid3_pr_debug("%s(%p), Scheduled no feedback timer to "
"expire in %lu jiffies (%luus)\n", dccp_role(sk), "expire in %lu jiffies (%luus)\n",
dccp_role(sk),
sk, usecs_to_jiffies(t_nfb), t_nfb); sk, usecs_to_jiffies(t_nfb), t_nfb);
sk_reset_timer(sk, &hctx->ccid3hctx_no_feedback_timer, sk_reset_timer(sk, &hctx->ccid3hctx_no_feedback_timer,
...@@ -538,7 +545,9 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) ...@@ -538,7 +545,9 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
hctx->ccid3hctx_idle = 1; hctx->ccid3hctx_idle = 1;
break; break;
case TFRC_SSTATE_NO_SENT: case TFRC_SSTATE_NO_SENT:
/* XXX when implementing bidirectional rx/tx check this again */ /*
* XXX when implementing bidirectional rx/tx check this again
*/
DCCP_WARN("Illegal ACK received - no packet sent\n"); DCCP_WARN("Illegal ACK received - no packet sent\n");
/* fall through */ /* fall through */
case TFRC_SSTATE_TERM: /* ignore feedback when closing */ case TFRC_SSTATE_TERM: /* ignore feedback when closing */
...@@ -575,7 +584,8 @@ static int ccid3_hc_tx_parse_options(struct sock *sk, unsigned char option, ...@@ -575,7 +584,8 @@ static int ccid3_hc_tx_parse_options(struct sock *sk, unsigned char option,
dccp_role(sk), sk, len); dccp_role(sk), sk, len);
rc = -EINVAL; rc = -EINVAL;
} else { } else {
opt_recv->ccid3or_loss_event_rate = ntohl(*(__be32 *)value); opt_recv->ccid3or_loss_event_rate =
ntohl(*(__be32 *)value);
ccid3_pr_debug("%s(%p), LOSS_EVENT_RATE=%u\n", ccid3_pr_debug("%s(%p), LOSS_EVENT_RATE=%u\n",
dccp_role(sk), sk, dccp_role(sk), sk,
opt_recv->ccid3or_loss_event_rate); opt_recv->ccid3or_loss_event_rate);
...@@ -596,7 +606,8 @@ static int ccid3_hc_tx_parse_options(struct sock *sk, unsigned char option, ...@@ -596,7 +606,8 @@ static int ccid3_hc_tx_parse_options(struct sock *sk, unsigned char option,
dccp_role(sk), sk, len); dccp_role(sk), sk, len);
rc = -EINVAL; rc = -EINVAL;
} else { } else {
opt_recv->ccid3or_receive_rate = ntohl(*(__be32 *)value); opt_recv->ccid3or_receive_rate =
ntohl(*(__be32 *)value);
ccid3_pr_debug("%s(%p), RECEIVE_RATE=%u\n", ccid3_pr_debug("%s(%p), RECEIVE_RATE=%u\n",
dccp_role(sk), sk, dccp_role(sk), sk,
opt_recv->ccid3or_receive_rate); opt_recv->ccid3or_receive_rate);
...@@ -616,7 +627,8 @@ static int ccid3_hc_tx_init(struct ccid *ccid, struct sock *sk) ...@@ -616,7 +627,8 @@ static int ccid3_hc_tx_init(struct ccid *ccid, struct sock *sk)
hctx->ccid3hctx_state = TFRC_SSTATE_NO_SENT; hctx->ccid3hctx_state = TFRC_SSTATE_NO_SENT;
INIT_LIST_HEAD(&hctx->ccid3hctx_hist); INIT_LIST_HEAD(&hctx->ccid3hctx_hist);
hctx->ccid3hctx_no_feedback_timer.function = ccid3_hc_tx_no_feedback_timer; hctx->ccid3hctx_no_feedback_timer.function =
ccid3_hc_tx_no_feedback_timer;
hctx->ccid3hctx_no_feedback_timer.data = (unsigned long)sk; hctx->ccid3hctx_no_feedback_timer.data = (unsigned long)sk;
init_timer(&hctx->ccid3hctx_no_feedback_timer); init_timer(&hctx->ccid3hctx_no_feedback_timer);
...@@ -914,7 +926,8 @@ static int ccid3_hc_rx_detect_loss(struct sock *sk, ...@@ -914,7 +926,8 @@ static int ccid3_hc_rx_detect_loss(struct sock *sk,
struct dccp_rx_hist_entry *packet) struct dccp_rx_hist_entry *packet)
{ {
struct ccid3_hc_rx_sock *hcrx = ccid3_hc_rx_sk(sk); struct ccid3_hc_rx_sock *hcrx = ccid3_hc_rx_sk(sk);
struct dccp_rx_hist_entry *rx_hist = dccp_rx_hist_head(&hcrx->ccid3hcrx_hist); struct dccp_rx_hist_entry *rx_hist =
dccp_rx_hist_head(&hcrx->ccid3hcrx_hist);
u64 seqno = packet->dccphrx_seqno; u64 seqno = packet->dccphrx_seqno;
u64 tmp_seqno; u64 tmp_seqno;
int loss = 0; int loss = 0;
...@@ -1044,8 +1057,8 @@ static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb) ...@@ -1044,8 +1057,8 @@ static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb)
break; break;
dccp_timestamp(sk, &now); dccp_timestamp(sk, &now);
if (timeval_delta(&now, &hcrx->ccid3hcrx_tstamp_last_ack) - if ((timeval_delta(&now, &hcrx->ccid3hcrx_tstamp_last_ack) -
(suseconds_t)hcrx->ccid3hcrx_rtt >= 0) { (suseconds_t)hcrx->ccid3hcrx_rtt) >= 0) {
hcrx->ccid3hcrx_tstamp_last_ack = now; hcrx->ccid3hcrx_tstamp_last_ack = now;
ccid3_hc_rx_send_feedback(sk); ccid3_hc_rx_send_feedback(sk);
} }
......
...@@ -338,7 +338,6 @@ EXPORT_SYMBOL_GPL(dccp_make_response); ...@@ -338,7 +338,6 @@ EXPORT_SYMBOL_GPL(dccp_make_response);
static struct sk_buff *dccp_make_reset(struct sock *sk, struct dst_entry *dst, static struct sk_buff *dccp_make_reset(struct sock *sk, struct dst_entry *dst,
const enum dccp_reset_codes code) const enum dccp_reset_codes code)
{ {
struct dccp_hdr *dh; struct dccp_hdr *dh;
struct dccp_sock *dp = dccp_sk(sk); struct dccp_sock *dp = dccp_sk(sk);
......
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