Ver código fonte

[CCID3]: Reintroduce ccid3hctx_t_rto

CCID3 keeps this variable in usecs, inet_connection_socks in jiffies,
so to avoid Mars orbiter losses lets reintroduce ccid3hctx_t_rto 8)

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Arnaldo Carvalho de Melo 20 anos atrás
pai
commit
c68e64cfb5
2 arquivos alterados com 6 adições e 5 exclusões
  1. 5 5
      net/dccp/ccids/ccid3.c
  2. 1 0
      net/dccp/ccids/ccid3.h

+ 5 - 5
net/dccp/ccids/ccid3.c

@@ -905,7 +905,7 @@ static void ccid3_hc_tx_no_feedback_timer(unsigned long data)
 			hctx->ccid3hctx_x = 10;
 			hctx->ccid3hctx_x = 10;
 		}
 		}
 		/* Schedule no feedback timer to expire in max(4 * R, 2 * s / X) */
 		/* Schedule no feedback timer to expire in max(4 * R, 2 * s / X) */
-		next_tmout = max_t(u32, inet_csk(sk)->icsk_rto, 
+		next_tmout = max_t(u32, hctx->ccid3hctx_t_rto, 
 				   2 * (hctx->ccid3hctx_s * 100000) / (hctx->ccid3hctx_x / 10));
 				   2 * (hctx->ccid3hctx_s * 100000) / (hctx->ccid3hctx_x / 10));
 		break;
 		break;
 	default:
 	default:
@@ -1180,8 +1180,8 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
 			       r_sample);
 			       r_sample);
 
 
 		/* Update timeout interval */
 		/* Update timeout interval */
-		inet_csk(sk)->icsk_rto = max_t(u32, 4 * hctx->ccid3hctx_rtt,
-					       USEC_PER_SEC);
+		hctx->ccid3hctx_t_rto = max_t(u32, 4 * hctx->ccid3hctx_rtt,
+					      USEC_PER_SEC);
 
 
 		/* Update receive rate */
 		/* Update receive rate */
 		hctx->ccid3hctx_x_recv = x_recv;   /* x_recv in bytes per second */
 		hctx->ccid3hctx_x_recv = x_recv;   /* x_recv in bytes per second */
@@ -1227,7 +1227,7 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
 		/* to prevent divide by zero below */
 		/* to prevent divide by zero below */
 
 
 		/* Schedule no feedback timer to expire in max(4 * R, 2 * s / X) */
 		/* Schedule no feedback timer to expire in max(4 * R, 2 * s / X) */
-		next_tmout = max(inet_csk(sk)->icsk_rto,
+		next_tmout = max(hctx->ccid3hctx_t_rto,
 				 (2 * (hctx->ccid3hctx_s * 100000) /
 				 (2 * (hctx->ccid3hctx_s * 100000) /
 				  (hctx->ccid3hctx_x / 10)));
 				  (hctx->ccid3hctx_x / 10)));
 		/* maths with 100000 and 10 is to prevent overflow with 32 bit */
 		/* maths with 100000 and 10 is to prevent overflow with 32 bit */
@@ -1340,7 +1340,7 @@ static int ccid3_hc_tx_init(struct sock *sk)
 
 
 	hctx->ccid3hctx_x     = hctx->ccid3hctx_s; /* set transmission rate to 1 packet per second */
 	hctx->ccid3hctx_x     = hctx->ccid3hctx_s; /* set transmission rate to 1 packet per second */
 	hctx->ccid3hctx_rtt   = 4; /* See ccid3_hc_tx_packet_sent win_count calculatation */
 	hctx->ccid3hctx_rtt   = 4; /* See ccid3_hc_tx_packet_sent win_count calculatation */
-	inet_csk(sk)->icsk_rto = USEC_PER_SEC;
+	hctx->ccid3hctx_t_rto = USEC_PER_SEC;
 	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);
 	init_timer(&hctx->ccid3hctx_no_feedback_timer);
 	init_timer(&hctx->ccid3hctx_no_feedback_timer);

+ 1 - 0
net/dccp/ccids/ccid3.h

@@ -80,6 +80,7 @@ struct ccid3_hc_tx_sock {
 	struct timer_list		ccid3hctx_no_feedback_timer;
 	struct timer_list		ccid3hctx_no_feedback_timer;
 	struct timeval			ccid3hctx_t_ld;
 	struct timeval			ccid3hctx_t_ld;
 	struct timeval			ccid3hctx_t_nom;
 	struct timeval			ccid3hctx_t_nom;
+	u32				ccid3hctx_t_rto;
 	u32				ccid3hctx_t_ipi;
 	u32				ccid3hctx_t_ipi;
 	u32				ccid3hctx_delta;
 	u32				ccid3hctx_delta;
 	struct list_head		ccid3hctx_hist;
 	struct list_head		ccid3hctx_hist;