svn commit: r252716 - head/sys/dev/cxgbe/tom

Navdeep Parhar np at FreeBSD.org
Thu Jul 4 19:44:31 UTC 2013


Author: np
Date: Thu Jul  4 19:44:30 2013
New Revision: 252716
URL: http://svnweb.freebsd.org/changeset/base/252716

Log:
  Pay attention to TCP_NODELAY when it's set/unset after the connection
  is established.
  
  MFC after:	1 day

Modified:
  head/sys/dev/cxgbe/tom/t4_tom.c

Modified: head/sys/dev/cxgbe/tom/t4_tom.c
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_tom.c	Thu Jul  4 19:15:41 2013	(r252715)
+++ head/sys/dev/cxgbe/tom/t4_tom.c	Thu Jul  4 19:44:30 2013	(r252716)
@@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$");
 #include "common/t4_msg.h"
 #include "common/t4_regs.h"
 #include "common/t4_regs_values.h"
+#include "common/t4_tcb.h"
 #include "tom/t4_tom_l2t.h"
 #include "tom/t4_tom.h"
 
@@ -331,6 +332,30 @@ t4_pcb_detach(struct toedev *tod __unuse
 }
 
 /*
+ * setsockopt handler.
+ */
+static void
+t4_ctloutput(struct toedev *tod, struct tcpcb *tp, int dir, int name)
+{
+	struct adapter *sc = tod->tod_softc;
+	struct toepcb *toep = tp->t_toe;
+
+	if (dir == SOPT_GET)
+		return;
+
+	CTR4(KTR_CXGBE, "%s: tp %p, dir %u, name %u", __func__, tp, dir, name);
+
+	switch (name) {
+	case TCP_NODELAY:
+		t4_set_tcb_field(sc, toep, 1, W_TCB_T_FLAGS, V_TF_NAGLE(1),
+		    V_TF_NAGLE(tp->t_flags & TF_NODELAY ? 0 : 1));
+		break;
+	default:
+		break;
+	}
+}
+
+/*
  * The TOE driver will not receive any more CPLs for the tid associated with the
  * toepcb; release the hold on the inpcb.
  */
@@ -946,6 +971,7 @@ t4_tom_activate(struct adapter *sc)
 	tod->tod_syncache_removed = t4_syncache_removed;
 	tod->tod_syncache_respond = t4_syncache_respond;
 	tod->tod_offload_socket = t4_offload_socket;
+	tod->tod_ctloutput = t4_ctloutput;
 
 	for_each_port(sc, i)
 		TOEDEV(sc->port[i]->ifp) = &td->tod;


More information about the svn-src-head mailing list