aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sfxge/sfxge_tx.c
diff options
context:
space:
mode:
authorAndrew Rybchenko <arybchik@FreeBSD.org>2015-02-22 07:20:04 +0000
committerAndrew Rybchenko <arybchik@FreeBSD.org>2015-02-22 07:20:04 +0000
commit49448887830d5808d8ab9decf348b36ee44daefb (patch)
tree258f6160d105ac84fbe48ecffa2fc4b131768c0d /sys/dev/sfxge/sfxge_tx.c
parentbce36787451acafdb30cadc070a4f3557d94edd4 (diff)
Notes
Diffstat (limited to 'sys/dev/sfxge/sfxge_tx.c')
-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 442cd4106953b..6d5146825784e 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