diff options
author | Navdeep Parhar <np@FreeBSD.org> | 2020-08-31 22:44:59 +0000 |
---|---|---|
committer | Navdeep Parhar <np@FreeBSD.org> | 2020-08-31 22:44:59 +0000 |
commit | 565b8fce23e6250b673a956ce753e37b201a5847 (patch) | |
tree | e6f2a18c9bf040c0cad5034d934115378f753a2d /sys/dev/cxgbe | |
parent | 73fd212c813d74ad593c93904c5d8edf763e6c54 (diff) | |
download | src-565b8fce23e6250b673a956ce753e37b201a5847.tar.gz src-565b8fce23e6250b673a956ce753e37b201a5847.zip |
cxgbe(4): Check for descriptors before writing a TLS or raw work request.
This fixes a regression in r362905.
Submitted by: jhb@
Sponsored by: Chelsio Communications
Notes
Notes:
svn path=/head/; revision=365014
Diffstat (limited to 'sys/dev/cxgbe')
-rw-r--r-- | sys/dev/cxgbe/t4_sge.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index ffc8ee12f74a..5a938179b084 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -3004,6 +3004,14 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx, bool *coalescing) MPASS(rc != 0 && rc != EAGAIN); MPASS(txp->npkt == 0); + + n = tx_len16_to_desc(mbuf_len16(m0)); + if (__predict_false(avail < n)) { + avail += reclaim_tx_descs(txq, min(n, 32)); + if (avail < n) + break; /* out of descriptors */ + } + wr = &eq->desc[eq->pidx]; if (mbuf_cflags(m0) & MC_RAW_WR) { n = write_raw_wr(txq, wr, m0, avail); @@ -3014,12 +3022,6 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx, bool *coalescing) avail); #endif } else { - n = tx_len16_to_desc(mbuf_len16(m0)); - if (__predict_false(avail < n)) { - avail += reclaim_tx_descs(txq, 32); - if (avail < n) - break; /* out of descriptors */ - } ETHER_BPF_MTAP(ifp, m0); if (sc->flags & IS_VF) n = write_txpkt_vm_wr(sc, txq, m0); |