net/mlx5: fix TSO segment size verification
authorShahaf Shuler <shahafs@mellanox.com>
Sun, 17 Sep 2017 08:12:49 +0000 (11:12 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 6 Oct 2017 00:49:48 +0000 (02:49 +0200)
TSO segment size must be larger then 0.

Fixes: 3f13f8c23a7c ("net/mlx5: support hardware TSO")
Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
drivers/net/mlx5/mlx5_rxtx.c

index bc1f85c..8a1829a 100644 (file)
@@ -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;