[dpdk-dev] net/mlx5: fix inlining segmented TSO packet

Message ID 20180511005032.30646-1-yskoh@mellanox.com (mailing list archive)
State Superseded, archived
Delegated to: Shahaf Shuler
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Yongseok Koh May 11, 2018, 12:50 a.m. UTC
  When a multi-segmented packet is inlined, data can be further inlined even
after the first segment. In case of TSO packet, extra inline data after TSO
header should be carried by an inline DSEG which has 4B inline header
recording the length of the inline data. If more than one segment is
inlined, the length doesn't count from the second segment. This will cause
a fault in HW and CQE will have an error, which is ignored by PMD.

Fixes: f895536be4fa ("net/mlx5: enable inlining data from multiple segments")
Cc: stable@dpdk.org

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
---
 drivers/net/mlx5/mlx5_rxtx.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
  

Comments

Yongseok Koh May 11, 2018, 3:34 a.m. UTC | #1
> On May 10, 2018, at 5:50 PM, Yongseok Koh <yskoh@mellanox.com> wrote:
> 
> When a multi-segmented packet is inlined, data can be further inlined even
> after the first segment. In case of TSO packet, extra inline data after TSO
> header should be carried by an inline DSEG which has 4B inline header
> recording the length of the inline data. If more than one segment is
> inlined, the length doesn't count from the second segment. This will cause
> a fault in HW and CQE will have an error, which is ignored by PMD.
> 
> Fixes: f895536be4fa ("net/mlx5: enable inlining data from multiple segments")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yongseok Koh <yskoh@mellanox.com>

Shahaf,

If you apply this patch, please amend the signed-off-by tag.
I should've added Xueming as he found it for the first time.

> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> Signed-off-by: Yongseok Koh <yskoh@mellanox.com>


Thanks,
Yongseok
  

Patch

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index d960a73d5..2eed65642 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -680,8 +680,17 @@  mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 			} else if (!segs_n) {
 				goto next_pkt;
 			} else {
-				raw += copy_b;
-				inline_room -= copy_b;
+				/*
+				 * Further inline the next segment only for
+				 * non-TSO packets.
+				 */
+				if (!tso) {
+					raw += copy_b;
+					inline_room -= copy_b;
+				} else {
+					inline_room = 0;
+				}
+				/* Move to the next segment. */
 				--segs_n;
 				buf = buf->next;
 				assert(buf);