|author||Shahaf Shuler <email@example.com>||2017-09-14 13:50:39 +0300|
|committer||Ferruh Yigit <firstname.lastname@example.org>||2017-10-06 02:49:48 +0200|
net/mlx5: enforce Tx num of segments limitation
Mellanox NICs has a limitation on the number of mbuf segments a multi segment mbuf can have. The max number depends on the Tx offloads requested. The current code not enforce such limitation, which might cause malformed work requests to be written to the device. This commit adds verification for the number of mbuf segments posted to the device. In case of overflow the packet will not be sent. In addition update the nic documentation with the limitation. Considering device limitation is 63 data segments in a work request, the maximum number of segment in mbuf was calculated taking TSO as the worst case: max_nb_segs = 63 - (control_segment + ethernet segment + TSO headers inline + inline segment + extra inline to align to cacheline) Cc: email@example.com Signed-off-by: Shahaf Shuler <firstname.lastname@example.org> Acked-by: Yongseok Koh <email@example.com> Acked-by: Nelio Laranjeiro <firstname.lastname@example.org>
Diffstat (limited to 'drivers/net/mlx5/mlx5_defs.h')
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/mlx5/mlx5_defs.h b/drivers/net/mlx5/mlx5_defs.h
index a76bc6f..59ff00d 100644
@@ -100,7 +100,8 @@
* Maximum size of burst for vectorized Tx. This is related to the maximum size
- * of Enhaned MPW (eMPW) WQE as vectorized Tx is supported with eMPW.
+ * of Enhanced MPW (eMPW) WQE as vectorized Tx is supported with eMPW.
+ * Careful when changing, large value can cause WQE DS to overlap.
#define MLX5_VPMD_TX_MAX_BURST 32U