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
This commit is contained in:
John Baldwin 2020-12-03 22:01:13 +00:00
parent dbc5c85c66
commit 99963f5343

View File

@ -721,6 +721,8 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop)
for (m = sndptr; m != NULL; m = m->m_next) { for (m = sndptr; m != NULL; m = m->m_next) {
int n; int n;
if ((m->m_flags & M_NOTAVAIL) != 0)
break;
if (m->m_flags & M_EXTPG) { if (m->m_flags & M_EXTPG) {
#ifdef KERN_TLS #ifdef KERN_TLS
if (m->m_epg_tls != NULL) { if (m->m_epg_tls != NULL) {
@ -803,8 +805,9 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop)
/* nothing to send */ /* nothing to send */
if (plen == 0) { if (plen == 0) {
KASSERT(m == NULL, KASSERT(m == NULL || (m->m_flags & M_NOTAVAIL) != 0,
("%s: nothing to send, but m != NULL", __func__)); ("%s: nothing to send, but m != NULL is ready",
__func__));
break; break;
} }
@ -892,7 +895,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop)
toep->txsd_avail--; toep->txsd_avail--;
t4_l2t_send(sc, wr, toep->l2te); 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 */ /* Send a FIN if requested, but only if there's no more data to send */
if (m == NULL && toep->flags & TPF_SEND_FIN) if (m == NULL && toep->flags & TPF_SEND_FIN)