* [dpdk-dev] [PATCH] net/mlx5: fix inlining segmented TSO packet
@ 2018-05-11 0:50 Yongseok Koh
2018-05-11 3:34 ` Yongseok Koh
2018-05-11 17:39 ` [dpdk-dev] [PATCH v2] " Yongseok Koh
0 siblings, 2 replies; 4+ messages in thread
From: Yongseok Koh @ 2018-05-11 0:50 UTC (permalink / raw)
To: adrien.mazarguil, nelio.laranjeiro; +Cc: dev, shahafs, Yongseok Koh, stable
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(-)
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);
--
2.11.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] net/mlx5: fix inlining segmented TSO packet
2018-05-11 0:50 [dpdk-dev] [PATCH] net/mlx5: fix inlining segmented TSO packet Yongseok Koh
@ 2018-05-11 3:34 ` Yongseok Koh
2018-05-11 17:39 ` [dpdk-dev] [PATCH v2] " Yongseok Koh
1 sibling, 0 replies; 4+ messages in thread
From: Yongseok Koh @ 2018-05-11 3:34 UTC (permalink / raw)
To: Shahaf Shuler
Cc: dev, dpdk stable, Adrien Mazarguil, Nélio Laranjeiro,
Xueming(Steven) Li
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH v2] net/mlx5: fix inlining segmented TSO packet
2018-05-11 0:50 [dpdk-dev] [PATCH] net/mlx5: fix inlining segmented TSO packet Yongseok Koh
2018-05-11 3:34 ` Yongseok Koh
@ 2018-05-11 17:39 ` Yongseok Koh
2018-05-13 6:23 ` Shahaf Shuler
1 sibling, 1 reply; 4+ messages in thread
From: Yongseok Koh @ 2018-05-11 17:39 UTC (permalink / raw)
To: adrien.mazarguil, nelio.laranjeiro
Cc: dev, shahafs, Yongseok Koh, stable, Xueming Li
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: Xueming Li <xuemingl@mellanox.com>
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
---
v2:
* replace unnecessary check of 'inl' with assert().
* add "Signed-off-by: Xueming Li".
drivers/net/mlx5/mlx5_rxtx.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index d960a73d5..a2b373e21 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -645,7 +645,8 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
if (unlikely(max_wqe < n))
break;
max_wqe -= n;
- if (tso && !inl) {
+ if (tso) {
+ assert(inl == 0);
inl = rte_cpu_to_be_32(copy_b |
MLX5_INLINE_SEG);
rte_memcpy((void *)raw,
@@ -680,8 +681,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);
--
2.11.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/mlx5: fix inlining segmented TSO packet
2018-05-11 17:39 ` [dpdk-dev] [PATCH v2] " Yongseok Koh
@ 2018-05-13 6:23 ` Shahaf Shuler
0 siblings, 0 replies; 4+ messages in thread
From: Shahaf Shuler @ 2018-05-13 6:23 UTC (permalink / raw)
To: Yongseok Koh, Adrien Mazarguil, Nélio Laranjeiro
Cc: dev, stable, Xueming(Steven) Li
Friday, May 11, 2018 8:39 PM, Yongseok Koh:
> Subject: [PATCH v2] net/mlx5: fix inlining segmented TSO packet
>
> 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: Xueming Li <xuemingl@mellanox.com>
> Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Applied to next-net-mlx, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-05-13 6:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-11 0:50 [dpdk-dev] [PATCH] net/mlx5: fix inlining segmented TSO packet Yongseok Koh
2018-05-11 3:34 ` Yongseok Koh
2018-05-11 17:39 ` [dpdk-dev] [PATCH v2] " Yongseok Koh
2018-05-13 6:23 ` Shahaf Shuler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).