summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_rxtx.c
diff options
context:
space:
mode:
authorYongseok Koh <yskoh@mellanox.com>2018-05-11 10:39:13 -0700
committerFerruh Yigit <ferruh.yigit@intel.com>2018-05-14 22:32:22 +0100
commit5f44cfd011478bcf00430c53f276ddf9b795d443 (patch)
tree2059c8b81b948372cc2abd6cf72f19976e2de775 /drivers/net/mlx5/mlx5_rxtx.c
parent7c45f6c0794858999696f1f54b59d2a0e436e68b (diff)
downloaddpdk-5f44cfd011478bcf00430c53f276ddf9b795d443.zip
dpdk-5f44cfd011478bcf00430c53f276ddf9b795d443.tar.gz
dpdk-5f44cfd011478bcf00430c53f276ddf9b795d443.tar.xz
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>
Diffstat (limited to 'drivers/net/mlx5/mlx5_rxtx.c')
-rw-r--r--drivers/net/mlx5/mlx5_rxtx.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index c887d55..734ba0b 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -645,7 +645,8 @@ pkt_inline:
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 @@ pkt_inline:
} 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);