From: Shahaf Shuler Date: Tue, 20 Jun 2017 05:24:47 +0000 (+0300) Subject: net/mlx5: fix TSO segment size X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=83daf156a9e7845f16059aa45a781baf48eb8ff5;p=dpdk.git net/mlx5: fix TSO segment size In case on multi segment packet, the TSO segment size was taken from the last segment. This may lead to incorrect values in case not all segments are initialized with the field. Fixing it by taking the value from the first segment. Fixes: 3f13f8c23a7c ("net/mlx5: support hardware TSO") Cc: stable@dpdk.org Signed-off-by: Shahaf Shuler Acked-by: Yongseok Koh Acked-by: Nelio Laranjeiro --- diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index cade625f95..70314b3931 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -527,6 +527,7 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) uint16_t ehdr; uint8_t cs_flags = 0; uint64_t tso = 0; + uint16_t tso_segsz = 0; #ifdef MLX5_PMD_SOFT_COUNTERS uint32_t total_length = 0; #endif @@ -622,6 +623,7 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) tso_header_sz = buf->l2_len + vlan_sz + buf->l3_len + buf->l4_len; + tso_segsz = buf->tso_segsz; if (is_tunneled && txq->tunnel_en) { tso_header_sz += buf->outer_l2_len + @@ -821,7 +823,7 @@ next_pkt: }; wqe->eseg = (rte_v128u32_t){ 0, - cs_flags | (htons(buf->tso_segsz) << 16), + cs_flags | (htons(tso_segsz) << 16), 0, (ehdr << 16) | htons(tso_header_sz), };