net/mlx5: fix the first segment inline length

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

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-aarch64-unit-testing success Testing PASS
ci/intel-Testing success Testing PASS

Commit Message

Alexander Kozyrev Nov. 8, 2022, 1:45 p.m. UTC
  Packets can be split into several mbufs with various data sizes.
There is no limitation on how small these segments can be.
But there is a limitation on Tx side for inline configuration:
send WQEs with inline headers less than the required are dropped.
The very first segment must be more than minimal inline eth segment.
Enforce this requirement by merging a few segments in this case.

Fixes: ec837ad0fc7 ("net/mlx5: fix multi-segment inline for the first segments")
Cc: stable@dpdk.org

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
---
 drivers/net/mlx5/mlx5_tx.h | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Slava Ovsiienko Nov. 8, 2022, 6:58 p.m. UTC | #1
> -----Original Message-----
> From: Alexander Kozyrev <akozyrev@nvidia.com>
> Sent: Tuesday, November 8, 2022 15:45
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>; Michael Baum
> <michaelba@nvidia.com>
> Subject: [PATCH] net/mlx5: fix the first segment inline length
> 
> Packets can be split into several mbufs with various data sizes.
> There is no limitation on how small these segments can be.
> But there is a limitation on Tx side for inline configuration:
> send WQEs with inline headers less than the required are dropped.
> The very first segment must be more than minimal inline eth segment.
> Enforce this requirement by merging a few segments in this case.
> 
> Fixes: ec837ad0fc7 ("net/mlx5: fix multi-segment inline for the first
> segments")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
  
Raslan Darawsheh Nov. 9, 2022, 8:26 a.m. UTC | #2
Hi,

> -----Original Message-----
> From: Alexander Kozyrev <akozyrev@nvidia.com>
> Sent: Tuesday, November 8, 2022 3:45 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>; Slava
> Ovsiienko <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>;
> Michael Baum <michaelba@nvidia.com>
> Subject: [PATCH] net/mlx5: fix the first segment inline length
> 
> Packets can be split into several mbufs with various data sizes.
> There is no limitation on how small these segments can be.
> But there is a limitation on Tx side for inline configuration:
> send WQEs with inline headers less than the required are dropped.
> The very first segment must be more than minimal inline eth segment.
> Enforce this requirement by merging a few segments in this case.
> 
> Fixes: ec837ad0fc7 ("net/mlx5: fix multi-segment inline for the first
> segments")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Alexander Kozyrev <akozyrev@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 6471ebf59f..a44050a1ce 100644
--- a/drivers/net/mlx5/mlx5_tx.h
+++ b/drivers/net/mlx5/mlx5_tx.h
@@ -1994,6 +1994,8 @@  mlx5_tx_packet_multi_inline(struct mlx5_txq_data *__rte_restrict txq,
 		} else if (mbuf->ol_flags & RTE_MBUF_F_TX_DYNF_NOINLINE ||
 			   nxlen > txq->inlen_send) {
 			return mlx5_tx_packet_multi_send(txq, loc, olx);
+		} else if (nxlen <= MLX5_ESEG_MIN_INLINE_SIZE) {
+			inlen = MLX5_ESEG_MIN_INLINE_SIZE;
 		} else {
 			goto do_first;
 		}