svn commit: r368581 - stable/12/sys/dev/cxgbe/tom

John Baldwin jhb at FreeBSD.org
Sat Dec 12 16:55:24 UTC 2020


Author: jhb
Date: Sat Dec 12 16:55:23 2020
New Revision: 368581
URL: https://svnweb.freebsd.org/changeset/base/368581

Log:
  MFC 366854: Re-enable receive flow control for TOE TLS sockets.
  
  Flow control was disabled during initial TOE TLS development to
  workaround a hang (and to match the Linux TOE TLS support for T6).
  The rest of the TOE TLS code maintained credits as if flow control was
  enabled which was inherited from before the workaround was added with
  the exception that the receive window was allowed to go negative.
  This negative receive window handling (rcv_over) was because I hadn't
  realized the full implications of disabling flow control.
  
  To clean this up, re-enable flow control on TOE TLS sockets.  The
  existing TPF_FORCE_CREDITS workaround is sufficient for the original
  hang.  Now that flow control is enabled, remove the rcv_over
  workaround and instead assert that the receive window never goes
  negative matching plain TCP TOE sockets.

Modified:
  stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c
  stable/12/sys/dev/cxgbe/tom/t4_tls.c
  stable/12/sys/dev/cxgbe/tom/t4_tls.h
  stable/12/sys/dev/cxgbe/tom/t4_tom.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c
==============================================================================
--- stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c	Sat Dec 12 15:38:32 2020	(r368580)
+++ stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c	Sat Dec 12 16:55:23 2020	(r368581)
@@ -467,16 +467,6 @@ t4_rcvd_locked(struct toedev *tod, struct tcpcb *tp)
 	SOCKBUF_LOCK_ASSERT(sb);
 
 	rx_credits = sbspace(sb) > tp->rcv_wnd ? sbspace(sb) - tp->rcv_wnd : 0;
-	if (ulp_mode(toep) == ULP_MODE_TLS) {
-		if (toep->tls.rcv_over >= rx_credits) {
-			toep->tls.rcv_over -= rx_credits;
-			rx_credits = 0;
-		} else {
-			rx_credits -= toep->tls.rcv_over;
-			toep->tls.rcv_over = 0;
-		}
-	}
-
 	if (rx_credits > 0 &&
 	    (tp->rcv_wnd <= 32 * 1024 || rx_credits >= 64 * 1024 ||
 	    (rx_credits >= 16 * 1024 && tp->rcv_wnd <= 128 * 1024) ||

Modified: stable/12/sys/dev/cxgbe/tom/t4_tls.c
==============================================================================
--- stable/12/sys/dev/cxgbe/tom/t4_tls.c	Sat Dec 12 15:38:32 2020	(r368580)
+++ stable/12/sys/dev/cxgbe/tom/t4_tls.c	Sat Dec 12 16:55:23 2020	(r368581)
@@ -1491,11 +1491,9 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_head
 #endif
 
 	tp->rcv_nxt += pdu_length;
-	if (tp->rcv_wnd < pdu_length) {
-		toep->tls.rcv_over += pdu_length - tp->rcv_wnd;
-		tp->rcv_wnd = 0;
-	} else
-		tp->rcv_wnd -= pdu_length;
+	KASSERT(tp->rcv_wnd >= pdu_length,
+	    ("%s: negative window size", __func__));
+	tp->rcv_wnd -= pdu_length;
 
 	/* XXX: Not sure what to do about urgent data. */
 

Modified: stable/12/sys/dev/cxgbe/tom/t4_tls.h
==============================================================================
--- stable/12/sys/dev/cxgbe/tom/t4_tls.h	Sat Dec 12 15:38:32 2020	(r368580)
+++ stable/12/sys/dev/cxgbe/tom/t4_tls.h	Sat Dec 12 16:55:23 2020	(r368581)
@@ -268,7 +268,6 @@ struct tls_ofld_info {
 	struct tls_scmd scmd0;
 	u_int sb_off;
 	struct callout handshake_timer;
-	u_int rcv_over;
 };
 
 struct tls_key_req {

Modified: stable/12/sys/dev/cxgbe/tom/t4_tom.c
==============================================================================
--- stable/12/sys/dev/cxgbe/tom/t4_tom.c	Sat Dec 12 15:38:32 2020	(r368580)
+++ stable/12/sys/dev/cxgbe/tom/t4_tom.c	Sat Dec 12 16:55:23 2020	(r368581)
@@ -1021,8 +1021,6 @@ calc_options2(struct vi_info *vi, struct conn_params *
 	if (cp->ulp_mode == ULP_MODE_TCPDDP)
 		opt2 |= F_RX_FC_DDP;
 #endif
-	if (cp->ulp_mode == ULP_MODE_TLS)
-		opt2 |= F_RX_FC_DISABLE;
 
 	return (htobe32(opt2));
 }


More information about the svn-src-all mailing list