summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarybchik <arybchik@FreeBSD.org>2015-03-25 12:57:43 +0000
committerarybchik <arybchik@FreeBSD.org>2015-03-25 12:57:43 +0000
commiteb99d1408972d175d24a5192fe4d34652b769ce9 (patch)
treed6a20555cfbcba77780424ddd2fe71b7c7fbfea6
parentb416a7471e94c2167051e7b9be8d45f81e1e2f23 (diff)
downloadFreeBSD-src-eb99d1408972d175d24a5192fe4d34652b769ce9.zip
FreeBSD-src-eb99d1408972d175d24a5192fe4d34652b769ce9.tar.gz
MFC: 279147
sfxge: TxQ block level should use EFX_TXQ_LIMIT as maximum TxQ size Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor)
-rw-r--r--sys/dev/sfxge/sfxge_tx.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/sys/dev/sfxge/sfxge_tx.c b/sys/dev/sfxge/sfxge_tx.c
index f557be0..e23d94f 100644
--- a/sys/dev/sfxge/sfxge_tx.c
+++ b/sys/dev/sfxge/sfxge_tx.c
@@ -67,16 +67,22 @@ __FBSDID("$FreeBSD$");
#include "sfxge.h"
#include "sfxge_tx.h"
-/* Set the block level to ensure there is space to generate a
- * large number of descriptors for TSO. With minimum MSS and
- * maximum mbuf length we might need more than a ring-ful of
- * descriptors, but this should not happen in practice except
- * due to deliberate attack. In that case we will truncate
- * the output at a packet boundary.
+/*
+ * Estimate maximum number of Tx descriptors required for TSO packet.
+ * With minimum MSS and maximum mbuf length we might need more (even
+ * than a ring-ful of descriptors), but this should not happen in
+ * practice except due to deliberate attack. In that case we will
+ * truncate the output at a packet boundary.
*/
#define SFXGE_TSO_MAX_DESC \
(SFXGE_TSO_MAX_SEGS * 2 + SFXGE_TX_MAPPING_MAX_SEG - 1)
-#define SFXGE_TXQ_BLOCK_LEVEL(_entries) ((_entries) - SFXGE_TSO_MAX_DESC)
+
+/*
+ * Set the block level to ensure there is space to generate a
+ * large number of descriptors for TSO.
+ */
+#define SFXGE_TXQ_BLOCK_LEVEL(_entries) \
+ (EFX_TXQ_LIMIT(_entries) - SFXGE_TSO_MAX_DESC)
#ifdef SFXGE_HAVE_MQ
OpenPOWER on IntegriCloud