summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_prm.h
diff options
context:
space:
mode:
authorShahaf Shuler <shahafs@mellanox.com>2017-09-14 13:50:39 +0300
committerFerruh Yigit <ferruh.yigit@intel.com>2017-10-06 02:49:48 +0200
commit883ce1724b652d8da1cacdaf8409580b24d6a33d (patch)
tree931e290a7b2f9815bef0de65e8911d75f0727a2d /drivers/net/mlx5/mlx5_prm.h
parent24c14430cdc4556a30a1e608f67230e881718f7f (diff)
downloaddpdk-883ce1724b652d8da1cacdaf8409580b24d6a33d.zip
dpdk-883ce1724b652d8da1cacdaf8409580b24d6a33d.tar.gz
dpdk-883ce1724b652d8da1cacdaf8409580b24d6a33d.tar.xz
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: stable@dpdk.org Signed-off-by: Shahaf Shuler <shahafs@mellanox.com> Acked-by: Yongseok Koh <yskoh@mellanox.com> Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_prm.h')
-rw-r--r--drivers/net/mlx5/mlx5_prm.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/mlx5/mlx5_prm.h b/drivers/net/mlx5/mlx5_prm.h
index 8b82b5e..e00be81 100644
--- a/drivers/net/mlx5/mlx5_prm.h
+++ b/drivers/net/mlx5/mlx5_prm.h
@@ -151,6 +151,9 @@
/* Default mark value used when none is provided. */
#define MLX5_FLOW_MARK_DEFAULT 0xffffff
+/* Maximum number of DS in WQE. */
+#define MLX5_DSEG_MAX 63
+
/* Subset of struct mlx5_wqe_eth_seg. */
struct mlx5_wqe_eth_seg_small {
uint32_t rsvd0;