When VLAN insertion is requested the vlan size must be added to the calculation of the TSO header size, as it is not embedded within the mbuf l2 length.
Fixes: 98083fd482a2 ("net/mlx5: add hardware TSO support") Cc: sta...@dpdk.org Signed-off-by: Shahaf Shuler <shah...@mellanox.com> --- drivers/net/mlx5/mlx5_rxtx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 823aac8..9e8c6d0 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -548,10 +548,11 @@ buf->ol_flags & (PKT_TX_TUNNEL_GRE | PKT_TX_TUNNEL_VXLAN); + uint8_t vlan_sz = (buf->ol_flags & + PKT_TX_VLAN_PKT) ? 4 : 0; - tso_header_sz = buf->l2_len + buf->l3_len + - buf->l4_len; - + tso_header_sz = buf->l2_len + vlan_sz + + buf->l3_len + buf->l4_len; if (is_tunneled && txq->tunnel_en) { tso_header_sz += buf->outer_l2_len + buf->outer_l3_len; -- 1.8.3.1