Skip to contentSkip to conversation

net/mlx5: fix single not inline packet elts storing

PATCH New Viacheslav Ovsiienko 2 participants 4 messages Aug 11, 2022 – Aug 17, 2022 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: fix single not inline packet elts storing

The mlx5 PMD can inline packet data into transmitting descriptor (WQE) and free mbuf immediately as data no longer needed, for non-inline packets the mbuf pointer should be stored in elts array for coming freeing on send completion. There was an optimization on storing pointers in batch and there was missed storing mbuf for single packet if non-inline was explicitly requested by flag.

---
 drivers/net/mlx5/mlx5_tx.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_tx.h +3 -1
index f081921ffc..8e113e3778 100644
@@ -3322,7 +3322,9 @@ mlx5_tx_burst_single_send(struct mlx5_txq_data *__rte_restrict txq,
 			 * if no inlining is configured, this is done
 			 * by calling routine in a batch copy.
 			 */
-			MLX5_ASSERT(!MLX5_TXOFF_CONFIG(INLINE));
+			if (MLX5_TXOFF_CONFIG(INLINE))
+				txq->elts[txq->elts_head++ & txq->elts_m] =
+							loc->mbuf;
 			--loc->elts_free;
 #ifdef MLX5_PMD_SOFT_COUNTERS
 			/* Update sent data bytes counter. */
Signature · 1 line
2.18.1
#1 lore raw

PATCH 1/1 net/mlx5: fix single not inline packet elts storing

The mlx5 PMD can inline packet data into transmitting descriptor (WQE) and free mbuf immediately as data no longer needed, for non-inline packets the mbuf pointer should be stored in elts array for coming freeing on send completion. There was an optimization on storing pointers in batch and there was missed storing mbuf for single packet if non-inline was explicitly requested by flag.

Fixes cacb44a09962 ("net/mlx5: add no-inline Tx flag")
---
 drivers/net/mlx5/mlx5_tx.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_tx.h +3 -1
index 20776919c2..c65031ed3b 100644
@@ -3314,7 +3314,9 @@ mlx5_tx_burst_single_send(struct mlx5_txq_data *__rte_restrict txq,
 			 * if no inlining is configured, this is done
 			 * by calling routine in a batch copy.
 			 */
-			MLX5_ASSERT(!MLX5_TXOFF_CONFIG(INLINE));
+			if (MLX5_TXOFF_CONFIG(INLINE))
+				txq->elts[txq->elts_head++ & txq->elts_m] =
+							loc->mbuf;
 			--loc->elts_free;
 #ifdef MLX5_PMD_SOFT_COUNTERS
 			/* Update sent data bytes counter. */
Signature · 1 line
2.18.1
#2 lore raw

PATCH v2 1/1 net/mlx5: fix single not inline packet elts storing

In reply to Viacheslav Ovsiienko

The mlx5 PMD can inline packet data into transmitting descriptor (WQE) and free mbuf immediately as data no longer needed, for non-inline packets the mbuf pointer should be stored in elts array for coming freeing on send completion. There was an optimization on storing pointers in batch and there was missed storing mbuf for single packet if non-inline was explicitly requested by flag.

Fixes cacb44a09962 ("net/mlx5: add no-inline Tx flag")

---
v2: "Fixes tag" added

 drivers/net/mlx5/mlx5_tx.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_tx.h +3 -1
index 20776919c2..c65031ed3b 100644
@@ -3314,7 +3314,9 @@ mlx5_tx_burst_single_send(struct mlx5_txq_data *__rte_restrict txq,
 			 * if no inlining is configured, this is done
 			 * by calling routine in a batch copy.
 			 */
-			MLX5_ASSERT(!MLX5_TXOFF_CONFIG(INLINE));
+			if (MLX5_TXOFF_CONFIG(INLINE))
+				txq->elts[txq->elts_head++ & txq->elts_m] =
+							loc->mbuf;
 			--loc->elts_free;
 #ifdef MLX5_PMD_SOFT_COUNTERS
 			/* Update sent data bytes counter. */
Signature · 1 line
2.18.1
#3 lore raw

Hi,

Quoted 15 lines

-----Original Message-----
From: Slava Ovsiienko <[email protected]>
Sent: Wednesday, August 17, 2022 10:04 AM
To: [email protected]
Cc: Matan Azrad <[email protected]>; Raslan Darawsheh <[email protected]>; [email protected]
Subject: [PATCH v2] net/mlx5: fix single not inline packet elts storing

The mlx5 PMD can inline packet data into transmitting descriptor (WQE) and free mbuf immediately as data no longer needed, for non-inline packets the mbuf pointer should be stored in elts array for coming freeing on send completion. There was an optimization on storing pointers in batch and there was missed storing mbuf for single packet if non-inline was explicitly requested by flag.

Quoted 7 lines
Fixes cacb44a09962 ("net/mlx5: add no-inline Tx flag")

---
v2: "Fixes tag" added

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh