Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Sep 2018 08:03:52 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r338549 - stable/10/sys/dev/mlx5/mlx5_en
Message-ID:  <201809100803.w8A83rBp081769@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Mon Sep 10 08:03:52 2018
New Revision: 338549
URL: https://svnweb.freebsd.org/changeset/base/338549

Log:
  MFC r338489:
  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.
  
  Sponsored by:		Mellanox Technologies

Modified:
  stable/10/sys/dev/mlx5/mlx5_en/en.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h
==============================================================================
--- stable/10/sys/dev/mlx5/mlx5_en/en.h	Mon Sep 10 08:02:02 2018	(r338548)
+++ stable/10/sys/dev/mlx5/mlx5_en/en.h	Mon Sep 10 08:03:52 2018	(r338549)
@@ -125,7 +125,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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201809100803.w8A83rBp081769>