git: 14c77f30b201 - stable/12 - Don't transmit mbufs that aren't yet ready on TOE sockets.

John Baldwin jhb at FreeBSD.org
Thu Dec 31 19:42:41 UTC 2020


The branch stable/12 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=14c77f30b201bf76119d59678e72051c093333c2

commit 14c77f30b201bf76119d59678e72051c093333c2
Author:     John Baldwin <jhb at FreeBSD.org>
AuthorDate: 2020-12-03 22:01:13 +0000
Commit:     John Baldwin <jhb at FreeBSD.org>
CommitDate: 2020-12-31 18:54:49 +0000

    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.
    
    Sponsored by:   Chelsio Communications
    
    (cherry picked from commit 99963f5343a017e934e4d8ea2371a86789a46ff9)
---
 sys/dev/cxgbe/tom/t4_cpl_io.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c
index 8e8c2b8639e6..43861f10b689 100644
--- a/sys/dev/cxgbe/tom/t4_cpl_io.c
+++ b/sys/dev/cxgbe/tom/t4_cpl_io.c
@@ -746,6 +746,8 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop)
 		for (m = sndptr; m != NULL; m = m->m_next) {
 			int n;
 
+			if ((m->m_flags & M_NOTAVAIL) != 0)
+				break;
 			if (IS_AIOTX_MBUF(m))
 				n = sglist_count_vmpages(aiotx_mbuf_pages(m),
 				    aiotx_mbuf_pgoff(m), m->m_len);
@@ -821,8 +823,9 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop)
 
 		/* 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;
 		}
 
@@ -910,7 +913,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop)
 		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)


More information about the dev-commits-src-all mailing list