Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Apr 2015 17:40:36 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r281214 - stable/10/sys/dev/cxgbe/tom
Message-ID:  <201504071740.t37HeaPk050112@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: np
Date: Tue Apr  7 17:40:35 2015
New Revision: 281214
URL: https://svnweb.freebsd.org/changeset/base/281214

Log:
  MFC r276574:
  
  cxgbe/tom: fix the MSS calculation for IPv6 connections handled by the TOE.

Modified:
  stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c
==============================================================================
--- stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c	Tue Apr  7 17:33:51 2015	(r281213)
+++ stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c	Tue Apr  7 17:40:35 2015	(r281214)
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
 #include <netinet/in.h>
 #include <netinet/in_pcb.h>
 #include <netinet/ip.h>
+#include <netinet/ip6.h>
 #include <netinet/tcp_var.h>
 #define TCPSTATES
 #include <netinet/tcp_fsm.h>
@@ -236,11 +237,20 @@ static void
 assign_rxopt(struct tcpcb *tp, unsigned int opt)
 {
 	struct toepcb *toep = tp->t_toe;
+	struct inpcb *inp = tp->t_inpcb;
 	struct adapter *sc = td_adapter(toep->td);
+	int n;
+
+	INP_LOCK_ASSERT(inp);
 
-	INP_LOCK_ASSERT(tp->t_inpcb);
+	if (inp->inp_inc.inc_flags & INC_ISIPV6)
+		n = sizeof(struct ip6_hdr) + sizeof(struct tcphdr);
+	else
+		n = sizeof(struct ip) + sizeof(struct tcphdr);
+	tp->t_maxseg = tp->t_maxopd = sc->params.mtus[G_TCPOPT_MSS(opt)] - n;
 
-	tp->t_maxseg = tp->t_maxopd = sc->params.mtus[G_TCPOPT_MSS(opt)] - 40;
+	CTR4(KTR_CXGBE, "%s: tid %d, mtu_idx %u (%u)", __func__, toep->tid,
+	    G_TCPOPT_MSS(opt), sc->params.mtus[G_TCPOPT_MSS(opt)]);
 
 	if (G_TCPOPT_TSTAMP(opt)) {
 		tp->t_flags |= TF_RCVD_TSTMP;	/* timestamps ok */



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