svn commit: r276574 - head/sys/dev/cxgbe/tom
Navdeep Parhar
np at FreeBSD.org
Fri Jan 2 21:13:26 UTC 2015
Author: np
Date: Fri Jan 2 21:13:24 2015
New Revision: 276574
URL: https://svnweb.freebsd.org/changeset/base/276574
Log:
cxgbe/tom: fix the MSS calculation for IPv6 connections handled by the TOE.
MFC after: 1 week
Modified:
head/sys/dev/cxgbe/tom/t4_cpl_io.c
Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Jan 2 21:09:54 2015 (r276573)
+++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Jan 2 21:13:24 2015 (r276574)
@@ -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 */
More information about the svn-src-all
mailing list