From dcbc025ff1395ef0b673db99d4509b8fe746ab61 Mon Sep 17 00:00:00 2001 From: Sean Bruno Date: Wed, 19 Jul 2017 21:18:04 +0000 Subject: [PATCH] Don't cache mbuf pointers if the number of descriptors is greater than the number of buffers. Submitted by: Matt Macy Sponsored by: Limelight Networks --- sys/net/iflib.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 633ebc9668ba..2ec1dadef32c 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -2927,6 +2927,14 @@ iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag_t tag, bus_dmamap_t map, m_free(tmp); continue; } + m = m->m_next; + count++; + } while (m != NULL); + if (count > *nsegs) + return (0); + m = *m0; + count = 0; + do { next = (pidx + count) & (ntxd-1); MPASS(ifsd_m[next] == NULL); ifsd_m[next] = m;