net/mlx5: fix TSO multi-segment inline length

Message ID 20210620063028.24433-1-viacheslavo@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: fix TSO multi-segment inline length |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Functional success Functional Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/github-robot success github build: passed
ci/iol-mellanox-Functional fail Functional Testing issues
ci/iol-intel-Performance success Performance Testing PASS

Commit Message

Slava Ovsiienko June 20, 2021, 6:30 a.m. UTC
  The inline data length for TSO ethernet segment should be
calculated from the TSO header instead of the inline size
configured by txq_inline_min devarg or reported by the NIC.
It is imposed by the nature of TSO offload - inline header
is being duplicated to every output TCP packet.

Fixes: cacb44a09962 ("net/mlx5: add no-inline Tx flag")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_tx.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Raslan Darawsheh June 30, 2021, 8:41 a.m. UTC | #1
Hi,

> -----Original Message-----
> From: Slava Ovsiienko <viacheslavo@nvidia.com>
> Sent: Sunday, June 20, 2021 9:30 AM
> To: dev@dpdk.org
> Cc: Raslan Darawsheh <rasland@nvidia.com>; Matan Azrad
> <matan@nvidia.com>; stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix TSO multi-segment inline length
> 
> The inline data length for TSO ethernet segment should be calculated from
> the TSO header instead of the inline size configured by txq_inline_min
> devarg or reported by the NIC.
> It is imposed by the nature of TSO offload - inline header is being duplicated
> to every output TCP packet.
> 
> Fixes: cacb44a09962 ("net/mlx5: add no-inline Tx flag")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh
  

Patch

diff --git a/drivers/net/mlx5/mlx5_tx.h b/drivers/net/mlx5/mlx5_tx.h
index 7d3ff8407c..e8b1c0f108 100644
--- a/drivers/net/mlx5/mlx5_tx.h
+++ b/drivers/net/mlx5/mlx5_tx.h
@@ -1338,7 +1338,8 @@  mlx5_tx_eseg_mdat(struct mlx5_txq_data *__rte_restrict txq,
 		 * Copying may be interrupted inside the routine
 		 * if run into no inline hint flag.
 		 */
-		copy = tlen >= txq->inlen_mode ? 0 : (txq->inlen_mode - tlen);
+		copy = tso ? inlen : txq->inlen_mode;
+		copy = tlen >= copy ? 0 : (copy - tlen);
 		copy = mlx5_tx_mseg_memcpy(pdst, loc, part, copy, olx);
 		tlen += copy;
 		if (likely(inlen <= tlen) || copy < part) {