Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Apr 2016 07:23:14 +0000
From:      Phabricator <phabric-noreply@FreeBSD.org>
To:        freebsd-net@freebsd.org
Subject:   [Differential] D6120: tcp/syncache: Set flowid and hash type properly for SYN|ACK
Message-ID:  <30d67e8c5c0bbc71659390a3ee2427fa@localhost.localdomain>
In-Reply-To: <differential-rev-PHID-DREV-wo3rxa6lpqbmh4zlzhwf-req@FreeBSD.org>
References:  <differential-rev-PHID-DREV-wo3rxa6lpqbmh4zlzhwf-req@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
This revision was automatically updated to reflect the committed changes.
Closed by commit rS298769: tcp/syncache: Set flowid and hash type properly for SYN|ACK (authored by sephe).

CHANGED PRIOR TO COMMIT
  https://reviews.freebsd.org/D6120?vs=15647&id=15727#toc

REPOSITORY
  rS FreeBSD src repository

CHANGES SINCE LAST UPDATE
  https://reviews.freebsd.org/D6120?vs=15647&id=15727

REVISION DETAIL
  https://reviews.freebsd.org/D6120

AFFECTED FILES
  head/sys/netinet/tcp_syncache.c

CHANGE DETAILS
  diff --git a/head/sys/netinet/tcp_syncache.c b/head/sys/netinet/tcp_syncache.c
  --- a/head/sys/netinet/tcp_syncache.c
  +++ b/head/sys/netinet/tcp_syncache.c
  @@ -127,7 +127,8 @@
   static void	 syncache_drop(struct syncache *, struct syncache_head *);
   static void	 syncache_free(struct syncache *);
   static void	 syncache_insert(struct syncache *, struct syncache_head *);
  -static int	 syncache_respond(struct syncache *, struct syncache_head *, int);
  +static int	 syncache_respond(struct syncache *, struct syncache_head *, int,
  +		    const struct mbuf *);
   static struct	 socket *syncache_socket(struct syncache *, struct socket *,
   		    struct mbuf *m);
   static void	 syncache_timeout(struct syncache *sc, struct syncache_head *sch,
  @@ -457,7 +458,7 @@
   			free(s, M_TCPLOG);
   		}
   
  -		syncache_respond(sc, sch, 1);
  +		syncache_respond(sc, sch, 1, NULL);
   		TCPSTAT_INC(tcps_sc_retransmitted);
   		syncache_timeout(sc, sch, 0);
   	}
  @@ -1307,7 +1308,7 @@
   			    s, __func__);
   			free(s, M_TCPLOG);
   		}
  -		if (syncache_respond(sc, sch, 1) == 0) {
  +		if (syncache_respond(sc, sch, 1, m) == 0) {
   			sc->sc_rxmits = 0;
   			syncache_timeout(sc, sch, 1);
   			TCPSTAT_INC(tcps_sndacks);
  @@ -1474,7 +1475,7 @@
   	/*
   	 * Do a standard 3-way handshake.
   	 */
  -	if (syncache_respond(sc, sch, 0) == 0) {
  +	if (syncache_respond(sc, sch, 0, m) == 0) {
   		if (V_tcp_syncookies && V_tcp_syncookiesonly && sc != &scs)
   			syncache_free(sc);
   		else if (sc != &scs)
  @@ -1505,7 +1506,8 @@
   }
   
   static int
  -syncache_respond(struct syncache *sc, struct syncache_head *sch, int locked)
  +syncache_respond(struct syncache *sc, struct syncache_head *sch, int locked,
  +    const struct mbuf *m0)
   {
   	struct ip *ip = NULL;
   	struct mbuf *m;
  @@ -1686,6 +1688,10 @@
   
   	M_SETFIB(m, sc->sc_inc.inc_fibnum);
   	m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum);
  +	if (m0 != NULL && M_HASHTYPE_GET(m0) != M_HASHTYPE_NONE) {
  +		m->m_pkthdr.flowid = m0->m_pkthdr.flowid;
  +		M_HASHTYPE_SET(m, M_HASHTYPE_GET(m0));
  +	}
   #ifdef INET6
   	if (sc->sc_inc.inc_flags & INC_ISIPV6) {
   		m->m_pkthdr.csum_flags = CSUM_TCP_IPV6;

EMAIL PREFERENCES
  https://reviews.freebsd.org/settings/panel/emailpreferences/

To: sepherosa_gmail.com, adrian, rwatson, gnn, lstewart, glebius, delphij, mike-karels.net, jtl, network, transport, hiren, sbruno
Cc: hselasky, freebsd-net-list

[-- Attachment #2 --]
diff --git a/head/sys/netinet/tcp_syncache.c b/head/sys/netinet/tcp_syncache.c
--- a/head/sys/netinet/tcp_syncache.c
+++ b/head/sys/netinet/tcp_syncache.c
@@ -127,7 +127,8 @@
 static void	 syncache_drop(struct syncache *, struct syncache_head *);
 static void	 syncache_free(struct syncache *);
 static void	 syncache_insert(struct syncache *, struct syncache_head *);
-static int	 syncache_respond(struct syncache *, struct syncache_head *, int);
+static int	 syncache_respond(struct syncache *, struct syncache_head *, int,
+		    const struct mbuf *);
 static struct	 socket *syncache_socket(struct syncache *, struct socket *,
 		    struct mbuf *m);
 static void	 syncache_timeout(struct syncache *sc, struct syncache_head *sch,
@@ -457,7 +458,7 @@
 			free(s, M_TCPLOG);
 		}
 
-		syncache_respond(sc, sch, 1);
+		syncache_respond(sc, sch, 1, NULL);
 		TCPSTAT_INC(tcps_sc_retransmitted);
 		syncache_timeout(sc, sch, 0);
 	}
@@ -1307,7 +1308,7 @@
 			    s, __func__);
 			free(s, M_TCPLOG);
 		}
-		if (syncache_respond(sc, sch, 1) == 0) {
+		if (syncache_respond(sc, sch, 1, m) == 0) {
 			sc->sc_rxmits = 0;
 			syncache_timeout(sc, sch, 1);
 			TCPSTAT_INC(tcps_sndacks);
@@ -1474,7 +1475,7 @@
 	/*
 	 * Do a standard 3-way handshake.
 	 */
-	if (syncache_respond(sc, sch, 0) == 0) {
+	if (syncache_respond(sc, sch, 0, m) == 0) {
 		if (V_tcp_syncookies && V_tcp_syncookiesonly && sc != &scs)
 			syncache_free(sc);
 		else if (sc != &scs)
@@ -1505,7 +1506,8 @@
 }
 
 static int
-syncache_respond(struct syncache *sc, struct syncache_head *sch, int locked)
+syncache_respond(struct syncache *sc, struct syncache_head *sch, int locked,
+    const struct mbuf *m0)
 {
 	struct ip *ip = NULL;
 	struct mbuf *m;
@@ -1686,6 +1688,10 @@
 
 	M_SETFIB(m, sc->sc_inc.inc_fibnum);
 	m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum);
+	if (m0 != NULL && M_HASHTYPE_GET(m0) != M_HASHTYPE_NONE) {
+		m->m_pkthdr.flowid = m0->m_pkthdr.flowid;
+		M_HASHTYPE_SET(m, M_HASHTYPE_GET(m0));
+	}
 #ifdef INET6
 	if (sc->sc_inc.inc_flags & INC_ISIPV6) {
 		m->m_pkthdr.csum_flags = CSUM_TCP_IPV6;


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