net/mlx5: fix dynamic inline hint handling
PATCH v2 1/1 net/mlx5: fix dynamic inline hint handling
The ConnectX NICs can transfer data from the host memory with two
approaches: provide the pointer to the data buffer, or do data inline
- copy the data to the transmit descriptor (WQE) entirely or only the part of data. In some configurations the NIC hardware requires the minimal data to be inline in the descriptor to operate correctly. And there is the special dynamic flag to hint PMD not to inline the data (for example, if buffer is located on some other device - storage or GPU) on per packet basis.
If there was a packet with length shorter than the minimal inline data length requested by the NIC hardware and the no-inline hint was set the PMD tried to inline the packet with minimal required length instead of actual packet's one. This patch adds the missed length check into no-inline hint handling branch.
--- drivers/net/mlx5/mlx5_rxtx.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/mlx5/mlx5_rxtx.c +3 -0
@@ -4739,6 +4739,8 @@ mlx5_tx_burst_single_send(struct mlx5_txq_data *__rte_restrict txq, txq->inlen_mode) || (MLX5_TXOFF_CONFIG(MPW) && txq->inlen_mode)) { +if (inlen <= txq->inlen_send) + goto single_inline;/* * The hardware requires the * minimal inline data header.
@@ -4755,6 +4757,7 @@ mlx5_tx_burst_single_send(struct mlx5_txq_data *__rte_restrict txq, } goto single_no_inline; } +single_inline:/* * Completely inlined packet data WQE: * - Control Segment, SEND opcode
Signature · 1 line
2.25.1
Hi,
Quoted 19 lines
-----Original Message-----
From: Gregory Etelson <[email protected]>
Sent: Thursday, July 23, 2020 5:21 PM
To: [email protected]
Cc: Gregory Etelson <[email protected]>; Matan Azrad <[email protected]>; Raslan Darawsheh <[email protected]>; Slava Ovsiienko <[email protected]>; Shahaf Shuler <[email protected]>
Subject: [PATCH v2] net/mlx5: fix dynamic inline hint handlingThe ConnectX NICs can transfer data from the host memory with two
approaches: provide the pointer to the data buffer, or do data inline
- copy the data to the transmit descriptor (WQE) entirely or only the part of data. In some configurations the NIC hardware requires the minimal data to be inline in the descriptor to operate correctly. And there is the special dynamic flag to hint PMD not to inline the data (for example, if buffer is located on some other device - storage or GPU) on per packet basis.
Quoted 7 lines
If there was a packet with length shorter than the minimal inline data length requested by the NIC hardware and the no-inline hint was set the PMD tried to inline the packet with minimal required length instead of actual packet's one. This patch adds the missed length check into no-inline hint handling branch.
Fixes cacb44a09962 ("net/mlx5: add no-inline Tx flag")
Added missing Cc: [email protected]
Quoted 29 lines
Signed-off-by Gregory Etelson <[email protected]>--- drivers/net/mlx5/mlx5_rxtx.c | 3 +++ 1 file changed, 3 insertions(+)drivers/net/mlx5/mlx5_rxtx.c +2
-0@@ -4739,6 +4739,8 @@ mlx5_tx_burst_single_send(struct mlx5_txq_data *__rte_restrict txq, txq->inlen_mode) || (MLX5_TXOFF_CONFIG(MPW) && txq->inlen_mode)) { +if (inlen <= txq->inlen_send) + goto single_inline;/* * The hardware requires the drivers/net/mlx5/mlx5_rxtx.c +1
-0* minimal inline data header. @@ -4755,6 +4757,7 @@ mlx5_tx_burst_single_send(struct mlx5_txq_data *__rte_restrict txq, } goto single_no_inline; } +single_inline:/* * Completely inlined packet data WQE:
Quoted 3 lines
* - Control Segment, SEND opcode
--
2.25.1
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh