From: Shahaf Shuler Date: Sun, 17 Sep 2017 08:12:49 +0000 (+0300) Subject: net/mlx5: fix TSO segment size verification X-Git-Tag: spdx-start~1947 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=96fc8d6561b1b1348af97c2ed275922315d228c4;p=dpdk.git net/mlx5: fix TSO segment size verification TSO segment size must be larger then 0. 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 bc1f85c93e..8a1829aa7a 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -475,7 +475,10 @@ 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 (unlikely(tso_segsz == 0)) { + txq->stats.oerrors++; + break; + } if (is_tunneled && txq->tunnel_en) { tso_header_sz += buf->outer_l2_len + buf->outer_l3_len;