aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Strobl <marius@FreeBSD.org>2018-07-22 17:51:11 +0000
committerMarius Strobl <marius@FreeBSD.org>2018-07-22 17:51:11 +0000
commit7474544bac68ff35697d09b293c1eaa6dcf3db03 (patch)
tree614d0cfecae5f29e8e2031eceaaf59ee93e85e07
parent8b8d90931d8089fc8329f9c67883b7ccd9266513 (diff)
downloadsrc-7474544bac68ff35697d09b293c1eaa6dcf3db03.tar.gz
src-7474544bac68ff35697d09b293c1eaa6dcf3db03.zip
Use the maximum of isc_tx_{nsegments,tso_segments_max} for MAX_TX_DESC.
Since r336313, TSO support for LEM-class devices is removed again as it was before the conversion of {l,}em(4) to iflib(4) in r311849 and as a result, isc_tx_tso_segments_max is 0 for LEM-class devices now. Thus, inappropriate watermarks were used for this class. This is really only a band-aid, though, because so far iflib(9) doesn't fully take into account that DMA engines can support different maxima of segments for transfers of TSO and non-TSO packets. For example, the DESC_RECLAIMABLE macro is based on isc_tx_nsegments while MAX_TX_DESC used isc_tx_tso_segments_max only. For most in-tree consumers that doesn't make a difference as the maxima are the same for both kinds of transfers (that is, apart from the fact that TSO may require up to 2 sentinel descriptors but also not with every MAC supported). However, isc_tx_nsegments is 8 but isc_tx_tso_segments_max is 85 by default with ixl(4).
Notes
Notes: svn path=/head/; revision=336612
-rw-r--r--sys/net/iflib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/net/iflib.c b/sys/net/iflib.c
index 017560f5ec3c..0a510da245a5 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -2831,7 +2831,8 @@ txq_max_rs_deferred(iflib_txq_t txq)
/* XXX we should be setting this to something other than zero */
#define RECLAIM_THRESH(ctx) ((ctx)->ifc_sctx->isc_tx_reclaim_thresh)
-#define MAX_TX_DESC(ctx) ((ctx)->ifc_softc_ctx.isc_tx_tso_segments_max)
+#define MAX_TX_DESC(ctx) max((ctx)->ifc_softc_ctx.isc_tx_tso_segments_max, \
+ (ctx)->ifc_softc_ctx.isc_tx_nsegments)
static inline bool
iflib_txd_db_check(if_ctx_t ctx, iflib_txq_t txq, int ring, qidx_t in_use)