Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Jul 2018 12:28:17 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r336061 - head/sys/netinet/tcp_stacks
Message-ID:  <201807071228.w67CSHFD094964@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Sat Jul  7 12:28:16 2018
New Revision: 336061
URL: https://svnweb.freebsd.org/changeset/base/336061

Log:
  Allow alternate TCP stack to populate the TCP FO client cookie
  cache.
  
  Without this patch, TCP FO could be used when using alternate
  TCP stack, but only existing entires in the TCP client cookie
  cache could be used. This cache was not populated by connections
  using alternate TCP stacks.
  
  Sponsored by:		Netflix, Inc.

Modified:
  head/sys/netinet/tcp_stacks/fastpath.c
  head/sys/netinet/tcp_stacks/rack.c

Modified: head/sys/netinet/tcp_stacks/fastpath.c
==============================================================================
--- head/sys/netinet/tcp_stacks/fastpath.c	Sat Jul  7 11:53:39 2018	(r336060)
+++ head/sys/netinet/tcp_stacks/fastpath.c	Sat Jul  7 12:28:16 2018	(r336061)
@@ -109,6 +109,7 @@ __FBSDID("$FreeBSD$");
 #include <netinet/tcpip.h>
 #include <netinet/tcp_syncache.h>
 #include <netinet/cc/cc.h>
+#include <netinet/tcp_fastopen.h>
 #ifdef TCPDEBUG
 #include <netinet/tcp_debug.h>
 #endif /* TCPDEBUG */
@@ -1761,6 +1762,13 @@ tcp_do_segment_fastslow(struct mbuf *m, struct tcphdr 
 		if ((tp->t_flags & TF_SACK_PERMIT) &&
 		    (to.to_flags & TOF_SACKPERM) == 0)
 			tp->t_flags &= ~TF_SACK_PERMIT;
+		if (IS_FASTOPEN(tp->t_flags)) {
+			if (to.to_flags & TOF_FASTOPEN)
+				tcp_fastopen_update_cache(tp, to.to_mss,
+				    to.to_tfo_len, to.to_tfo_cookie);
+			else
+				tcp_fastopen_disable_path(tp);
+		}
 	}
 
 	/*
@@ -2211,6 +2219,13 @@ tcp_do_segment_fastack(struct mbuf *m, struct tcphdr *
 		if ((tp->t_flags & TF_SACK_PERMIT) &&
 		    (to.to_flags & TOF_SACKPERM) == 0)
 			tp->t_flags &= ~TF_SACK_PERMIT;
+		if (IS_FASTOPEN(tp->t_flags)) {
+			if (to.to_flags & TOF_FASTOPEN)
+				tcp_fastopen_update_cache(tp, to.to_mss,
+				    to.to_tfo_len, to.to_tfo_cookie);
+			else
+				tcp_fastopen_disable_path(tp);
+		}
 	}
 
 	/*

Modified: head/sys/netinet/tcp_stacks/rack.c
==============================================================================
--- head/sys/netinet/tcp_stacks/rack.c	Sat Jul  7 11:53:39 2018	(r336060)
+++ head/sys/netinet/tcp_stacks/rack.c	Sat Jul  7 12:28:16 2018	(r336061)
@@ -6656,6 +6656,13 @@ rack_hpts_do_segment(struct mbuf *m, struct tcphdr *th
 			if ((tp->t_flags & TF_SACK_PERMIT) &&
 			    (to.to_flags & TOF_SACKPERM) == 0)
 				tp->t_flags &= ~TF_SACK_PERMIT;
+			if (IS_FASTOPEN(tp->t_flags)) {
+				if (to.to_flags & TOF_FASTOPEN)
+					tcp_fastopen_update_cache(tp, to.to_mss,
+					    to.to_tfo_len, to.to_tfo_cookie);
+				else
+					tcp_fastopen_disable_path(tp);
+			}
 		}
 		/*
 		 * At this point we are at the initial call. Here we decide



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807071228.w67CSHFD094964>