On 08/05/18(Tue) 14:32, Alexander Bluhm wrote:
> Hi,
>
> Historically there were slow and fast tcp timeouts. That is why
> the delack timer has a different implementation.
>
> Let's use the same macros for all TCP timer.
>
> Index: netinet/tcp_input.c
> ===================================================================
> RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/tcp_input.c,v
> retrieving revision 1.354
> diff -u -p -r1.354 tcp_input.c
> --- netinet/tcp_input.c 4 Dec 2017 13:40:34 -0000 1.354
> +++ netinet/tcp_input.c 8 May 2018 12:07:12 -0000
> @@ -176,12 +176,12 @@ do { \
> struct ifnet *ifp = NULL; \
> if (m && (m->m_flags & M_PKTHDR)) \
> ifp = if_get(m->m_pkthdr.ph_ifidx); \
> - if ((tp)->t_flags & TF_DELACK || \
> + if (TCP_TIMER_ISARMED(tp, TCPT_DELACK) || \
> (tcp_ack_on_push && (tiflags) & TH_PUSH) || \
> (ifp && (ifp->if_flags & IFF_LOOPBACK))) \
> tp->t_flags |= TF_ACKNOW; \
> else \
> - TCP_SET_DELACK(tp); \
> + TCP_TIMER_ARM_MSEC(tp, TCPT_DELACK, tcp_delack_msecs); \
Here you introduce a behavior change. TCP_SET_DELACK() would not call
timeout_add_msec() if TF_DELACK was set, you're now calling it
unconditionally. Is it safe? Or should you add a TCP_TIMER_ISARMED()
check?