@@ -56,7 +56,6 @@ struct inet_connection_sock_af_ops {
5656 * @icsk_accept_queue: FIFO of established children
5757 * @icsk_bind_hash: Bind node
5858 * @icsk_bind2_hash: Bind node in the bhash2 table
59- * @icsk_timeout: Timeout
6059 * @icsk_retransmit_timer: Resend (no ack)
6160 * @icsk_rto: Retransmit timeout
6261 * @icsk_pmtu_cookie Last pmtu seen by socket
@@ -82,7 +81,6 @@ struct inet_connection_sock {
8281 struct request_sock_queue icsk_accept_queue ;
8382 struct inet_bind_bucket * icsk_bind_hash ;
8483 struct inet_bind2_bucket * icsk_bind2_hash ;
85- unsigned long icsk_timeout ;
8684 struct timer_list icsk_retransmit_timer ;
8785 struct timer_list icsk_delack_timer ;
8886 __u32 icsk_rto ;
@@ -115,7 +113,6 @@ struct inet_connection_sock {
115113 lrcv_flowlabel :20 , /* last received ipv6 flowlabel */
116114 dst_quick_ack :1 , /* cache dst RTAX_QUICKACK */
117115 unused :3 ;
118- unsigned long timeout ; /* Currently scheduled timeout */
119116 __u32 lrcvtime ; /* timestamp of last received data packet */
120117 __u16 last_seg_size ; /* Size of last incoming segment */
121118 __u16 rcv_mss ; /* MSS used for delayed ACK decisions */
@@ -187,6 +184,18 @@ static inline void inet_csk_delack_init(struct sock *sk)
187184 memset (& inet_csk (sk )-> icsk_ack , 0 , sizeof (inet_csk (sk )-> icsk_ack ));
188185}
189186
187+ static inline unsigned long
188+ icsk_timeout (const struct inet_connection_sock * icsk )
189+ {
190+ return READ_ONCE (icsk -> icsk_retransmit_timer .expires );
191+ }
192+
193+ static inline unsigned long
194+ icsk_delack_timeout (const struct inet_connection_sock * icsk )
195+ {
196+ return READ_ONCE (icsk -> icsk_delack_timer .expires );
197+ }
198+
190199static inline void inet_csk_clear_xmit_timer (struct sock * sk , const int what )
191200{
192201 struct inet_connection_sock * icsk = inet_csk (sk );
@@ -222,16 +231,15 @@ static inline void inet_csk_reset_xmit_timer(struct sock *sk, const int what,
222231 when = max_when ;
223232 }
224233
234+ when += jiffies ;
225235 if (what == ICSK_TIME_RETRANS || what == ICSK_TIME_PROBE0 ||
226236 what == ICSK_TIME_LOSS_PROBE || what == ICSK_TIME_REO_TIMEOUT ) {
227237 smp_store_release (& icsk -> icsk_pending , what );
228- icsk -> icsk_timeout = jiffies + when ;
229- sk_reset_timer (sk , & icsk -> icsk_retransmit_timer , icsk -> icsk_timeout );
238+ sk_reset_timer (sk , & icsk -> icsk_retransmit_timer , when );
230239 } else if (what == ICSK_TIME_DACK ) {
231240 smp_store_release (& icsk -> icsk_ack .pending ,
232241 icsk -> icsk_ack .pending | ICSK_ACK_TIMER );
233- icsk -> icsk_ack .timeout = jiffies + when ;
234- sk_reset_timer (sk , & icsk -> icsk_delack_timer , icsk -> icsk_ack .timeout );
242+ sk_reset_timer (sk , & icsk -> icsk_delack_timer , when );
235243 } else {
236244 pr_debug ("inet_csk BUG: unknown timer value\n" );
237245 }
0 commit comments