Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Dec 2020 22:01:13 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r368314 - head/sys/dev/cxgbe/tom
Message-ID:  <202012032201.0B3M1Dto092159@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Thu Dec  3 22:01:13 2020
New Revision: 368314
URL: https://svnweb.freebsd.org/changeset/base/368314

Log:
  Don't transmit mbufs that aren't yet ready on TOE sockets.
  
  This includes mbufs waiting for data from sendfile() I/O requests, or
  mbufs awaiting encryption for KTLS.
  
  Reviewed by:	np
  MFC after:	2 weeks
  Sponsored by:	Chelsio Communications
  Differential Revision:	https://reviews.freebsd.org/D27469

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	Thu Dec  3 22:00:41 2020	(r368313)
+++ head/sys/dev/cxgbe/tom/t4_cpl_io.c	Thu Dec  3 22:01:13 2020	(r368314)
@@ -721,6 +721,8 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep
 		for (m = sndptr; m != NULL; m = m->m_next) {
 			int n;
 
+			if ((m->m_flags & M_NOTAVAIL) != 0)
+				break;
 			if (m->m_flags & M_EXTPG) {
 #ifdef KERN_TLS
 				if (m->m_epg_tls != NULL) {
@@ -803,8 +805,9 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep
 
 		/* nothing to send */
 		if (plen == 0) {
-			KASSERT(m == NULL,
-			    ("%s: nothing to send, but m != NULL", __func__));
+			KASSERT(m == NULL || (m->m_flags & M_NOTAVAIL) != 0,
+			    ("%s: nothing to send, but m != NULL is ready",
+			    __func__));
 			break;
 		}
 
@@ -892,7 +895,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep
 		toep->txsd_avail--;
 
 		t4_l2t_send(sc, wr, toep->l2te);
-	} while (m != NULL);
+	} while (m != NULL && (m->m_flags & M_NOTAVAIL) == 0);
 
 	/* Send a FIN if requested, but only if there's no more data to send */
 	if (m == NULL && toep->flags & TPF_SEND_FIN)



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