aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2018-09-06 11:06:07 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2018-09-06 11:06:07 +0000
commit2d32b0a3049c22f13062396101ba622686a39ec6 (patch)
treed0930ca4dbeb3b70a1ae441e659585f62e8f22a2 /sys/dev
parentcc4f3d0ae2ee820dce2863d2ea1b901188e9fbdb (diff)
downloadsrc-2d32b0a3049c22f13062396101ba622686a39ec6.tar.gz
src-2d32b0a3049c22f13062396101ba622686a39ec6.zip
Maximum number of mbuf frags is off-by-one for worst case scenario in mlx5en(4).
Inspecting the PRM no more than 0x3F data segments, DS, of size 16 bytes is allowed. Worst case scenario summary of DS usage: Header is fixed: 2 DS Maximum inlining: 98 => (98 - 2) / 16 = 6 DS Remainder: 0x3F - 2 - 6 = 55 DS (mbuf frags) Previously a value of 56 DS was used and this would work in the normal case because not all inline data area was used up. MFC after: 3 days Approved by: re (marius) Sponsored by: Mellanox Technologies
Notes
Notes: svn path=/head/; revision=338489
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/mlx5/mlx5_en/en.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/mlx5/mlx5_en/en.h b/sys/dev/mlx5/mlx5_en/en.h
index f125313cd7b9..eff172b55cdc 100644
--- a/sys/dev/mlx5/mlx5_en/en.h
+++ b/sys/dev/mlx5/mlx5_en/en.h
@@ -123,7 +123,8 @@
#define MLX5E_MAX_TX_MBUF_SIZE 65536 /* bytes */
#define MLX5E_MAX_TX_MBUF_FRAGS \
((MLX5_SEND_WQE_MAX_WQEBBS * MLX5_SEND_WQEBB_NUM_DS) - \
- (MLX5E_MAX_TX_HEADER / MLX5_SEND_WQE_DS)) /* units */
+ (MLX5E_MAX_TX_HEADER / MLX5_SEND_WQE_DS) - \
+ 1 /* the maximum value of the DS counter is 0x3F and not 0x40 */) /* units */
#define MLX5E_MAX_TX_INLINE \
(MLX5E_MAX_TX_HEADER - sizeof(struct mlx5e_tx_wqe) + \
sizeof(((struct mlx5e_tx_wqe *)0)->eth.inline_hdr_start)) /* bytes */